When adding an IPv4 host, one can not leave the IPv4-address field if

one has entered invalid data (like an incomplete IP).
Their was no feedback about this, though.
Apply a patch from Peter Postma that gives feedback in this case.
Closes problem noted when re-testing PR 16937.
This commit is contained in:
wiz 2004-04-05 10:25:12 +00:00
parent 0441200d07
commit 136d7943d4
2 changed files with 30 additions and 1 deletions

View File

@ -56,6 +56,8 @@ $set 3 run.c stuff
15 with the spacebar. Press the ENTER key to return from the list popup.
16 No help is available for this screen.
17 Are you sure? (Y/n)
18 The data entered in this field is invalid.
19 Please enter the correct information before continuing.
$set 4 menu titles and stuff
1 Select choice
2 Generating form data, please wait

View File

@ -1,4 +1,4 @@
/* $NetBSD: scanform.c,v 1.38 2004/03/24 22:03:17 garbled Exp $ */
/* $NetBSD: scanform.c,v 1.39 2004/04/05 10:25:12 wiz Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -1623,6 +1623,27 @@ tab_help(FORM *form)
curs_set(1);
}
static void
invalid_field_help(void)
{
CDKLABEL *label;
char *msg[2];
msg[0] = catgets(catalog, 3, 18, "The data entered in this field is "
"invalid.");
msg[1] = catgets(catalog, 3, 19, "Please enter the correct "
"information before continuing.");
curs_set(0);
label = newCDKLabel(cdkscreen, CENTER, CENTER, msg, 2, TRUE, FALSE);
activateCDKLabel(label, NULL);
waitCDKLabel(label, 0);
destroyCDKLabel(label);
touchwin(stdscr);
wrefresh(stdscr);
curs_set(1);
}
int
handle_form(char *basedir, char *path, char **args)
{
@ -1692,6 +1713,9 @@ handle_form(char *basedir, char *path, char **args)
case E_REQUEST_DENIED:
tab_help(menuform);
break;
case E_INVALID_FIELD:
invalid_field_help();
break;
default:
break;
}
@ -1796,6 +1820,9 @@ handle_preform(char *basedir, char *path)
case E_REQUEST_DENIED:
tab_help(menuform);
break;
case E_INVALID_FIELD:
invalid_field_help();
break;
default:
break;
}