aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu/readconfig.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-05-27 18:22:21 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-05-27 18:22:21 -0700
commit4d66117c87409691ddf1501c17d1642040414a7c (patch)
treec8f235271c0912f8d9efd3f553274c0ed29ca39a /com32/menu/readconfig.c
parentaa278d582d201222e395e33a8a568243d5aa9e3f (diff)
downloadsyslinux-4.00-pre47.tar.gz
syslinux-4.00-pre47.tar.xz
syslinux-4.00-pre47.zip
MENU IMMEDIATE: hotkeys which do not require Entersyslinux-4.00-pre47
The normal behavior for a hotkey is to jump to a specific menu entry. With MENU IMMEDIATE, it activates the menu entry as well. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32/menu/readconfig.c')
-rw-r--r--com32/menu/readconfig.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index c8215a0b..5685e6f9 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -172,6 +172,7 @@ static struct menu *new_menu(struct menu *parent,
m->allowedit = parent->allowedit;
m->timeout = parent->timeout;
m->save = parent->save;
+ m->immediate = parent->immediate;
m->ontimeout = refstr_get(parent->ontimeout);
m->onerror = refstr_get(parent->onerror);
@@ -219,6 +220,7 @@ struct labeldata {
unsigned int menuindent;
enum menu_action action;
int save;
+ int immediate;
struct menu *submenu;
};
@@ -304,6 +306,7 @@ static void record(struct menu *m, struct labeldata *ld, const char *append)
me->hotkey = 0;
me->action = ld->action ? ld->action : MA_CMD;
me->save = ld->save ? (ld->save > 0) : m->save;
+ me->immediate = ld->immediate ? (ld->immediate > 0) : m->immediate;
if (ld->menuindent) {
const char *dn;
@@ -674,6 +677,16 @@ static void parse_config_file(FILE * f)
ld.save = -1;
else
m->save = false;
+ } else if (looking_at(p, "immediate")) {
+ if (ld.label)
+ ld.immediate = 1;
+ else
+ m->immediate = true;
+ } else if (looking_at(p, "noimmediate")) {
+ if (ld.label)
+ ld.immediate = -1;
+ else
+ m->immediate = false;
} else if (looking_at(p, "onerror")) {
refstr_put(m->onerror);
m->onerror = refstrdup(skipspace(p + 7));