summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4dd0ff1)
It's not obvious why it's there when we're configuring DHCP.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
#include "nc-config.h"
#include "nc-widgets.h"
#include "nc-config.h"
#include "nc-widgets.h"
enum net_conf_type {
NET_CONF_TYPE_DHCP_ALL,
enum net_conf_type {
NET_CONF_TYPE_DHCP_ALL,
struct nc_widget_textbox *gateway_f;
struct nc_widget_label *dns_l;
struct nc_widget_textbox *dns_f;
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;
struct nc_widget_button *ok_b;
struct nc_widget_button *cancel_b;
y += layout_pair(screen, y, screen->widgets.dns_l,
widget_textbox_base(screen->widgets.dns_f));
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),
y += 1;
widget_move(widget_button_base(screen->widgets.ok_b),
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_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",
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",