]> err.no Git - linux-2.6/blobdiff - scripts/kconfig/mconf.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
[linux-2.6] / scripts / kconfig / mconf.c
index b1ad9a00ab19c9ee3149b379afbd2665ec9697e9..08a4c7af93ea0ffd9d19b9efcbf02572d7fb94ac 100644 (file)
@@ -401,7 +401,7 @@ static void search_conf(void)
        struct gstr res;
        int dres;
 again:
-       reset_dialog();
+       dialog_clear();
        dres = dialog_inputbox(_("Search Configuration Parameter"),
                              _("Enter CONFIG_ (sub)string to search for (omit CONFIG_)"),
                              10, 75, "");
@@ -603,12 +603,11 @@ static void conf(struct menu *menu)
                        item_make(_("    Save an Alternate Configuration File"));
                        item_set_tag('S');
                }
-               reset_dialog();
+               dialog_clear();
                res = dialog_menu(prompt ? prompt : _("Main Menu"),
                                  _(menu_instructions),
-                                 rows, cols, rows - 10,
                                  active_menu, &s_scroll);
-               if (res == 1 || res == 255)
+               if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
                        break;
                if (!item_activate_selected())
                        continue;
@@ -617,7 +616,10 @@ static void conf(struct menu *menu)
 
                submenu = item_data();
                active_menu = item_data();
-               sym = submenu->sym;
+               if (submenu)
+                       sym = submenu->sym;
+               else
+                       sym = NULL;
 
                switch (res) {
                case 0:
@@ -682,8 +684,8 @@ static void conf(struct menu *menu)
 
 static void show_textbox(const char *title, const char *text, int r, int c)
 {
-       reset_dialog();
-       dialog_textbox(title, text, r ? r : rows, c ? c : cols);
+       dialog_clear();
+       dialog_textbox(title, text, r, c);
 }
 
 static void show_helptext(const char *title, const char *text)
@@ -734,7 +736,7 @@ static void conf_choice(struct menu *menu)
                        if (child->sym == sym_get_choice_value(menu->sym))
                                item_set_tag('X');
                }
-               reset_dialog();
+               dialog_clear();
                res = dialog_checklist(prompt ? prompt : _("Main Menu"),
                                        _(radiolist_instructions),
                                         15, 70, 6);
@@ -754,7 +756,9 @@ static void conf_choice(struct menu *menu)
                        } else
                                show_help(menu);
                        break;
-               case 255:
+               case KEY_ESC:
+                       return;
+               case -ERRDISPLAYTOOSMALL:
                        return;
                }
        }
@@ -781,7 +785,7 @@ static void conf_string(struct menu *menu)
                default:
                        heading = "Internal mconf error!";
                }
-               reset_dialog();
+               dialog_clear();
                res = dialog_inputbox(prompt ? prompt : _("Main Menu"),
                                      heading, 10, 75,
                                      sym_get_string_value(menu->sym));
@@ -794,7 +798,7 @@ static void conf_string(struct menu *menu)
                case 1:
                        show_help(menu);
                        break;
-               case 255:
+               case KEY_ESC:
                        return;
                }
        }
@@ -805,7 +809,7 @@ static void conf_load(void)
 
        while (1) {
                int res;
-               reset_dialog();
+               dialog_clear();
                res = dialog_inputbox(NULL, load_config_text,
                                      11, 55, filename);
                switch(res) {
@@ -819,7 +823,7 @@ static void conf_load(void)
                case 1:
                        show_helptext(_("Load Alternate Configuration"), load_config_help);
                        break;
-               case 255:
+               case KEY_ESC:
                        return;
                }
        }
@@ -829,7 +833,7 @@ static void conf_save(void)
 {
        while (1) {
                int res;
-               reset_dialog();
+               dialog_clear();
                res = dialog_inputbox(NULL, save_config_text,
                                      11, 55, filename);
                switch(res) {
@@ -843,7 +847,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 +887,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);
+               dialog_clear();
+               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)) {