--- /dev/null
+const char *config_help_text = "\
+Autoboot: If you select this option, Petitboot will automatically choose the \
+default option shown in the main menu. Use this option if you want to quickly \
+boot your system without changing any boot option settings.\n"
+"\n"
+"Timeout: Specify the length of time, in seconds, that the main menu will be \
+displayed before the first option on the main menu is started by default. \
+Timeout is applied only if the Autoboot option is selected.\n"
+"\n"
+"Network options:\n"
+"\n"
+"DHCP on all active interfaces: Automatically assigns IP addresses to each \
+network interface. Use this option if you have a DHCP server on your \
+network.\n"
+"\n"
+"DHCP on a specific interface: Automatically assigns IP addresses to the \
+selected network interface. The other interfaces are not configured. Select \
+this option if you have multiple DHCP servers on different interfaces, but \
+only want to configure a single interface during boot.\n"
+"\n"
+"Static IP configuration: Allows you to specify an IPv4 address and network \
+mask, gateway, and a DNS server or servers for a network interface. Select \
+this option if you do not have a DHCP server, or want explicit control of \
+network settings."
+;
#include "nc-config.h"
#include "nc-widgets.h"
-#define N_FIELDS 23
+#define N_FIELDS 24
+
+extern const char *config_help_text;
enum net_conf_type {
NET_CONF_TYPE_DHCP_ALL,
WINDOW *pad;
bool exit;
+ bool show_help;
void (*on_exit)(struct cui *);
int scroll_y;
struct nc_widget_label *dns_help_l;
struct nc_widget_button *ok_b;
+ struct nc_widget_button *help_b;
struct nc_widget_button *cancel_b;
} widgets;
};
bool handled;
handled = widgetset_process_key(screen->widgetset, key);
- if (screen->exit)
+ if (screen->exit) {
screen->on_exit(screen->cui);
- else if (handled)
+
+ } else if (screen->show_help || (!handled && key == 'h')) {
+ screen->show_help = false;
+ cui_show_help(screen->cui, "System Configuration",
+ config_help_text);
+
+ } else if (handled) {
pad_refresh(screen);
+ }
}
static void config_screen_resize(struct nc_scr *scr)
screen->exit = true;
}
+static void help_click(void *arg)
+{
+ struct config_screen *screen = arg;
+ screen->show_help = true;
+}
+
static void cancel_click(void *arg)
{
struct config_screen *screen = arg;
widget_move(widget_button_base(screen->widgets.ok_b),
y, screen->field_x);
- widget_move(widget_button_base(screen->widgets.cancel_b),
+ widget_move(widget_button_base(screen->widgets.help_b),
y, screen->field_x + 10);
+ widget_move(widget_button_base(screen->widgets.cancel_b),
+ y, screen->field_x + 20);
}
static void config_screen_network_change(void *arg, int value)
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",
+ help_click, screen);
screen->widgets.cancel_b = widget_new_button(set, 0, 0, 6, "Cancel",
cancel_click, screen);
}