diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-10-24 16:57:38 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-11-14 13:23:52 +1100 |
commit | 9df37efcae13a272b25cc5b4e0ba441948fea886 (patch) | |
tree | 97b4587fbce627a7281ba790c3844915a7bb8158 | |
parent | 4dd0ff12814b03f06ee0cd813d8f54aa42fc94fb (diff) | |
download | talos-petitboot-9df37efcae13a272b25cc5b4e0ba441948fea886.tar.gz talos-petitboot-9df37efcae13a272b25cc5b4e0ba441948fea886.zip |
ui/ncurses: Add help for the DNS option
It's not obvious why it's there when we're configuring DHCP.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | ui/ncurses/nc-config.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c index 47e6b72..00fe72c 100644 --- a/ui/ncurses/nc-config.c +++ b/ui/ncurses/nc-config.c @@ -31,7 +31,7 @@ #include "nc-config.h" #include "nc-widgets.h" -#define N_FIELDS 18 +#define N_FIELDS 19 enum net_conf_type { NET_CONF_TYPE_DHCP_ALL, @@ -71,6 +71,7 @@ struct config_screen { struct nc_widget_textbox *gateway_f; struct nc_widget_label *dns_l; struct nc_widget_textbox *dns_f; + struct nc_widget_label *dns_help_l; struct nc_widget_button *ok_b; struct nc_widget_button *cancel_b; @@ -319,6 +320,15 @@ static void config_screen_layout_widgets(struct config_screen *screen, y += layout_pair(screen, y, screen->widgets.dns_l, widget_textbox_base(screen->widgets.dns_f)); + /* we show the DNS/DHCP help if we're configuring DHCP */ + show = net_conf != NET_CONF_TYPE_STATIC; + wl = widget_label_base(screen->widgets.dns_help_l); + widget_set_visible(wl, show); + if (show) { + widget_move(wl, y, screen->field_x); + y += 1; + } + y += 1; widget_move(widget_button_base(screen->widgets.ok_b), @@ -458,6 +468,9 @@ static void config_screen_setup_widgets(struct config_screen *screen, screen->widgets.dns_l = widget_new_label(set, 0, 0, "DNS Server(s):"); screen->widgets.dns_f = widget_new_textbox(set, 0, 0, 32, str); + screen->widgets.dns_help_l = widget_new_label(set, 0, 0, + "(if not provided by DHCP server)"); + 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", |