aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/mconf.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-28 17:57:48 -0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 05:19:20 -0400
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)
608 _(menu_instructions), 608 _(menu_instructions),
609 rows, cols, rows - 10, 609 rows, cols, rows - 10,
610 active_menu, &s_scroll); 610 active_menu, &s_scroll);
611 if (res == 1 || res == 255) 611 if (res == 1 || res == KEY_ESC)
612 break; 612 break;
613 if (!item_activate_selected()) 613 if (!item_activate_selected())
614 continue; 614 continue;
@@ -754,7 +754,7 @@ static void conf_choice(struct menu *menu)
754 } else 754 } else
755 show_help(menu); 755 show_help(menu);
756 break; 756 break;
757 case 255: 757 case KEY_ESC:
758 return; 758 return;
759 } 759 }
760 } 760 }
@@ -794,7 +794,7 @@ static void conf_string(struct menu *menu)
794 case 1: 794 case 1:
795 show_help(menu); 795 show_help(menu);
796 break; 796 break;
797 case 255: 797 case KEY_ESC:
798 return; 798 return;
799 } 799 }
800 } 800 }
@@ -819,7 +819,7 @@ static void conf_load(void)
819 case 1: 819 case 1:
820 show_helptext(_("Load Alternate Configuration"), load_config_help); 820 show_helptext(_("Load Alternate Configuration"), load_config_help);
821 break; 821 break;
822 case 255: 822 case KEY_ESC:
823 return; 823 return;
824 } 824 }
825 } 825 }
@@ -843,7 +843,7 @@ static void conf_save(void)
843 case 1: 843 case 1:
844 show_helptext(_("Save Alternate Configuration"), save_config_help); 844 show_helptext(_("Save Alternate Configuration"), save_config_help);
845 break; 845 break;
846 case 255: 846 case KEY_ESC:
847 return; 847 return;
848 } 848 }
849 } 849 }
@@ -883,12 +883,15 @@ int main(int ac, char **av)
883 init_wsize(); 883 init_wsize();
884 reset_dialog(); 884 reset_dialog();
885 init_dialog(menu_backtitle); 885 init_dialog(menu_backtitle);
886 conf(&rootmenu); 886 do {
887 reset_dialog(); 887 conf(&rootmenu);
888 res = dialog_yesno(NULL, 888 reset_dialog();
889 _("Do you wish to save your " 889 res = dialog_yesno(NULL,
890 "new kernel configuration?"), 890 _("Do you wish to save your "
891 5, 60); 891 "new kernel configuration?\n"
892 "<ESC><ESC> to continue."),
893 6, 60);
894 } while (res == KEY_ESC);
892 end_dialog(); 895 end_dialog();
893 if (res == 0) { 896 if (res == 0) {
894 if (conf_write(NULL)) { 897 if (conf_write(NULL)) {