diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-01-31 10:53:57 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-01-31 10:59:42 +0800 |
commit | 8c60755607cbade935b1f763dffbf9ee1c38f97a (patch) | |
tree | 15d24fd667aba428bc4a2bf7187da5d5c3a853a4 /ui/ncurses/nc-config.c | |
parent | 4051815230f443ac4b052a4cf0f55a951e3f88c8 (diff) | |
download | talos-petitboot-8c60755607cbade935b1f763dffbf9ee1c38f97a.tar.gz talos-petitboot-8c60755607cbade935b1f763dffbf9ee1c38f97a.zip |
ui/ncurses: Unify key bindings & key help text
This change is a small cleanup of the key bindings; we ensure that the
general key bindings are available (and documented) on all screens.
In order to keep things consistent, this change adds an initial UI
guidelines text file, which documents the general key bindings.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-config.c')
-rw-r--r-- | ui/ncurses/nc-config.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c index 8d68e74..64d0619 100644 --- a/ui/ncurses/nc-config.c +++ b/ui/ncurses/nc-config.c @@ -118,10 +118,23 @@ static void config_screen_process_key(struct nc_scr *scr, int key) bool handled; handled = widgetset_process_key(screen->widgetset, key); + + if (!handled) { + switch (key) { + case 'x': + case 27: /* esc */ + screen->exit = true; + break; + case 'h': + screen->show_help = true; + break; + } + } + if (screen->exit) { screen->on_exit(screen->cui); - } else if (screen->show_help || (!handled && key == 'h')) { + } else if (screen->show_help) { screen->show_help = false; cui_show_help(screen->cui, "System Configuration", config_help_text); @@ -689,7 +702,7 @@ struct config_screen *config_screen_init(struct cui *cui, "Petitboot System Configuration"); screen->scr.frame.rtitle = NULL; screen->scr.frame.help = talloc_strdup(screen, - "tab=next, shift+tab=previous"); + "tab=next, shift+tab=previous, x=exit, h=help"); nc_scr_frame_draw(&screen->scr); scrollok(screen->scr.sub_ncw, true); |