From f3cbcdc955d0d2c8b4c52d6b73fc536b01b68c64 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 28 Jul 2006 23:57:48 +0200 Subject: kconfig/lxdialog: let behave as expected is used to step one back in the dialogs. When lxdialog became built-in pressing once would cause one step back and pressing would cause two steps back. This patch - based on concept from Roman Zippel - makes one a noop and pressing 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 --- scripts/kconfig/lxdialog/checklist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/kconfig/lxdialog/checklist.c') diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c index 282511020bcb..39becb72444a 100644 --- a/scripts/kconfig/lxdialog/checklist.c +++ b/scripts/kconfig/lxdialog/checklist.c @@ -192,7 +192,7 @@ int dialog_checklist(const char *title, const char *prompt, int height, wnoutrefresh(list); doupdate(); - while (key != ESC) { + while (key != KEY_ESC) { key = wgetch(dialog); for (i = 0; i < max_choice; i++) { @@ -298,8 +298,10 @@ int dialog_checklist(const char *title, const char *prompt, int height, break; case 'X': case 'x': - key = ESC; - case ESC: + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); break; } @@ -308,5 +310,5 @@ int dialog_checklist(const char *title, const char *prompt, int height, } delwin(list); delwin(dialog); - return 255; /* ESC pressed */ + return key; /* ESC pressed */ } -- cgit