Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sushi When adding an IPv4 host, one can not leave t...



details:   https://anonhg.NetBSD.org/src/rev/35d563e342c2
branches:  trunk
changeset: 565364:35d563e342c2
user:      wiz <wiz%NetBSD.org@localhost>
date:      Mon Apr 05 10:25:12 2004 +0000

description:
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.

diffstat:

 usr.sbin/sushi/C.msg      |   2 ++
 usr.sbin/sushi/scanform.c |  29 ++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)

diffs (69 lines):

diff -r 34703073239b -r 35d563e342c2 usr.sbin/sushi/C.msg
--- a/usr.sbin/sushi/C.msg      Mon Apr 05 10:22:30 2004 +0000
+++ b/usr.sbin/sushi/C.msg      Mon Apr 05 10:25:12 2004 +0000
@@ -56,6 +56,8 @@
 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
diff -r 34703073239b -r 35d563e342c2 usr.sbin/sushi/scanform.c
--- a/usr.sbin/sushi/scanform.c Mon Apr 05 10:22:30 2004 +0000
+++ b/usr.sbin/sushi/scanform.c Mon Apr 05 10:25:12 2004 +0000
@@ -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 @@
        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 @@
                case E_REQUEST_DENIED:
                        tab_help(menuform);
                        break;
+               case E_INVALID_FIELD:
+                       invalid_field_help();
+                       break;
                default:
                        break;
                }
@@ -1796,6 +1820,9 @@
                case E_REQUEST_DENIED:
                        tab_help(menuform);
                        break;
+               case E_INVALID_FIELD:
+                       invalid_field_help();
+                       break;
                default:
                        break;
                }



Home | Main Index | Thread Index | Old Index