aboutsummaryrefslogtreecommitdiff
path: root/release/sysinstall/dmenu.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1999-12-14 04:25:29 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1999-12-14 04:25:29 +0000
commit7025aeb16e091cf9515535424d0532b53c618b83 (patch)
treea4fa2148685a8fd9c12ca7648603d5499e521f49 /release/sysinstall/dmenu.c
parent34fa0973611c929a22ea016ed691c4e152ba0054 (diff)
Notes
Diffstat (limited to 'release/sysinstall/dmenu.c')
-rw-r--r--release/sysinstall/dmenu.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/release/sysinstall/dmenu.c b/release/sysinstall/dmenu.c
index 9e464d9234a6..6f5f4e5a175e 100644
--- a/release/sysinstall/dmenu.c
+++ b/release/sysinstall/dmenu.c
@@ -45,14 +45,13 @@ int
dmenuDisplayFile(dialogMenuItem *tmp)
{
systemDisplayHelp((char *)tmp->data);
- return DITEM_SUCCESS | DITEM_RESTORE;
+ return DITEM_SUCCESS;
}
int
dmenuSubmenu(dialogMenuItem *tmp)
{
- return (dmenuOpenSimple((DMenu *)(tmp->data), FALSE) ? DITEM_SUCCESS : DITEM_FAILURE) |
- DITEM_RESTORE;
+ return (dmenuOpenSimple((DMenu *)(tmp->data), FALSE) ? DITEM_SUCCESS : DITEM_FAILURE);
}
int
@@ -72,10 +71,13 @@ dmenuSystemCommand(dialogMenuItem *self)
int
dmenuSystemCommandBox(dialogMenuItem *tmp)
{
+ WINDOW *w = savescr();
+
use_helpfile(NULL);
use_helpline("Select OK to dismiss this dialog");
dialog_prgbox(tmp->title, (char *)tmp->data, 22, 76, 1, 1);
- return DITEM_SUCCESS | DITEM_RESTORE;
+ restorescr(w);
+ return DITEM_SUCCESS;
}
int
@@ -147,15 +149,12 @@ int
dmenuISetVariable(dialogMenuItem *tmp)
{
char *ans, *var;
- WINDOW *w = NULL; /* Keep lint happy */
if (!(var = (char *)tmp->data)) {
msgConfirm("Incorrect data field for `%s'!", tmp->title);
return DITEM_FAILURE;
}
- w = savescr();
ans = msgGetInput(variable_get(var), tmp->title, 1);
- restorescr(w);
if (!ans)
return DITEM_FAILURE;
else if (!*ans)
@@ -275,13 +274,13 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean bu
while (1) {
char buf[FILENAME_MAX];
+ WINDOW *w = savescr();
/* Any helpful hints, put 'em up! */
use_helpline(menu->helpline);
use_helpfile(systemHelpFile(menu->helpfile, buf));
-
- /* Pop up that dialog! */
dialog_clear_norefresh();
+ /* Pop up that dialog! */
if (menu->type & DMENU_NORMAL_TYPE)
rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
menu_height(menu, n), -n, items, (char *)buttons, choice, scroll);
@@ -295,14 +294,18 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean bu
menu_height(menu, n), -n, items, (char *)buttons);
else
msgFatal("Menu: `%s' is of an unknown type\n", menu->title);
- clearok(stdscr, TRUE);
if (exited) {
exited = FALSE;
+ restorescr(w);
return TRUE;
}
- else if (rval)
+ else if (rval) {
+ restorescr(w);
return FALSE;
- else if (menu->type & DMENU_SELECTION_RETURNS)
+ }
+ else if (menu->type & DMENU_SELECTION_RETURNS) {
+ restorescr(w);
return TRUE;
+ }
}
}