aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-26 20:28:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-26 20:28:45 -0700
commitd8d22408627466d2ae5e594062d7f650d4a48476 (patch)
treef9f2c9901b5d5c7d0543db7d4a5c88c3babd35da /com32/menu
parent17a32fe2e902d7d65b2f6aa3f501456662d53fc4 (diff)
downloadsyslinux-d8d22408627466d2ae5e594062d7f650d4a48476.tar.gz
syslinux-d8d22408627466d2ae5e594062d7f650d4a48476.tar.xz
syslinux-d8d22408627466d2ae5e594062d7f650d4a48476.zip
menu: add MENU HELP
Add a feature to display fullscreen help via menu selection entry (inspired by the Debian install disc menus.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/menu')
-rw-r--r--com32/menu/menu.h2
-rw-r--r--com32/menu/menumain.c7
-rw-r--r--com32/menu/readconfig.c23
3 files changed, 32 insertions, 0 deletions
diff --git a/com32/menu/menu.h b/com32/menu/menu.h
index 63e1859a..36c5669c 100644
--- a/com32/menu/menu.h
+++ b/com32/menu/menu.h
@@ -49,6 +49,7 @@ enum menu_action {
MA_QUIT, /* Quit to CLI */
MA_EXIT, /* Exit to higher-level menu */
MA_EXIT_UNRES, /* Unresolved exit */
+ MA_HELP, /* Show help text */
};
struct menu_entry {
@@ -58,6 +59,7 @@ struct menu_entry {
const char *passwd;
char *helptext;
const char *cmdline;
+ const char *background;
struct menu *submenu;
struct menu_entry *next; /* Linked list of all labels across menus */
int entry; /* Entry number inside menu */
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 5d85018e..06725f37 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -921,6 +921,13 @@ static const char *run_menu(void)
clear = 1;
draw_row(entry - top + 4 + VSHIFT, -1, top, 0, 0);
break;
+ case MA_HELP:
+ key = show_message_file(me->cmdline, me->background);
+ /* If the exit was an F-key, display that help screen */
+ show_fkey(key);
+ done = 0;
+ clear = 1;
+ break;
default:
done = 0;
break;
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 5685e6f9..ca9c35e6 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -372,6 +372,11 @@ static void record(struct menu *m, struct labeldata *ld, const char *append)
me->submenu = ld->submenu;
break;
+ case MA_HELP:
+ me->cmdline = refstr_get(ld->kernel);
+ me->background = refstr_get(ld->append);
+ break;
+
default:
break;
}
@@ -834,6 +839,24 @@ static void parse_config_file(FILE * f)
}
} else if (looking_at(p, "start")) {
start_menu = m;
+ } else if (looking_at(p, "help")) {
+ if (ld.label) {
+ ld.action = MA_HELP;
+ p = skipspace(p + 4);
+
+ refstr_put(ld.kernel);
+ ld.kernel = refdup_word(&p);
+
+ if (ld.append) {
+ refstr_put(ld.append);
+ ld.append = NULL;
+ }
+
+ if (*p) {
+ p = skipspace(p);
+ ld.append = refdup_word(&p); /* Background */
+ }
+ }
} else if ((ep = looking_at(p, "resolution"))) {
int x, y;
x = strtoul(ep, &ep, 0);