summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-config.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2014-08-29 14:03:17 +1000
committerJeremy Kerr <jk@ozlabs.org>2014-09-04 13:58:04 +0800
commitb793eb6e80e002208ef0c5d149f786c44e3c86a0 (patch)
tree21b0d7c52149a8d58e99e4c18a9f6d75672e21ca /ui/ncurses/nc-config.c
parent01dac4f074301097d10abb6130eb68f99f56a1b9 (diff)
downloadtalos-petitboot-b793eb6e80e002208ef0c5d149f786c44e3c86a0.tar.gz
talos-petitboot-b793eb6e80e002208ef0c5d149f786c44e3c86a0.zip
ui/ncurses: Exit safe mode on configuration change
Selecting 'OK' in the configuration or language select screen will send a configuration change to the server and exit safe mode. Exit safe mode explicity and warn the user that they are about to exit it. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-config.c')
-rw-r--r--ui/ncurses/nc-config.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index a095353..7a709ab 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -33,7 +33,7 @@
#include "nc-config.h"
#include "nc-widgets.h"
-#define N_FIELDS 25
+#define N_FIELDS 26
extern struct help_text config_help_text;
@@ -94,6 +94,7 @@ struct config_screen {
struct nc_widget_label *dns_dhcp_help_l;
struct nc_widget_label *dns_help_l;
+ struct nc_widget_label *safe_mode;
struct nc_widget_button *ok_b;
struct nc_widget_button *help_b;
struct nc_widget_button *cancel_b;
@@ -307,6 +308,7 @@ static int screen_process_form(struct config_screen *screen)
}
}
+ config->safe_mode = false;
rc = cui_send_config(screen->cui, config);
talloc_free(config);
@@ -470,6 +472,13 @@ static void config_screen_layout_widgets(struct config_screen *screen)
y += 1;
+ show = screen->cui->config->safe_mode;
+ if (show) {
+ widget_move(widget_label_base(screen->widgets.safe_mode),
+ y, screen->field_x);
+ y += 1;
+ }
+
widget_move(widget_button_base(screen->widgets.ok_b),
y, screen->field_x);
widget_move(widget_button_base(screen->widgets.help_b),
@@ -730,6 +739,10 @@ static void config_screen_setup_widgets(struct config_screen *screen,
screen->widgets.dns_dhcp_help_l = widget_new_label(set, 0, 0,
_("(if not provided by DHCP server)"));
+ if (config->safe_mode)
+ screen->widgets.safe_mode = widget_new_label(set, 0, 0,
+ _("Selecting 'OK' will exit safe mode"));
+
screen->widgets.ok_b = widget_new_button(set, 0, 0, 6, _("OK"),
ok_click, screen);
screen->widgets.help_b = widget_new_button(set, 0, 0, 6, _("Help"),
OpenPOWER on IntegriCloud