Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sushi Handle finding help for F1 better in the topl...
details: https://anonhg.NetBSD.org/src/rev/0dd0bb5a260f
branches: trunk
changeset: 501926:0dd0bb5a260f
user: garbled <garbled%NetBSD.org@localhost>
date: Tue Jan 09 09:41:41 2001 +0000
description:
Handle finding help for F1 better in the toplevel menu.
TODO: print a dialog message if help cannot be found.
diffstat:
usr.sbin/sushi/blabel.c | 29 ++++++++++++++++++-----------
usr.sbin/sushi/sushi.c | 4 ++--
2 files changed, 20 insertions(+), 13 deletions(-)
diffs (70 lines):
diff -r 0633707ba32c -r 0dd0bb5a260f usr.sbin/sushi/blabel.c
--- a/usr.sbin/sushi/blabel.c Tue Jan 09 09:25:32 2001 +0000
+++ b/usr.sbin/sushi/blabel.c Tue Jan 09 09:41:41 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: blabel.c,v 1.1 2001/01/05 01:28:34 garbled Exp $ */
+/* $NetBSD: blabel.c,v 1.2 2001/01/09 09:41:41 garbled Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -48,6 +48,7 @@
extern struct winsize ws;
extern char *lang_id;
extern CDKSCREEN *cdkscreen;
+extern char **searchpaths;
WINDOW *labelwin;
@@ -94,18 +95,24 @@
{
char buf[PATH_MAX+30];
struct stat sb;
+ char *p;
+ int rc, i;
- if (lang_id == NULL)
- sprintf(buf, "%s/%s", (char *)clientdata, HELPFILE);
- else
- sprintf(buf, "%s/%s.%s", (char *)clientdata, HELPFILE, lang_id);
- if (stat(buf, &sb) == 0)
- return((void)handle_help(buf));
- else {
- sprintf(buf, "%s/%s", (char *)clientdata, HELPFILE);
- if (stat(buf, &sb) == 0)
- return((void)handle_help(buf));
+ if (strcmp((char *)clientdata, "sushi_topmenu") == 0) {
+ for (i = 0, rc = -2, p = searchpaths[i]; p != NULL && rc == -2;
+ i++) {
+ p = searchpaths[i];
+ rc = simple_lang_handler(p, HELPFILE, handle_help);
+ }
+ if (rc != -2)
+ return;
+ } else {
+ rc = simple_lang_handler((char *)clientdata, HELPFILE,
+ handle_help);
+ if (rc != -2)
+ return;
}
+ /* now do something meaningful */
}
/*ARGSUSED*/
diff -r 0633707ba32c -r 0dd0bb5a260f usr.sbin/sushi/sushi.c
--- a/usr.sbin/sushi/sushi.c Tue Jan 09 09:25:32 2001 +0000
+++ b/usr.sbin/sushi/sushi.c Tue Jan 09 09:41:41 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sushi.c,v 1.3 2001/01/09 08:06:22 garbled Exp $ */
+/* $NetBSD: sushi.c,v 1.4 2001/01/09 09:41:41 garbled Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -113,7 +113,7 @@
raw();
if (mte == NULL)
- navigate_menu(cqMenuHeadp, "sushi",
+ navigate_menu(cqMenuHeadp, "sushi_topmenu",
catgets(catalog, 4, 5, "<C></5>Sushi\n\n"));
else
navigate_submenu(mte);
Home |
Main Index |
Thread Index |
Old Index