summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-config.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-09-09 09:03:52 +1000
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-09-10 15:49:27 +1000
commitb6f99a457cb906277b172a0332a1e16ddba99228 (patch)
tree79a80822cace83a4a7dd80f2bd45c80a128ef962 /ui/ncurses/nc-config.c
parent6c1a9dda927ec7404a55d4e11c3c9c47b4b52dce (diff)
downloadtalos-petitboot-b6f99a457cb906277b172a0332a1e16ddba99228.tar.gz
talos-petitboot-b6f99a457cb906277b172a0332a1e16ddba99228.zip
ui/ncurses: Allow text wrapping in select widgets
Several string translations used in select widgets are longer than the maximum possible width of the widget. Rather than associating several FIELDs with a select option, use a fold_text callback to pad out substrings of the original string such that the ncurses O_WRAP option properly wraps strings within the field. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'ui/ncurses/nc-config.c')
-rw-r--r--ui/ncurses/nc-config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 7c02250..2750bbb 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -811,7 +811,8 @@ static void config_screen_setup_widgets(struct config_screen *screen,
}
screen->widgets.network_l = widget_new_label(set, 0, 0, _("Network:"));
- screen->widgets.network_f = widget_new_select(set, 0, 0, 50);
+ screen->widgets.network_f = widget_new_select(set, 0, 0,
+ COLS - screen->field_x - 1);
widget_select_add_option(screen->widgets.network_f,
NET_CONF_TYPE_DHCP_ALL,
@@ -908,11 +909,12 @@ static void config_screen_setup_widgets(struct config_screen *screen,
screen->widgets.allow_write_l = widget_new_label(set, 0, 0,
_("Disk R/W:"));
screen->widgets.allow_write_f = widget_new_select(set, 0, 0,
- COLS - screen->field_x);
+ COLS - screen->field_x - 1);
widget_select_add_option(screen->widgets.allow_write_f, 0,
_("Prevent all writes to disk"),
!config->allow_writes);
+
widget_select_add_option(screen->widgets.allow_write_f, 1,
_("Allow bootloader scripts to modify disks"),
config->allow_writes);
OpenPOWER on IntegriCloud