diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-10-17 13:52:42 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-11-13 17:47:20 +0800 |
commit | 651940467773d2e679f9210e02f4654fb05cd449 (patch) | |
tree | 5268fc4a6ec34a3aaffb89bec2ba0bbca454fb5c /ui/ncurses/generic-main.c | |
parent | 8f36cfac8a6cbb9a2750824b704b3cc4b9db5c49 (diff) | |
download | petitboot-651940467773d2e679f9210e02f4654fb05cd449.zip petitboot-651940467773d2e679f9210e02f4654fb05cd449.tar.gz |
ui/ncurses: Add sysinfo screen
Add a simple screen for displaying the struct system_info. We add this
to the main menu as a selectable option, and separate it from the boot
option list with an unselectable blank entry.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/generic-main.c')
-rw-r--r-- | ui/ncurses/generic-main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index 49a96cb..9d8ebb9 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -126,6 +126,12 @@ struct pb_cui { struct cui *cui; }; +static int pmenu_sysinfo(struct pmenu_item *item) +{ + cui_show_sysinfo(cui_from_item(item)); + return 0; +} + /** * pb_mm_init - Setup the main menu instance. */ @@ -136,7 +142,7 @@ static struct pmenu *pb_mm_init(struct pb_cui *pb_cui) struct pmenu *m; struct pmenu_item *i; - m = pmenu_init(pb_cui->cui, 1, cui_on_exit); + m = pmenu_init(pb_cui->cui, 3, cui_on_exit); if (!m) { pb_log("%s: failed\n", __func__); @@ -152,7 +158,11 @@ static struct pmenu *pb_mm_init(struct pb_cui *pb_cui) "Enter=accept, e=edit, n=new, x=exit"); m->scr.frame.status = talloc_strdup(m, "Welcome to Petitboot"); - i = pmenu_item_init(m, 0, "Exit to Shell"); + i = pmenu_item_init(m, 0, " "); + item_opts_off(i->nci, O_SELECTABLE); + i = pmenu_item_init(m, 1, "System information"); + i->on_execute = pmenu_sysinfo; + i = pmenu_item_init(m, 2, "Exit to shell"); i->on_execute = pmenu_exit_cb; result = pmenu_setup(m); |