summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-cui.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-10-21 18:59:12 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-11-14 13:23:25 +1100
commit2a6f3ebc8263e94441c2c865a6b28dae40e35990 (patch)
tree50057259a8288421392ec69d978aacdbfbbda74f /ui/ncurses/nc-cui.c
parent7cd5a6642af076693874cce340607d712e35d423 (diff)
downloadtalos-petitboot-2a6f3ebc8263e94441c2c865a6b28dae40e35990.tar.gz
talos-petitboot-2a6f3ebc8263e94441c2c865a6b28dae40e35990.zip
ui/ncurses: Add basic config editor
This change adds a simple configuration editor to the ncurses UI. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-cui.c')
-rw-r--r--ui/ncurses/nc-cui.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index 6aa2a28..d74c1a4 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -34,6 +34,7 @@
#include "process/process.h"
#include "ui/common/discover-client.h"
#include "nc-cui.h"
+#include "nc-config.h"
#include "nc-sysinfo.h"
static struct cui_opt_data *cod_from_item(struct pmenu_item *item)
@@ -251,6 +252,20 @@ void cui_show_sysinfo(struct cui *cui)
cui_set_current(cui, sysinfo_screen_scr(cui->sysinfo_screen));
}
+static void cui_config_exit(struct cui *cui)
+{
+ cui_set_current(cui, &cui->main->scr);
+ talloc_free(cui->config_screen);
+ cui->config_screen = NULL;
+}
+
+void cui_show_config(struct cui *cui)
+{
+ cui->config_screen = config_screen_init(cui, cui->config,
+ cui->sysinfo, cui_config_exit);
+ cui_set_current(cui, config_screen_scr(cui->config_screen));
+}
+
/**
* cui_set_current - Set the currently active screen and redraw it.
*/
OpenPOWER on IntegriCloud