diff options
Diffstat (limited to 'ui/ncurses/nc-lang.c')
-rw-r--r-- | ui/ncurses/nc-lang.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ui/ncurses/nc-lang.c b/ui/ncurses/nc-lang.c index 35f54e6..5e92707 100644 --- a/ui/ncurses/nc-lang.c +++ b/ui/ncurses/nc-lang.c @@ -32,7 +32,7 @@ #include "nc-lang.h" #include "nc-widgets.h" -#define N_FIELDS 4 +#define N_FIELDS 5 static struct lang { const char *name; @@ -59,6 +59,7 @@ struct lang_screen { struct nc_widget_select *lang_f; struct nc_widget_label *lang_l; + struct nc_widget_label *safe_mode; struct nc_widget_button *ok_b; struct nc_widget_button *cancel_b; } widgets; @@ -160,6 +161,7 @@ static int lang_process_form(struct lang_screen *screen) config->lang = talloc_strdup(screen, lang->name); + config->safe_mode = false; rc = cui_send_config(screen->cui, config); talloc_free(config); @@ -209,6 +211,12 @@ static void lang_screen_layout_widgets(struct lang_screen *screen) y += 1; + if (screen->cui->config->safe_mode) { + 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.cancel_b), @@ -265,6 +273,10 @@ static void lang_screen_setup_widgets(struct lang_screen *screen, label, true); } + 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.cancel_b = widget_new_button(set, 0, 0, 6, _("Cancel"), |