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 :).
This commit is contained in:
jkh 2000-12-14 02:49:02 +00:00
parent 41a7e78c6b
commit c8394629dc
25 changed files with 138 additions and 69 deletions

View File

@ -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();

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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
)

View File

@ -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, ...)

View File

@ -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 *);

View File

@ -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;

View File

@ -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");

View File

@ -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();

View File

@ -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);

View File

@ -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;

View File

@ -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
)

View File

@ -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, ...)

View File

@ -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 *);

View File

@ -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;

View File

@ -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();

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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
)

View File

@ -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, ...)

View File

@ -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 *);

View File

@ -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;

View File

@ -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");