const struct system_info *sysinfo = screen->cui->sysinfo;
enum net_conf_type net_conf_type;
struct interface_config *iface;
+ char *str, *end, *uuid;
struct config *config;
- char *str, *end;
int rc, idx;
config = config_copy(screen, screen->cui->config);
config->autoboot_enabled = screen->autoboot_type != AUTOBOOT_DISABLED;
+ uuid = NULL;
if (screen->autoboot_type == AUTOBOOT_ONE) {
- char mac[20], *uuid = NULL;
+ char mac[20];
/* if idx is -1 here, we have an unknown UUID selected.
* Otherwise, it's a blockdev index (idx <= n_blockdevs) or an
} else if (idx != -1) {
uuid = sysinfo->blockdevs[idx]->uuid;
}
-
- if (uuid) {
- talloc_free(config->boot_device);
- config->boot_device = talloc_strdup(config, uuid);
- }
}
+ talloc_free(config->boot_device);
+ config->boot_device = uuid ? talloc_strdup(config, uuid) : NULL;
+
str = widget_textbox_get_value(screen->widgets.timeout_f);
if (str) {
unsigned long x;
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);
+ y, screen->field_x + 23);
}
static void config_screen_network_change(void *arg, int value)
widget_new_label(screen->widgetset, 2, screen->field_x,
_("Waiting for configuration data..."));
screen->widgets.cancel_b = widget_new_button(screen->widgetset,
- 4, screen->field_x, 6, _("Cancel"),
+ 4, screen->field_x, 9, _("Cancel"),
cancel_click, screen);
}
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"),
+ screen->widgets.help_b = widget_new_button(set, 0, 0, 9, _("Help"),
help_click, screen);
- screen->widgets.cancel_b = widget_new_button(set, 0, 0, 6, _("Cancel"),
+ screen->widgets.cancel_b = widget_new_button(set, 0, 0, 9, _("Cancel"),
cancel_click, screen);
}
/* The size of the pad we'll need depends on the number of interfaces.
*
* We use N_FIELDS (which is quite conservative, as some fields share
- * a line) as a base, then add 3 (as the network select field is
- * takes 3 lines), and n_interfaces (as the network interface field
- * has n_interfaces lines).
+ * a line) as a base, then:
+ * - add 6 (as the network select & boot device select fields take 3
+ * lines each),
+ * - add n_interfaces for every field in the network select field, and
+ * - add (n_blockdevs + n_interfaces) for every field in the boot device
+ * select field
*/
- height = N_FIELDS + 3;
- if (sysinfo)
+ height = N_FIELDS + 6;
+ if (sysinfo) {
height += sysinfo->n_interfaces;
+ height += (sysinfo->n_blockdevs + sysinfo->n_interfaces);
+ }
if (!screen->pad || getmaxy(screen->pad) < height) {
if (screen->pad)
delwin(screen->pad);