Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sushi Some cleanups in how help is handled. Now pr...



details:   https://anonhg.NetBSD.org/src/rev/d1d00de8c202
branches:  trunk
changeset: 501964:d1d00de8c202
user:      garbled <garbled%NetBSD.org@localhost>
date:      Tue Jan 09 21:38:53 2001 +0000

description:
Some cleanups in how help is handled.  Now print a dialog box saying that
help could not be found when no help files are available.  When the help
window dissapears, redraw the screen so the menu isn't invisible.

diffstat:

 usr.sbin/sushi/C.msg      |   1 +
 usr.sbin/sushi/blabel.c   |  18 ++++++++++++------
 usr.sbin/sushi/handlers.c |  12 +++++++++++-
 usr.sbin/sushi/handlers.h |   3 ++-
 4 files changed, 26 insertions(+), 8 deletions(-)

diffs (96 lines):

diff -r 84086c715d4b -r d1d00de8c202 usr.sbin/sushi/C.msg
--- a/usr.sbin/sushi/C.msg      Tue Jan 09 21:31:02 2001 +0000
+++ b/usr.sbin/sushi/C.msg      Tue Jan 09 21:38:53 2001 +0000
@@ -41,6 +41,7 @@
 7 Finished
 8 Press any key to continue
 9 Use HOME,END,PGUP,PDGN,UP/DOWN Arrow keys to scroll ESC, F3 exits, F10 quits.
+10 No help is available for this screen.
 $set 4 menu titles and stuff
 1 Select choice
 2 Generating form data, please wait
diff -r 84086c715d4b -r d1d00de8c202 usr.sbin/sushi/blabel.c
--- a/usr.sbin/sushi/blabel.c   Tue Jan 09 21:31:02 2001 +0000
+++ b/usr.sbin/sushi/blabel.c   Tue Jan 09 21:38:53 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: blabel.c,v 1.4 2001/01/09 19:01:57 garbled Exp $       */
+/*      $NetBSD: blabel.c,v 1.5 2001/01/09 21:38:53 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -102,15 +102,21 @@
                        p = searchpaths[i];   
                        rc = simple_lang_handler(p, HELPFILE, handle_help);
                }
-               if (rc != -2)
+               if (rc != -2) {
+                       eraseCDKScreen(cdkscreen);
+                       refreshCDKScreen(cdkscreen);
                        return;
+               }
        } else {
                rc = simple_lang_handler((char *)clientdata, HELPFILE,
                    handle_help);
-               if (rc != -2)
+               if (rc != -2) {
+                       eraseCDKScreen(cdkscreen);
+                       refreshCDKScreen(cdkscreen);
                        return;
+               }
        }
-       /* now do something meaningful */
+       nohelp();
 }
 
 /*ARGSUSED*/
@@ -125,8 +131,8 @@
 static void
 do_refresh(EObjectType cdktype, void *object, void *clientdata, chtype key)
 {
-       eraseCDKScreen (cdkscreen);
-       refreshCDKScreen (cdkscreen);
+       eraseCDKScreen(cdkscreen);
+       refreshCDKScreen(cdkscreen);
 }
 
 /*ARGSUSED*/
diff -r 84086c715d4b -r d1d00de8c202 usr.sbin/sushi/handlers.c
--- a/usr.sbin/sushi/handlers.c Tue Jan 09 21:31:02 2001 +0000
+++ b/usr.sbin/sushi/handlers.c Tue Jan 09 21:38:53 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: handlers.c,v 1.1 2001/01/05 01:28:36 garbled Exp $       */
+/*      $NetBSD: handlers.c,v 1.2 2001/01/09 21:38:53 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -262,3 +262,13 @@
        bailout("%s: %s", catgets(catalog, 1, 6, "empty endpoint"), path);
        return(0);
 }
+
+void
+nohelp(void)
+{
+       char *mesg[2];
+
+       mesg[0] = catgets(catalog, 3, 10,
+           "No help is available for this screen.");
+       popupLabel(cdkscreen, mesg, 1);
+}
diff -r 84086c715d4b -r d1d00de8c202 usr.sbin/sushi/handlers.h
--- a/usr.sbin/sushi/handlers.h Tue Jan 09 21:31:02 2001 +0000
+++ b/usr.sbin/sushi/handlers.h Tue Jan 09 21:38:53 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: handlers.h,v 1.2 2001/01/05 18:57:25 thorpej Exp $       */
+/*      $NetBSD: handlers.h,v 1.3 2001/01/09 21:38:53 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@
 int handle_script(char *path);
 int handle_endpoint(char *path);
 int simple_lang_handler(char *path, char *file, int(* handler)(char *));
+void nohelp(void);
 
 #define INDEXFILE      "index"
 #define PREFORMFILE    "preform"



Home | Main Index | Thread Index | Old Index