diff options
author | jkh <jkh@FreeBSD.org> | 2000-12-14 02:49:02 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2000-12-14 02:49:02 +0000 |
commit | c8394629dce8024ccb9d10490623035b757c034b (patch) | |
tree | 8b1e5ad94d0002f9b6fdae7211a93c59006db6cb | |
parent | 41a7e78c6b5ace25de009b8707f66f8543288720 (diff) | |
download | FreeBSD-src-c8394629dce8024ccb9d10490623035b757c034b.zip FreeBSD-src-c8394629dce8024ccb9d10490623035b757c034b.tar.gz |
Adapt sysinstall to use the new msgNoYes() function which assumes
no as a default. Sysinstall should be both less dangerous and less
annoying as a result of this change, though that's just my opinion
(since they're the defaults which annoy ME the least :).
-rw-r--r-- | release/sysinstall/disks.c | 6 | ||||
-rw-r--r-- | release/sysinstall/index.c | 2 | ||||
-rw-r--r-- | release/sysinstall/install.c | 22 | ||||
-rw-r--r-- | release/sysinstall/label.c | 6 | ||||
-rw-r--r-- | release/sysinstall/main.c | 4 | ||||
-rw-r--r-- | release/sysinstall/msg.c | 24 | ||||
-rw-r--r-- | release/sysinstall/sysinstall.h | 1 | ||||
-rw-r--r-- | release/sysinstall/system.c | 2 | ||||
-rw-r--r-- | release/sysinstall/tcpip.c | 4 | ||||
-rw-r--r-- | usr.sbin/sade/disks.c | 6 | ||||
-rw-r--r-- | usr.sbin/sade/install.c | 22 | ||||
-rw-r--r-- | usr.sbin/sade/label.c | 6 | ||||
-rw-r--r-- | usr.sbin/sade/main.c | 4 | ||||
-rw-r--r-- | usr.sbin/sade/msg.c | 24 | ||||
-rw-r--r-- | usr.sbin/sade/sade.h | 1 | ||||
-rw-r--r-- | usr.sbin/sade/system.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 6 | ||||
-rw-r--r-- | usr.sbin/sysinstall/index.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 22 | ||||
-rw-r--r-- | usr.sbin/sysinstall/label.c | 6 | ||||
-rw-r--r-- | usr.sbin/sysinstall/main.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/msg.c | 24 | ||||
-rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 1 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 4 |
25 files changed, 138 insertions, 69 deletions
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c index e93ff5a..ce05ea0 100644 --- a/release/sysinstall/disks.c +++ b/release/sysinstall/disks.c @@ -528,7 +528,7 @@ diskPartition(Device *dev) msgConfirm("You've already written this information out - you\n" "can't undo it."); } - else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + else if (!msgNoYes("Are you SURE you want to Undo everything?")) { char cp[BUFSIZ]; sstrncpy(cp, d->name, sizeof cp); @@ -546,7 +546,7 @@ diskPartition(Device *dev) break; case 'W': - if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" @@ -599,7 +599,7 @@ diskPartition(Device *dev) break; case '|': - if (!msgYesNo("Are you SURE you want to go into Wizard mode?\n" + if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n" "No seat belts whatsoever are provided!")) { clear(); refresh(); diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c index 054c9ac..426097b 100644 --- a/release/sysinstall/index.c +++ b/release/sysinstall/index.c @@ -486,7 +486,7 @@ pkg_fire(dialogMenuItem *self) msgInfo("Added %s to selection list", kp->name); } else if (ie->depc == 0) { - if (!msgYesNo("Do you really want to delete %s from the system?", kp->name)) { + if (!msgNoYes("Do you really want to delete %s from the system?", kp->name)) { if (vsystem("pkg_delete %s %s", isDebug() ? "-v" : "", kp->name)) { msgConfirm("Warning: pkg_delete of %s failed.\n Check debug output for details.", kp->name); } diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index a2bf9bd..14a0776 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -567,31 +567,29 @@ nodisks: dialog_clear_norefresh(); } - if (msgYesNo("Will this machine be a leaf node (e.g. will not forward packets\n" - "between interfaces)?")) + if (!msgNoYes("Do you want this machine to function as a network gateway?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); - if (msgYesNo("Do you want to grant only normal users FTP access to this\n" - "host (e.g. no anonymous FTP connections)?")) + if (!msgNoYes("Do you want to have anonymous FTP access to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); - if (!msgYesNo("Do you want to configure this machine as an NFS server?")) + if (!msgNoYes("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); - if (!msgYesNo("Do you want to configure this machine as an NFS client?")) + if (!msgNoYes("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); - if (!msgYesNo("Do you want to select a default security profile for\n" + if (!msgNoYes("Do you want to select a default security profile for\n" "this host (select No for \"medium\" security)?")) configSecurityProfile(self); else configSecurityModerate(self); dialog_clear_norefresh(); - if (!msgYesNo("Would you like to customize your system console settings?")) + if (!msgNoYes("Would you like to customize your system console settings?")) dmenuOpenSimple(&MenuSyscons, FALSE); dialog_clear_norefresh(); @@ -605,7 +603,7 @@ nodisks: #endif dialog_clear_norefresh(); - if (!msgYesNo("Does this system have a non-USB mouse attached to it?")) + if (!msgNoYes("Does this system have a USB mouse attached to it?")) dmenuOpenSimple(&MenuMouse, FALSE); /* Now would be a good time to checkpoint the configuration data */ @@ -731,7 +729,7 @@ static void installConfigure(void) { /* Final menu of last resort */ - if (!msgYesNo("Visit the general configuration menu for a chance to set\n" + if (!msgNoYes("Visit the general configuration menu for a chance to set\n" "any last options?")) dmenuOpenSimple(&MenuConfigure, FALSE); configRC_conf(); @@ -908,7 +906,7 @@ installFilesystems(dialogMenuItem *self) if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint); - if (root->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) { + if (root->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; dialog_clear_norefresh(); @@ -970,7 +968,7 @@ installFilesystems(dialogMenuItem *self) if (c2 == rootdev) continue; - if (tmp->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) + if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c index db5061a..952b6b2 100644 --- a/release/sysinstall/label.c +++ b/release/sysinstall/label.c @@ -1078,7 +1078,7 @@ diskLabel(Device *dev) msgConfirm("You've already written out your changes -\n" "it's too late to undo!"); } - else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + else if (!msgNoYes("Are you SURE you want to Undo everything?")) { variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); for (i = 0; devs[i]; i++) { @@ -1103,7 +1103,7 @@ diskLabel(Device *dev) "wish to overwrite them, you'll have to start this\n" "procedure again from the beginning."); } - else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" @@ -1116,7 +1116,7 @@ diskLabel(Device *dev) break; case '|': - if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\n" + if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { int i; diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c index 67de905..19196b3 100644 --- a/release/sysinstall/main.c +++ b/release/sysinstall/main.c @@ -149,9 +149,9 @@ main(int argc, char **argv) dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 #ifdef __alpha__ - || !msgYesNo("Are you sure you wish to exit? The system will halt.") + || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else - || !msgYesNo("Are you sure you wish to exit? The system will reboot\n" + || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" "(be sure to remove any floppies/CDROMs from the drives).") #endif ) diff --git a/release/sysinstall/msg.c b/release/sysinstall/msg.c index 19e16c5..a027905 100644 --- a/release/sysinstall/msg.c +++ b/release/sysinstall/msg.c @@ -242,6 +242,30 @@ msgYesNo(char *fmt, ...) return ret; } +/* Put up a message in a popup no/yes box and return 1 for YES, 0 for NO */ +int +msgNoYes(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); + va_end(args); + use_helpline(NULL); + use_helpfile(NULL); + if (OnVTY) { + ioctl(0, VT_ACTIVATE, 1); /* Switch back */ + msgInfo(NULL); + } + ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1); + restorescr(w); + return ret; +} + /* Put up a message in an input box and return the value */ char * msgGetInput(char *buf, char *fmt, ...) diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 4869909..ecbbfc1 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -687,6 +687,7 @@ extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); +extern int msgNoYes(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c index e2a36eb..29399b9 100644 --- a/release/sysinstall/system.c +++ b/release/sysinstall/system.c @@ -434,7 +434,7 @@ systemCreateHoloshell(void) if (kill(ehs_pid, 0) == 0) { - if (msgYesNo("There seems to be an emergency holographic shell\n" + if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index 7f4c600..3f725b5 100644 --- a/release/sysinstall/tcpip.c +++ b/release/sysinstall/tcpip.c @@ -268,7 +268,7 @@ tcpOpenDialog(Device *devp) /* Try a RTSOL scan if such behavior is desired */ if (!variable_cmp(VAR_TRY_RTSOL, "YES") || - ((!variable_cmp(VAR_TRY_RTSOL, "NO")) && (!msgYesNo("Do you want to try IPv6 configuration of the interface?")))) { + ((!variable_cmp(VAR_TRY_RTSOL, "NO")) && (!msgNoYes("Do you want to try IPv6 configuration of the interface?")))) { int i; int len; @@ -294,7 +294,7 @@ tcpOpenDialog(Device *devp) /* First try a DHCP scan if such behavior is desired */ if (!variable_cmp(VAR_TRY_DHCP, "YES") || - ((!variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgYesNo("Do you want to try DHCP configuration of the interface?")))) { + ((!variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgNoYes("Do you want to try DHCP configuration of the interface?")))) { Mkdir("/var/db"); Mkdir("/var/run"); Mkdir("/tmp"); diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index e93ff5a..ce05ea0 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -528,7 +528,7 @@ diskPartition(Device *dev) msgConfirm("You've already written this information out - you\n" "can't undo it."); } - else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + else if (!msgNoYes("Are you SURE you want to Undo everything?")) { char cp[BUFSIZ]; sstrncpy(cp, d->name, sizeof cp); @@ -546,7 +546,7 @@ diskPartition(Device *dev) break; case 'W': - if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" @@ -599,7 +599,7 @@ diskPartition(Device *dev) break; case '|': - if (!msgYesNo("Are you SURE you want to go into Wizard mode?\n" + if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n" "No seat belts whatsoever are provided!")) { clear(); refresh(); diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index a2bf9bd..14a0776 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -567,31 +567,29 @@ nodisks: dialog_clear_norefresh(); } - if (msgYesNo("Will this machine be a leaf node (e.g. will not forward packets\n" - "between interfaces)?")) + if (!msgNoYes("Do you want this machine to function as a network gateway?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); - if (msgYesNo("Do you want to grant only normal users FTP access to this\n" - "host (e.g. no anonymous FTP connections)?")) + if (!msgNoYes("Do you want to have anonymous FTP access to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); - if (!msgYesNo("Do you want to configure this machine as an NFS server?")) + if (!msgNoYes("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); - if (!msgYesNo("Do you want to configure this machine as an NFS client?")) + if (!msgNoYes("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); - if (!msgYesNo("Do you want to select a default security profile for\n" + if (!msgNoYes("Do you want to select a default security profile for\n" "this host (select No for \"medium\" security)?")) configSecurityProfile(self); else configSecurityModerate(self); dialog_clear_norefresh(); - if (!msgYesNo("Would you like to customize your system console settings?")) + if (!msgNoYes("Would you like to customize your system console settings?")) dmenuOpenSimple(&MenuSyscons, FALSE); dialog_clear_norefresh(); @@ -605,7 +603,7 @@ nodisks: #endif dialog_clear_norefresh(); - if (!msgYesNo("Does this system have a non-USB mouse attached to it?")) + if (!msgNoYes("Does this system have a USB mouse attached to it?")) dmenuOpenSimple(&MenuMouse, FALSE); /* Now would be a good time to checkpoint the configuration data */ @@ -731,7 +729,7 @@ static void installConfigure(void) { /* Final menu of last resort */ - if (!msgYesNo("Visit the general configuration menu for a chance to set\n" + if (!msgNoYes("Visit the general configuration menu for a chance to set\n" "any last options?")) dmenuOpenSimple(&MenuConfigure, FALSE); configRC_conf(); @@ -908,7 +906,7 @@ installFilesystems(dialogMenuItem *self) if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint); - if (root->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) { + if (root->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; dialog_clear_norefresh(); @@ -970,7 +968,7 @@ installFilesystems(dialogMenuItem *self) if (c2 == rootdev) continue; - if (tmp->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) + if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index db5061a..952b6b2 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -1078,7 +1078,7 @@ diskLabel(Device *dev) msgConfirm("You've already written out your changes -\n" "it's too late to undo!"); } - else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + else if (!msgNoYes("Are you SURE you want to Undo everything?")) { variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); for (i = 0; devs[i]; i++) { @@ -1103,7 +1103,7 @@ diskLabel(Device *dev) "wish to overwrite them, you'll have to start this\n" "procedure again from the beginning."); } - else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" @@ -1116,7 +1116,7 @@ diskLabel(Device *dev) break; case '|': - if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\n" + if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { int i; diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c index 67de905..19196b3 100644 --- a/usr.sbin/sade/main.c +++ b/usr.sbin/sade/main.c @@ -149,9 +149,9 @@ main(int argc, char **argv) dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 #ifdef __alpha__ - || !msgYesNo("Are you sure you wish to exit? The system will halt.") + || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else - || !msgYesNo("Are you sure you wish to exit? The system will reboot\n" + || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" "(be sure to remove any floppies/CDROMs from the drives).") #endif ) diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c index 19e16c5..a027905 100644 --- a/usr.sbin/sade/msg.c +++ b/usr.sbin/sade/msg.c @@ -242,6 +242,30 @@ msgYesNo(char *fmt, ...) return ret; } +/* Put up a message in a popup no/yes box and return 1 for YES, 0 for NO */ +int +msgNoYes(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); + va_end(args); + use_helpline(NULL); + use_helpfile(NULL); + if (OnVTY) { + ioctl(0, VT_ACTIVATE, 1); /* Switch back */ + msgInfo(NULL); + } + ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1); + restorescr(w); + return ret; +} + /* Put up a message in an input box and return the value */ char * msgGetInput(char *buf, char *fmt, ...) diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 4869909..ecbbfc1 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -687,6 +687,7 @@ extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); +extern int msgNoYes(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index e2a36eb..29399b9 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -434,7 +434,7 @@ systemCreateHoloshell(void) if (kill(ehs_pid, 0) == 0) { - if (msgYesNo("There seems to be an emergency holographic shell\n" + if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index e93ff5a..ce05ea0 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -528,7 +528,7 @@ diskPartition(Device *dev) msgConfirm("You've already written this information out - you\n" "can't undo it."); } - else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + else if (!msgNoYes("Are you SURE you want to Undo everything?")) { char cp[BUFSIZ]; sstrncpy(cp, d->name, sizeof cp); @@ -546,7 +546,7 @@ diskPartition(Device *dev) break; case 'W': - if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" @@ -599,7 +599,7 @@ diskPartition(Device *dev) break; case '|': - if (!msgYesNo("Are you SURE you want to go into Wizard mode?\n" + if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n" "No seat belts whatsoever are provided!")) { clear(); refresh(); diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c index 054c9ac..426097b 100644 --- a/usr.sbin/sysinstall/index.c +++ b/usr.sbin/sysinstall/index.c @@ -486,7 +486,7 @@ pkg_fire(dialogMenuItem *self) msgInfo("Added %s to selection list", kp->name); } else if (ie->depc == 0) { - if (!msgYesNo("Do you really want to delete %s from the system?", kp->name)) { + if (!msgNoYes("Do you really want to delete %s from the system?", kp->name)) { if (vsystem("pkg_delete %s %s", isDebug() ? "-v" : "", kp->name)) { msgConfirm("Warning: pkg_delete of %s failed.\n Check debug output for details.", kp->name); } diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index a2bf9bd..14a0776 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -567,31 +567,29 @@ nodisks: dialog_clear_norefresh(); } - if (msgYesNo("Will this machine be a leaf node (e.g. will not forward packets\n" - "between interfaces)?")) + if (!msgNoYes("Do you want this machine to function as a network gateway?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); - if (msgYesNo("Do you want to grant only normal users FTP access to this\n" - "host (e.g. no anonymous FTP connections)?")) + if (!msgNoYes("Do you want to have anonymous FTP access to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); - if (!msgYesNo("Do you want to configure this machine as an NFS server?")) + if (!msgNoYes("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); - if (!msgYesNo("Do you want to configure this machine as an NFS client?")) + if (!msgNoYes("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); - if (!msgYesNo("Do you want to select a default security profile for\n" + if (!msgNoYes("Do you want to select a default security profile for\n" "this host (select No for \"medium\" security)?")) configSecurityProfile(self); else configSecurityModerate(self); dialog_clear_norefresh(); - if (!msgYesNo("Would you like to customize your system console settings?")) + if (!msgNoYes("Would you like to customize your system console settings?")) dmenuOpenSimple(&MenuSyscons, FALSE); dialog_clear_norefresh(); @@ -605,7 +603,7 @@ nodisks: #endif dialog_clear_norefresh(); - if (!msgYesNo("Does this system have a non-USB mouse attached to it?")) + if (!msgNoYes("Does this system have a USB mouse attached to it?")) dmenuOpenSimple(&MenuMouse, FALSE); /* Now would be a good time to checkpoint the configuration data */ @@ -731,7 +729,7 @@ static void installConfigure(void) { /* Final menu of last resort */ - if (!msgYesNo("Visit the general configuration menu for a chance to set\n" + if (!msgNoYes("Visit the general configuration menu for a chance to set\n" "any last options?")) dmenuOpenSimple(&MenuConfigure, FALSE); configRC_conf(); @@ -908,7 +906,7 @@ installFilesystems(dialogMenuItem *self) if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint); - if (root->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) { + if (root->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; dialog_clear_norefresh(); @@ -970,7 +968,7 @@ installFilesystems(dialogMenuItem *self) if (c2 == rootdev) continue; - if (tmp->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) + if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index db5061a..952b6b2 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -1078,7 +1078,7 @@ diskLabel(Device *dev) msgConfirm("You've already written out your changes -\n" "it's too late to undo!"); } - else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + else if (!msgNoYes("Are you SURE you want to Undo everything?")) { variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); for (i = 0; devs[i]; i++) { @@ -1103,7 +1103,7 @@ diskLabel(Device *dev) "wish to overwrite them, you'll have to start this\n" "procedure again from the beginning."); } - else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" @@ -1116,7 +1116,7 @@ diskLabel(Device *dev) break; case '|': - if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\n" + if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { int i; diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c index 67de905..19196b3 100644 --- a/usr.sbin/sysinstall/main.c +++ b/usr.sbin/sysinstall/main.c @@ -149,9 +149,9 @@ main(int argc, char **argv) dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 #ifdef __alpha__ - || !msgYesNo("Are you sure you wish to exit? The system will halt.") + || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else - || !msgYesNo("Are you sure you wish to exit? The system will reboot\n" + || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" "(be sure to remove any floppies/CDROMs from the drives).") #endif ) diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c index 19e16c5..a027905 100644 --- a/usr.sbin/sysinstall/msg.c +++ b/usr.sbin/sysinstall/msg.c @@ -242,6 +242,30 @@ msgYesNo(char *fmt, ...) return ret; } +/* Put up a message in a popup no/yes box and return 1 for YES, 0 for NO */ +int +msgNoYes(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); + va_end(args); + use_helpline(NULL); + use_helpfile(NULL); + if (OnVTY) { + ioctl(0, VT_ACTIVATE, 1); /* Switch back */ + msgInfo(NULL); + } + ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1); + restorescr(w); + return ret; +} + /* Put up a message in an input box and return the value */ char * msgGetInput(char *buf, char *fmt, ...) diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 4869909..ecbbfc1 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -687,6 +687,7 @@ extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); +extern int msgNoYes(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index e2a36eb..29399b9 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -434,7 +434,7 @@ systemCreateHoloshell(void) if (kill(ehs_pid, 0) == 0) { - if (msgYesNo("There seems to be an emergency holographic shell\n" + if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 7f4c600..3f725b5 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -268,7 +268,7 @@ tcpOpenDialog(Device *devp) /* Try a RTSOL scan if such behavior is desired */ if (!variable_cmp(VAR_TRY_RTSOL, "YES") || - ((!variable_cmp(VAR_TRY_RTSOL, "NO")) && (!msgYesNo("Do you want to try IPv6 configuration of the interface?")))) { + ((!variable_cmp(VAR_TRY_RTSOL, "NO")) && (!msgNoYes("Do you want to try IPv6 configuration of the interface?")))) { int i; int len; @@ -294,7 +294,7 @@ tcpOpenDialog(Device *devp) /* First try a DHCP scan if such behavior is desired */ if (!variable_cmp(VAR_TRY_DHCP, "YES") || - ((!variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgYesNo("Do you want to try DHCP configuration of the interface?")))) { + ((!variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgNoYes("Do you want to try DHCP configuration of the interface?")))) { Mkdir("/var/db"); Mkdir("/var/run"); Mkdir("/tmp"); |