summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/msg.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-12-14 04:25:29 +0000
committerjkh <jkh@FreeBSD.org>1999-12-14 04:25:29 +0000
commitd3944eb60a18bfd5f8b4b6ff033a61a20f2383cc (patch)
treee8c2e2130b60892a8d69589245c55613e2ca6edf /usr.sbin/sysinstall/msg.c
parent796518d06842cbc05ce0994ade4027837c42cec0 (diff)
downloadFreeBSD-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/msg.c')
-rw-r--r--usr.sbin/sysinstall/msg.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c
index 2986779..3d7affe 100644
--- a/usr.sbin/sysinstall/msg.c
+++ b/usr.sbin/sysinstall/msg.c
@@ -184,6 +184,7 @@ msgConfirm(char *fmt, ...)
{
va_list args;
char *errstr;
+ WINDOW *w = savescr();
errstr = (char *)alloca(FILENAME_MAX);
va_start(args, fmt);
@@ -196,6 +197,7 @@ msgConfirm(char *fmt, ...)
msgInfo(NULL);
}
dialog_notify(errstr);
+ restorescr(w);
}
/* Put up a message in a popup information box */
@@ -204,6 +206,7 @@ msgNotify(char *fmt, ...)
{
va_list args;
char *errstr;
+ WINDOW *w = savescr();
errstr = (char *)alloca(FILENAME_MAX);
va_start(args, fmt);
@@ -213,8 +216,9 @@ msgNotify(char *fmt, ...)
use_helpfile(NULL);
if (isDebug())
msgDebug("Notify: %s\n", errstr);
- dialog_clear_norefresh();
dialog_msgbox(NULL, errstr, -1, -1, 0);
+ sleep(1);
+ restorescr(w);
}
/* Put up a message in a popup yes/no box and return 1 for YES, 0 for NO */
@@ -224,7 +228,8 @@ msgYesNo(char *fmt, ...)
va_list args;
char *errstr;
int ret;
-
+ WINDOW *w = savescr();
+
errstr = (char *)alloca(FILENAME_MAX);
va_start(args, fmt);
vsnprintf(errstr, FILENAME_MAX, fmt, args);
@@ -236,6 +241,7 @@ msgYesNo(char *fmt, ...)
msgInfo(NULL);
}
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
+ restorescr(w);
return ret;
}
@@ -247,6 +253,7 @@ msgGetInput(char *buf, char *fmt, ...)
char *errstr;
static char input_buffer[256];
int rval;
+ WINDOW *w = savescr();
errstr = (char *)alloca(FILENAME_MAX);
va_start(args, fmt);
@@ -263,6 +270,7 @@ msgGetInput(char *buf, char *fmt, ...)
msgInfo(NULL);
}
rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
+ restorescr(w);
if (!rval)
return input_buffer;
else
@@ -292,7 +300,8 @@ msgWeHaveOutput(char *fmt, ...)
{
va_list args;
char *errstr;
-
+ WINDOW *w = savescr();
+
errstr = (char *)alloca(FILENAME_MAX);
va_start(args, fmt);
vsnprintf(errstr, FILENAME_MAX, fmt, args);
@@ -302,6 +311,7 @@ msgWeHaveOutput(char *fmt, ...)
msgDebug("Notify: %s\n", errstr);
dialog_clear_norefresh();
dialog_msgbox(NULL, errstr, -1, -1, 0);
+ restorescr(w);
}
/* Simple versions of msgConfirm() and msgNotify() for calling from scripts */
OpenPOWER on IntegriCloud