]> Pileus Git - ~andy/linux/blobdiff - scripts/kconfig/lxdialog/yesno.c
kconfig: Make localmodconfig handle environment variables
[~andy/linux] / scripts / kconfig / lxdialog / yesno.c
index 8364f9dd01c3340f8676cc9d7c70ad35a599e0f2..4e6e8090c20b573868e3cfe15015a6b6f54b2f69 100644 (file)
@@ -29,8 +29,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
        int x = width / 2 - 10;
        int y = height - 2;
 
-       print_button(dialog, " Yes ", y, x, selected == 0);
-       print_button(dialog, "  No  ", y, x + 13, selected == 1);
+       print_button(dialog, gettext(" Yes "), y, x, selected == 0);
+       print_button(dialog, gettext("  No  "), y, x + 13, selected == 1);
 
        wmove(dialog, y, x + 1 + 13 * selected);
        wrefresh(dialog);
@@ -44,6 +44,12 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width)
        int i, x, y, key = 0, button = 0;
        WINDOW *dialog;
 
+do_resize:
+       if (getmaxy(stdscr) < (height + 4))
+               return -ERRDISPLAYTOOSMALL;
+       if (getmaxx(stdscr) < (width + 4))
+               return -ERRDISPLAYTOOSMALL;
+
        /* center dialog box on screen */
        x = (COLS - width) / 2;
        y = (LINES - height) / 2;
@@ -96,6 +102,10 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width)
                case KEY_ESC:
                        key = on_key_esc(dialog);
                        break;
+               case KEY_RESIZE:
+                       delwin(dialog);
+                       on_key_resize();
+                       goto do_resize;
                }
        }