diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-04-04 15:14:07 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-04-05 10:50:23 +1000 |
commit | 8364bca5ca92c24061fe222a61e357af8315d151 (patch) | |
tree | 43707debd47d24e8584ce82ff870c74d065a5a92 | |
parent | 776ef3ee90ecb04b3eff1398bbefd91825864789 (diff) | |
download | petitboot-8364bca5ca92c24061fe222a61e357af8315d151.zip petitboot-8364bca5ca92c24061fe222a61e357af8315d151.tar.gz |
ui/ncurses: Disable autoboot if boot list is empty
If an empty boot order is saved disable autoboot. However don't set
autoboot_enabled to false by clearing the list, as this will hide the
list when it is likely the user wants to make changes.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r-- | ui/ncurses/nc-config.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c index c0df762..66ca7a4 100644 --- a/ui/ncurses/nc-config.c +++ b/ui/ncurses/nc-config.c @@ -209,7 +209,7 @@ static int screen_process_form(struct config_screen *screen) screen->widgets.boot_order_f); autoboot = widget_select_get_value(screen->widgets.autoboot_f); - config->autoboot_enabled = autoboot || (autoboot && n_boot_opts); + config->autoboot_enabled = autoboot && n_boot_opts; config->n_autoboot_opts = n_boot_opts; config->autoboot_opts = talloc_array(config, struct autoboot_option, @@ -629,7 +629,6 @@ static void config_screen_autoboot_none(void *arg) struct nc_widget_subset *subset = screen->widgets.boot_order_f; widget_subset_clear_active(subset); - screen->autoboot_enabled = false; widgetset_unpost(screen->widgetset); config_screen_layout_widgets(screen); |