summaryrefslogtreecommitdiff
path: root/scripts/kconfig/mconf.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-28 23:57:48 +0200
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 11:19:20 +0200
commitf3cbcdc955d0d2c8b4c52d6b73fc536b01b68c64 (patch)
tree3619243852b54799123f0fead031b8b45abf7aca /scripts/kconfig/mconf.c
parent2982de6993e6d9944f2215d7cb9b558b465a0c99 (diff)
kconfig/lxdialog: let <ESC><ESC> behave as expected
<ESC><ESC> is used to step one back in the dialogs. When lxdialog became built-in pressing <ESC> once would cause one step back and pressing <ESC><ESC> would cause two steps back. This patch - based on concept from Roman Zippel <zippel@linux-m68k.org> - makes one <ESC> a noop and pressing <ESC><ESC> will cause one step backward. In addition the final yes/no dialog now has the option to go back to the the kernel configuration. So if you get too far out you can now go back to configuring the kernel without saving and starting all over again. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/mconf.c')
-rw-r--r--scripts/kconfig/mconf.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index b1ad9a00ab19..ef75d6c3d3e5 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -608,7 +608,7 @@ static void conf(struct menu *menu)
_(menu_instructions),
rows, cols, rows - 10,
active_menu, &s_scroll);
- if (res == 1 || res == 255)
+ if (res == 1 || res == KEY_ESC)
break;
if (!item_activate_selected())
continue;
@@ -754,7 +754,7 @@ static void conf_choice(struct menu *menu)
} else
show_help(menu);
break;
- case 255:
+ case KEY_ESC:
return;
}
}
@@ -794,7 +794,7 @@ static void conf_string(struct menu *menu)
case 1:
show_help(menu);
break;
- case 255:
+ case KEY_ESC:
return;
}
}
@@ -819,7 +819,7 @@ static void conf_load(void)
case 1:
show_helptext(_("Load Alternate Configuration"), load_config_help);
break;
- case 255:
+ case KEY_ESC:
return;
}
}
@@ -843,7 +843,7 @@ static void conf_save(void)
case 1:
show_helptext(_("Save Alternate Configuration"), save_config_help);
break;
- case 255:
+ case KEY_ESC:
return;
}
}
@@ -883,12 +883,15 @@ int main(int ac, char **av)
init_wsize();
reset_dialog();
init_dialog(menu_backtitle);
- conf(&rootmenu);
- reset_dialog();
- res = dialog_yesno(NULL,
- _("Do you wish to save your "
- "new kernel configuration?"),
- 5, 60);
+ do {
+ conf(&rootmenu);
+ reset_dialog();
+ res = dialog_yesno(NULL,
+ _("Do you wish to save your "
+ "new kernel configuration?\n"
+ "<ESC><ESC> to continue."),
+ 6, 60);
+ } while (res == KEY_ESC);
end_dialog();
if (res == 0) {
if (conf_write(NULL)) {