summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/generic-main.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-04-02 15:16:26 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-04-02 15:24:15 +0800
commitbebb24a9f49cb4eb81df2aa3dd9de94db965536d (patch)
treea3b5ba8e8841a7767bd0d41586899713581e49ea /ui/ncurses/generic-main.c
parent16ab363fe5bc4393b5dd7b9c12bbd6e5b55a22fe (diff)
downloadtalos-petitboot-bebb24a9f49cb4eb81df2aa3dd9de94db965536d.tar.gz
talos-petitboot-bebb24a9f49cb4eb81df2aa3dd9de94db965536d.zip
ui/ncurses: Add menu option to restart discovery
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/generic-main.c')
-rw-r--r--ui/ncurses/generic-main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c
index 7616788..2cfb9c3 100644
--- a/ui/ncurses/generic-main.c
+++ b/ui/ncurses/generic-main.c
@@ -140,6 +140,12 @@ static int pmenu_config(struct pmenu_item *item)
return 0;
}
+static int pmenu_reinit(struct pmenu_item *item)
+{
+ cui_send_reinit(cui_from_item(item));
+ return 0;
+}
+
/**
* pb_mm_init - Setup the main menu instance.
*/
@@ -150,7 +156,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, 4, cui_on_exit);
+ m = pmenu_init(pb_cui->cui, 5, cui_on_exit);
if (!m) {
pb_log("%s: failed\n", __func__);
@@ -172,7 +178,9 @@ static struct pmenu *pb_mm_init(struct pb_cui *pb_cui)
i->on_execute = pmenu_sysinfo;
i = pmenu_item_init(m, 2, "System configuration");
i->on_execute = pmenu_config;
- i = pmenu_item_init(m, 3, "Exit to shell");
+ i = pmenu_item_init(m, 3, "Rescan devices");
+ i->on_execute = pmenu_reinit;
+ i = pmenu_item_init(m, 4, "Exit to shell");
i->on_execute = pmenu_exit_cb;
result = pmenu_setup(m);
OpenPOWER on IntegriCloud