diff options
author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-12-17 02:46:04 +0000 |
---|---|---|
committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-12-17 02:46:04 +0000 |
commit | 61547e027bece2dac236b534d9cee65c72b2ae6d (patch) | |
tree | 0fcfc7ae7e118c4b4d28ca18bf50a0d3eca583aa /usr.sbin | |
parent | 9639dc68d7eda2406d2b958ec07e2163b247c23b (diff) |
In retrospect, msgNotify() should leave its contents on the screen
longer to give the user something to look at while things are happening.
Change it to do so and insert the appropriate screen saves elsewhere.
Notes
Notes:
svn path=/head/; revision=54722
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/devices.c | 1 | ||||
-rw-r--r-- | usr.sbin/sade/disks.c | 2 | ||||
-rw-r--r-- | usr.sbin/sade/install.c | 1 | ||||
-rw-r--r-- | usr.sbin/sade/menus.c | 12 | ||||
-rw-r--r-- | usr.sbin/sade/msg.c | 4 | ||||
-rw-r--r-- | usr.sbin/sade/system.c | 3 | ||||
-rw-r--r-- | usr.sbin/sysinstall/anonFTP.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 1 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/dist.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 1 | ||||
-rw-r--r-- | usr.sbin/sysinstall/media.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/menus.c | 12 | ||||
-rw-r--r-- | usr.sbin/sysinstall/mouse.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/msg.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/network.c | 17 | ||||
-rw-r--r-- | usr.sbin/sysinstall/nfs.c | 5 | ||||
-rw-r--r-- | usr.sbin/sysinstall/package.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 3 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tape.c | 6 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 2 |
21 files changed, 55 insertions, 39 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index dd61e272c45b..e4dcf928ec9d 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -438,6 +438,7 @@ skipif: } free(names); } + dialog_clear_norefresh(); } /* Rescan all devices, after closing previous set - convenience function */ diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 20a7e906b937..2a611b927e89 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -678,7 +678,7 @@ diskPartitionWrite(dialogMenuItem *self) } /* Now it's not "yes", but "written" */ variable_set2(DISK_PARTITIONED, "written", 0); - return DITEM_SUCCESS; + return DITEM_SUCCESS | DITEM_RESTORE; } /* Partition a disk based wholly on which variables are set */ diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 8d9da8176a45..1b8c43e6bc6f 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -961,6 +961,7 @@ installFilesystems(dialogMenuItem *self) command_sort(); command_execute(); + dialog_clear_norefresh(); return DITEM_SUCCESS; } diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index 0cc8c0c9253a..ff0b96ca13f7 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -819,7 +819,7 @@ DMenu MenuSubDistributions = { NULL, NULL, { { "All", "All system sources, binaries and X Window System", - NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, + NULL, distSetEverything }, { "Reset", "Reset all of the below", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Binary base distribution (required)", @@ -875,7 +875,7 @@ DMenu MenuDESDistributions = { NULL, NULL, { { "All", "Select all of the below", - NULL, setDES, NULL, NULL, ' ', ' ', ' ' }, + NULL, setDES }, { "Reset", "Reset all of the below", NULL, clearDES, NULL, NULL, ' ', ' ', ' ' }, { " des", "Basic DES encryption services", @@ -904,7 +904,7 @@ DMenu MenuSrcDistributions = { NULL, NULL, { { "All", "Select all of the below", - NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, + NULL, setSrc }, { "Reset", "Reset all of the below", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { " base", "top-level files in /usr/src", @@ -964,7 +964,7 @@ DMenu MenuXF86SelectCore = { NULL, NULL, { { "All", "Select all below", - NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, + NULL, setX11Misc }, { "Reset", "Reset all below", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Client applications and shared libs", @@ -1008,7 +1008,7 @@ install. At the minimum, you should install the standard\n\ NULL, NULL, { { "All", "All fonts", - NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, + NULL, setX11Fonts }, { "Reset", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { " fnts", "Standard 75 DPI and miscellaneous fonts", @@ -1036,7 +1036,7 @@ DMenu MenuXF86SelectServer = { NULL, NULL, { { "All", "Select all of the above", - NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, + NULL, setX11Servers }, { "Reset", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { " SVGA", "Standard VGA or Super VGA card", diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c index 3d7affe40fc6..499d70501a37 100644 --- a/usr.sbin/sade/msg.c +++ b/usr.sbin/sade/msg.c @@ -206,7 +206,6 @@ msgNotify(char *fmt, ...) { va_list args; char *errstr; - WINDOW *w = savescr(); errstr = (char *)alloca(FILENAME_MAX); va_start(args, fmt); @@ -217,8 +216,6 @@ msgNotify(char *fmt, ...) if (isDebug()) msgDebug("Notify: %s\n", errstr); 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 */ @@ -310,6 +307,7 @@ msgWeHaveOutput(char *fmt, ...) use_helpfile(NULL); msgDebug("Notify: %s\n", errstr); dialog_clear_norefresh(); + sleep(2); dialog_msgbox(NULL, errstr, -1, -1, 0); restorescr(w); } diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index c03d211bb89a..dfe3889507bc 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -399,8 +399,11 @@ systemCreateHoloshell(void) exit(1); } else { + WINDOW *w = savescr(); + msgNotify("Starting an emergency holographic shell on VTY4"); sleep(2); + restorescr(w); } } } diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c index 04f8fbce3337..83795cd098ff 100644 --- a/usr.sbin/sysinstall/anonFTP.c +++ b/usr.sbin/sysinstall/anonFTP.c @@ -179,7 +179,7 @@ createFtpUser(void) fclose(fptr); msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD); vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD); - return DITEM_SUCCESS; + return DITEM_SUCCESS | DITEM_RESTORE; } /* This is it - how to get the setup values */ @@ -311,5 +311,5 @@ configAnonFTP(dialogMenuItem *self) } if (DITEM_STATUS(i) == DITEM_SUCCESS) variable_set2("anon_ftp", "YES", 0); - return i; + return i | DITEM_RESTORE; } diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index dd61e272c45b..e4dcf928ec9d 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -438,6 +438,7 @@ skipif: } free(names); } + dialog_clear_norefresh(); } /* Rescan all devices, after closing previous set - convenience function */ diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 20a7e906b937..2a611b927e89 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -678,7 +678,7 @@ diskPartitionWrite(dialogMenuItem *self) } /* Now it's not "yes", but "written" */ variable_set2(DISK_PARTITIONED, "written", 0); - return DITEM_SUCCESS; + return DITEM_SUCCESS | DITEM_RESTORE; } /* Partition a disk based wholly on which variables are set */ diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index a834af826fd5..abb1d545c75b 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -389,6 +389,7 @@ distMaybeSetDES(dialogMenuItem *self) { int i = DITEM_SUCCESS | DITEM_REDRAW; + dialog_clear_norefresh(); if (!msgYesNo("Do you wish to install DES cryptographic software?\n\n" "If you choose No, FreeBSD will use an MD5 based password scheme which,\n" "while perhaps more secure, is not interoperable with the traditional\n" @@ -404,12 +405,13 @@ distMaybeSetDES(dialogMenuItem *self) i = DITEM_FAILURE; } distVerifyFlags(); - return i | DITEM_REDRAW; + return i | DITEM_REDRAW | DITEM_RESTORE; } static int distMaybeSetPorts(dialogMenuItem *self) { + dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" "This will give you ready access to over 2000 ported software packages,\n" "though at a cost of around 90MB of disk space when \"clean\" and possibly\n" @@ -423,7 +425,7 @@ distMaybeSetPorts(dialogMenuItem *self) Dists |= DIST_PORTS; else Dists &= ~DIST_PORTS; - return DITEM_SUCCESS; + return DITEM_SUCCESS | DITEM_RESTORE; } static Boolean @@ -865,8 +867,8 @@ distExtractAll(dialogMenuItem *self) distVerifyFlags(); dialog_clear_norefresh(); - msgNotify("Attempting to install all selected distributions.."); w = savescr(); + msgNotify("Attempting to install all selected distributions.."); /* Try for 3 times around the loop, then give up. */ while (Dists && ++retries < 3) diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 8d9da8176a45..1b8c43e6bc6f 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -961,6 +961,7 @@ installFilesystems(dialogMenuItem *self) command_sort(); command_execute(); + dialog_clear_norefresh(); return DITEM_SUCCESS; } diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 1c27a0d16ffe..2ca3ea50d4ea 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -416,7 +416,7 @@ mediaSetFTP(dialogMenuItem *self) ftpDevice.shutdown = mediaShutdownFTP; ftpDevice.private = networkDev; mediaDevice = &ftpDevice; - return DITEM_SUCCESS | DITEM_LEAVE_MENU; + return DITEM_SUCCESS | DITEM_LEAVE_MENU | DITEM_RESTORE; } int diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 0cc8c0c9253a..ff0b96ca13f7 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -819,7 +819,7 @@ DMenu MenuSubDistributions = { NULL, NULL, { { "All", "All system sources, binaries and X Window System", - NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, + NULL, distSetEverything }, { "Reset", "Reset all of the below", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Binary base distribution (required)", @@ -875,7 +875,7 @@ DMenu MenuDESDistributions = { NULL, NULL, { { "All", "Select all of the below", - NULL, setDES, NULL, NULL, ' ', ' ', ' ' }, + NULL, setDES }, { "Reset", "Reset all of the below", NULL, clearDES, NULL, NULL, ' ', ' ', ' ' }, { " des", "Basic DES encryption services", @@ -904,7 +904,7 @@ DMenu MenuSrcDistributions = { NULL, NULL, { { "All", "Select all of the below", - NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, + NULL, setSrc }, { "Reset", "Reset all of the below", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { " base", "top-level files in /usr/src", @@ -964,7 +964,7 @@ DMenu MenuXF86SelectCore = { NULL, NULL, { { "All", "Select all below", - NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, + NULL, setX11Misc }, { "Reset", "Reset all below", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Client applications and shared libs", @@ -1008,7 +1008,7 @@ install. At the minimum, you should install the standard\n\ NULL, NULL, { { "All", "All fonts", - NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, + NULL, setX11Fonts }, { "Reset", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { " fnts", "Standard 75 DPI and miscellaneous fonts", @@ -1036,7 +1036,7 @@ DMenu MenuXF86SelectServer = { NULL, NULL, { { "All", "Select all of the above", - NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, + NULL, setX11Servers }, { "Reset", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { " SVGA", "Standard VGA or Super VGA card", diff --git a/usr.sbin/sysinstall/mouse.c b/usr.sbin/sysinstall/mouse.c index 5670b9a7977f..2eec6be8e954 100644 --- a/usr.sbin/sysinstall/mouse.c +++ b/usr.sbin/sysinstall/mouse.c @@ -67,7 +67,7 @@ mousedTest(dialogMenuItem *self) vsystem("ln -fs /dev/sysmouse /dev/mouse"); /* backwards compat */ } - return DITEM_SUCCESS; + return DITEM_SUCCESS | DITEM_RESTORE; } int diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c index 3d7affe40fc6..499d70501a37 100644 --- a/usr.sbin/sysinstall/msg.c +++ b/usr.sbin/sysinstall/msg.c @@ -206,7 +206,6 @@ msgNotify(char *fmt, ...) { va_list args; char *errstr; - WINDOW *w = savescr(); errstr = (char *)alloca(FILENAME_MAX); va_start(args, fmt); @@ -217,8 +216,6 @@ msgNotify(char *fmt, ...) if (isDebug()) msgDebug("Notify: %s\n", errstr); 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 */ @@ -310,6 +307,7 @@ msgWeHaveOutput(char *fmt, ...) use_helpfile(NULL); msgDebug("Notify: %s\n", errstr); dialog_clear_norefresh(); + sleep(2); dialog_msgbox(NULL, errstr, -1, -1, 0); restorescr(w); } diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c index b92e37bac599..5e064a7ae070 100644 --- a/usr.sbin/sysinstall/network.c +++ b/usr.sbin/sysinstall/network.c @@ -70,9 +70,12 @@ mediaInitNetwork(Device *dev) } } + w = savescr(); + dialog_clear_norefresh(); + /* Old PPP process lying around? */ if (pppPID) { - msgNotify("Killing previous PPP process %d.", pppPID); + msgConfirm("Killing previous PPP process %d.", pppPID); kill(pppPID, SIGTERM); pppPID = 0; } @@ -88,8 +91,6 @@ mediaInitNetwork(Device *dev) char *val; char attach[256]; - w = savescr(); - dialog_clear_norefresh(); /* Cheesy slip attach */ snprintf(attach, 256, "slattach -a -h -l -s 9600 %s", dev->devname); val = msgGetInput(attach, @@ -131,7 +132,7 @@ mediaInitNetwork(Device *dev) } else if (!strcmp(cp, "DHCP")) goto bail; - msgNotify("ifconfig %s %s", dev->name, cp); + msgDebug("ifconfig %s %s", dev->name, cp); i = vsystem("ifconfig %s %s", dev->name, cp); if (i) { msgConfirm("Unable to configure the %s interface!\n" @@ -145,7 +146,7 @@ mediaInitNetwork(Device *dev) "not on your local network"); } else { - msgNotify("Adding default route to %s.", rp); + msgDebug("Adding default route to %s.", rp); vsystem("route -n add default %s", rp); } bail: @@ -173,18 +174,18 @@ mediaShutdownNetwork(Device *dev) cp = variable_get(ifconfig); if (!cp) return; - msgNotify("ifconfig %s down", dev->name); + msgDebug("ifconfig %s down", dev->name); i = vsystem("ifconfig %s down", dev->name); if (i) msgConfirm("Warning: Unable to down the %s interface properly", dev->name); cp = variable_get(VAR_GATEWAY); if (cp) { - msgNotify("Deleting default route."); + msgDebug("Deleting default route."); vsystem("route -n delete default"); } } else if (pppPID) { - msgNotify("Killing previous PPP process %d.", pppPID); + msgConfirm("Killing previous PPP process %d.", pppPID); kill(pppPID, SIGTERM); pppPID = 0; } diff --git a/usr.sbin/sysinstall/nfs.c b/usr.sbin/sysinstall/nfs.c index 53b3f42b7bbe..f9a557239a92 100644 --- a/usr.sbin/sysinstall/nfs.c +++ b/usr.sbin/sysinstall/nfs.c @@ -48,6 +48,7 @@ Boolean mediaInitNFS(Device *dev) { Device *netDevice = (Device *)dev->private; + WINDOW *w = savescr(); if (NFSMounted) return TRUE; @@ -65,11 +66,13 @@ mediaInitNFS(Device *dev) msgConfirm("Error mounting %s on %s: %s.", dev->name, mountpoint, strerror(errno)); if (netDevice) netDevice->shutdown(netDevice); + restorescr(w); return FALSE; } NFSMounted = TRUE; if (isDebug()) msgDebug("Mounted NFS device %s onto %s\n", dev->name, mountpoint); + restorescr(w); return TRUE; } @@ -85,7 +88,7 @@ mediaShutdownNFS(Device *dev) if (!NFSMounted) return; - msgNotify("Unmounting NFS partition on %s", mountpoint); + msgDebug("Unmounting NFS partition on %s", mountpoint); if (unmount(mountpoint, MNT_FORCE) != 0) msgConfirm("Could not unmount the NFS partition: %s", strerror(errno)); NFSMounted = FALSE; diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c index e11a2c705b87..4af188a731f5 100644 --- a/usr.sbin/sysinstall/package.c +++ b/usr.sbin/sysinstall/package.c @@ -157,6 +157,7 @@ package_extract(Device *dev, char *name, Boolean depended) if (fp) { int i = 0, tot, pfd[2]; pid_t pid; + WINDOW *w = savescr(); sigpipe_caught = FALSE; signal(SIGPIPE, catch_pipe); @@ -176,7 +177,6 @@ package_extract(Device *dev, char *name, Boolean depended) } else { char buf[BUFSIZ]; - WINDOW *w = savescr(); struct timeval start, stop; close(pfd[0]); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index c03d211bb89a..dfe3889507bc 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -399,8 +399,11 @@ systemCreateHoloshell(void) exit(1); } else { + WINDOW *w = savescr(); + msgNotify("Starting an emergency holographic shell on VTY4"); sleep(2); + restorescr(w); } } } diff --git a/usr.sbin/sysinstall/tape.c b/usr.sbin/sysinstall/tape.c index 53518ef94fcb..256fe953bf03 100644 --- a/usr.sbin/sysinstall/tape.c +++ b/usr.sbin/sysinstall/tape.c @@ -68,6 +68,8 @@ mediaGetTape(Device *dev, char *file, Boolean probe) int i; if (!tapeInitted) { + WINDOW *w = savescr(); + msgDebug("Tape init routine called for %s (private dir is %s)\n", dev->name, dev->private); Mkdir(dev->private); if (chdir(dev->private)) { @@ -88,8 +90,10 @@ mediaGetTape(Device *dev, char *file, Boolean probe) else { msgConfirm("Tape extract command failed with status %d!\n" "Unable to use tape media.", i); + restorescr(w); return (FILE *)IO_ERROR; } + restorescr(w); } sprintf(buf, "%s/%s", (char *)dev->private, file); @@ -113,7 +117,7 @@ mediaShutdownTape(Device *dev) if (!tapeInitted) return; if (file_readable((char *)dev->private)) { - msgNotify("Cleaning up results of tape extract in %s..", + msgDebug("Cleaning up results of tape extract in %s..", (char *)dev->private); (void)vsystem("rm -rf %s", (char *)dev->private); } diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 28273f3a12ec..453fe5fab660 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -205,6 +205,7 @@ tcpOpenDialog(Device *devp) char *tmp; char title[80]; + save = savescr(); /* Initialise vars from previous device values */ if (devp->private) { DevInfo *di = (DevInfo *)devp->private; @@ -282,7 +283,6 @@ tcpOpenDialog(Device *devp) SAFE_STRCPY(nameserver, tmp); } - save = savescr(); /* If non-interactive, jump straight over the dialog crap and into config section */ if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_NETINTERACTIVE)) { |