diff options
author | jkh <jkh@FreeBSD.org> | 1999-12-14 04:25:29 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1999-12-14 04:25:29 +0000 |
commit | d3944eb60a18bfd5f8b4b6ff033a61a20f2383cc (patch) | |
tree | e8c2e2130b60892a8d69589245c55613e2ca6edf /usr.sbin/sysinstall/dmenu.c | |
parent | 796518d06842cbc05ce0994ade4027837c42cec0 (diff) | |
download | FreeBSD-src-d3944eb60a18bfd5f8b4b6ff033a61a20f2383cc.zip FreeBSD-src-d3944eb60a18bfd5f8b4b6ff033a61a20f2383cc.tar.gz |
Completely rip-out and redesign sysinstall's refresh model as well
as redoing all the menus to have proper, or at least non-hallucinogenic,
keyboard accelerators.
This requires my recent update to libdialog to work properly and will
probably also exhibit some other "interesting" behavior while the last
few missing screen clears are found (which is why I'm not going to MFC
immediately). At least now, however, sysinstall does not gratuitously
redraw random screens at the drop of a hat and drive serial console
installers out of their minds.
Diffstat (limited to 'usr.sbin/sysinstall/dmenu.c')
-rw-r--r-- | usr.sbin/sysinstall/dmenu.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index 9e464d9..6f5f4e5 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/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; + } } } |