]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-config.c
ui/ncurses: Expand width of pad
[petitboot] / ui / ncurses / nc-config.c
index 4b1a58f98ade8635b16b941ee2ab341407b2987d..17cc380172cb15394fb0b3bb73b84cfd270d8d4d 100644 (file)
@@ -188,8 +188,8 @@ static int screen_process_form(struct config_screen *screen)
        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);
@@ -199,8 +199,9 @@ static int screen_process_form(struct config_screen *screen)
 
        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
@@ -216,13 +217,11 @@ static int screen_process_form(struct config_screen *screen)
                } 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;
@@ -484,7 +483,7 @@ static void config_screen_layout_widgets(struct config_screen *screen)
        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 + 24);
 }
 
 static void config_screen_network_change(void *arg, int value)
@@ -542,7 +541,7 @@ static void config_screen_setup_empty(struct config_screen *screen)
        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);
 }
 
@@ -745,9 +744,9 @@ static void config_screen_setup_widgets(struct config_screen *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, 10, _("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, 10, _("Cancel"),
                        cancel_click, screen);
 }
 
@@ -796,7 +795,7 @@ static void config_screen_draw(struct config_screen *screen,
        if (!screen->pad || getmaxy(screen->pad) < height) {
                if (screen->pad)
                        delwin(screen->pad);
-               screen->pad = newpad(height, COLS);
+               screen->pad = newpad(height, COLS + 10);
        }
 
        if (screen->widgetset) {