diff options
Diffstat (limited to 'scripts/kconfig/nconf.c')
-rw-r--r-- | scripts/kconfig/nconf.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index dbf31edd22b2..7975d8d258c3 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
@@ -45,8 +45,8 @@ static const char nconf_global_help[] = N_( | |||
45 | "<n> to remove it. You may press the <Space> key to cycle through the\n" | 45 | "<n> to remove it. You may press the <Space> key to cycle through the\n" |
46 | "available options.\n" | 46 | "available options.\n" |
47 | "\n" | 47 | "\n" |
48 | "A trailing \"--->\" designates a submenu.\n" | 48 | "A trailing \"--->\" designates a submenu, a trailing \"----\" an\n" |
49 | "\n" | 49 | "empty submenu.\n" |
50 | "\n" | 50 | "\n" |
51 | "Menu navigation keys\n" | 51 | "Menu navigation keys\n" |
52 | "----------------------------------------------------------------------\n" | 52 | "----------------------------------------------------------------------\n" |
@@ -131,7 +131,7 @@ static const char nconf_global_help[] = N_( | |||
131 | "\n"), | 131 | "\n"), |
132 | menu_no_f_instructions[] = N_( | 132 | menu_no_f_instructions[] = N_( |
133 | "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" | 133 | "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" |
134 | "Submenus are designated by a trailing \"--->\".\n" | 134 | "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n" |
135 | "\n" | 135 | "\n" |
136 | "Use the following keys to navigate the menus:\n" | 136 | "Use the following keys to navigate the menus:\n" |
137 | "Move up or down with <Up> and <Down>.\n" | 137 | "Move up or down with <Up> and <Down>.\n" |
@@ -148,7 +148,7 @@ menu_no_f_instructions[] = N_( | |||
148 | "For help related to the current menu entry press <?> or <h>.\n"), | 148 | "For help related to the current menu entry press <?> or <h>.\n"), |
149 | menu_instructions[] = N_( | 149 | menu_instructions[] = N_( |
150 | "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" | 150 | "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" |
151 | "Submenus are designated by a trailing \"--->\".\n" | 151 | "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n" |
152 | "\n" | 152 | "\n" |
153 | "Use the following keys to navigate the menus:\n" | 153 | "Use the following keys to navigate the menus:\n" |
154 | "Move up or down with <Up> or <Down>.\n" | 154 | "Move up or down with <Up> or <Down>.\n" |
@@ -365,15 +365,16 @@ static void print_function_line(void) | |||
365 | int i; | 365 | int i; |
366 | int offset = 1; | 366 | int offset = 1; |
367 | const int skip = 1; | 367 | const int skip = 1; |
368 | int lines = getmaxy(stdscr); | ||
368 | 369 | ||
369 | for (i = 0; i < function_keys_num; i++) { | 370 | for (i = 0; i < function_keys_num; i++) { |
370 | (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); | 371 | (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); |
371 | mvwprintw(main_window, LINES-3, offset, | 372 | mvwprintw(main_window, lines-3, offset, |
372 | "%s", | 373 | "%s", |
373 | function_keys[i].key_str); | 374 | function_keys[i].key_str); |
374 | (void) wattrset(main_window, attributes[FUNCTION_TEXT]); | 375 | (void) wattrset(main_window, attributes[FUNCTION_TEXT]); |
375 | offset += strlen(function_keys[i].key_str); | 376 | offset += strlen(function_keys[i].key_str); |
376 | mvwprintw(main_window, LINES-3, | 377 | mvwprintw(main_window, lines-3, |
377 | offset, "%s", | 378 | offset, "%s", |
378 | function_keys[i].func); | 379 | function_keys[i].func); |
379 | offset += strlen(function_keys[i].func) + skip; | 380 | offset += strlen(function_keys[i].func) + skip; |
@@ -694,7 +695,7 @@ static void search_conf(void) | |||
694 | int dres; | 695 | int dres; |
695 | 696 | ||
696 | title = str_new(); | 697 | title = str_new(); |
697 | str_printf( &title, _("Enter %s (sub)string to search for " | 698 | str_printf( &title, _("Enter %s (sub)string or regexp to search for " |
698 | "(with or without \"%s\")"), CONFIG_, CONFIG_); | 699 | "(with or without \"%s\")"), CONFIG_, CONFIG_); |
699 | 700 | ||
700 | again: | 701 | again: |
@@ -759,9 +760,9 @@ static void build_conf(struct menu *menu) | |||
759 | indent + 1, ' ', prompt); | 760 | indent + 1, ' ', prompt); |
760 | } else | 761 | } else |
761 | item_make(menu, 'm', | 762 | item_make(menu, 'm', |
762 | " %*c%s --->", | 763 | " %*c%s %s", |
763 | indent + 1, | 764 | indent + 1, ' ', prompt, |
764 | ' ', prompt); | 765 | menu_is_empty(menu) ? "----" : "--->"); |
765 | 766 | ||
766 | if (single_menu_mode && menu->data) | 767 | if (single_menu_mode && menu->data) |
767 | goto conf_childs; | 768 | goto conf_childs; |
@@ -903,7 +904,7 @@ static void build_conf(struct menu *menu) | |||
903 | (sym_has_value(sym) || !sym_is_changable(sym)) ? | 904 | (sym_has_value(sym) || !sym_is_changable(sym)) ? |
904 | "" : _(" (NEW)")); | 905 | "" : _(" (NEW)")); |
905 | if (menu->prompt && menu->prompt->type == P_MENU) { | 906 | if (menu->prompt && menu->prompt->type == P_MENU) { |
906 | item_add_str(" --->"); | 907 | item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); |
907 | return; | 908 | return; |
908 | } | 909 | } |
909 | } | 910 | } |
@@ -954,7 +955,7 @@ static void show_menu(const char *prompt, const char *instructions, | |||
954 | 955 | ||
955 | clear(); | 956 | clear(); |
956 | (void) wattrset(main_window, attributes[NORMAL]); | 957 | (void) wattrset(main_window, attributes[NORMAL]); |
957 | print_in_middle(stdscr, 1, 0, COLS, | 958 | print_in_middle(stdscr, 1, 0, getmaxx(stdscr), |
958 | menu_backtitle, | 959 | menu_backtitle, |
959 | attributes[MAIN_HEADING]); | 960 | attributes[MAIN_HEADING]); |
960 | 961 | ||
@@ -1455,14 +1456,18 @@ static void conf_save(void) | |||
1455 | 1456 | ||
1456 | void setup_windows(void) | 1457 | void setup_windows(void) |
1457 | { | 1458 | { |
1459 | int lines, columns; | ||
1460 | |||
1461 | getmaxyx(stdscr, lines, columns); | ||
1462 | |||
1458 | if (main_window != NULL) | 1463 | if (main_window != NULL) |
1459 | delwin(main_window); | 1464 | delwin(main_window); |
1460 | 1465 | ||
1461 | /* set up the menu and menu window */ | 1466 | /* set up the menu and menu window */ |
1462 | main_window = newwin(LINES-2, COLS-2, 2, 1); | 1467 | main_window = newwin(lines-2, columns-2, 2, 1); |
1463 | keypad(main_window, TRUE); | 1468 | keypad(main_window, TRUE); |
1464 | mwin_max_lines = LINES-7; | 1469 | mwin_max_lines = lines-7; |
1465 | mwin_max_cols = COLS-6; | 1470 | mwin_max_cols = columns-6; |
1466 | 1471 | ||
1467 | /* panels order is from bottom to top */ | 1472 | /* panels order is from bottom to top */ |
1468 | new_panel(main_window); | 1473 | new_panel(main_window); |
@@ -1470,6 +1475,7 @@ void setup_windows(void) | |||
1470 | 1475 | ||
1471 | int main(int ac, char **av) | 1476 | int main(int ac, char **av) |
1472 | { | 1477 | { |
1478 | int lines, columns; | ||
1473 | char *mode; | 1479 | char *mode; |
1474 | 1480 | ||
1475 | setlocale(LC_ALL, ""); | 1481 | setlocale(LC_ALL, ""); |
@@ -1495,7 +1501,8 @@ int main(int ac, char **av) | |||
1495 | keypad(stdscr, TRUE); | 1501 | keypad(stdscr, TRUE); |
1496 | curs_set(0); | 1502 | curs_set(0); |
1497 | 1503 | ||
1498 | if (COLS < 75 || LINES < 20) { | 1504 | getmaxyx(stdscr, lines, columns); |
1505 | if (columns < 75 || lines < 20) { | ||
1499 | endwin(); | 1506 | endwin(); |
1500 | printf("Your terminal should have at " | 1507 | printf("Your terminal should have at " |
1501 | "least 20 lines and 75 columns\n"); | 1508 | "least 20 lines and 75 columns\n"); |