Lines 4-11
Link Here
|
4 |
* |
4 |
* |
5 |
* Introduced single menu mode (show all sub-menus in one large tree). |
5 |
* Introduced single menu mode (show all sub-menus in one large tree). |
6 |
* 2002-11-06 Petr Baudis <pasky@ucw.cz> |
6 |
* 2002-11-06 Petr Baudis <pasky@ucw.cz> |
7 |
* |
|
|
8 |
* i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
9 |
*/ |
7 |
*/ |
10 |
|
8 |
|
11 |
#include <sys/ioctl.h> |
9 |
#include <sys/ioctl.h> |
Lines 26-32
Link Here
|
26 |
#include "lkc.h" |
24 |
#include "lkc.h" |
27 |
|
25 |
|
28 |
static char menu_backtitle[128]; |
26 |
static char menu_backtitle[128]; |
29 |
static const char mconf_readme[] = N_( |
27 |
static const char mconf_readme[] = |
30 |
"Overview\n" |
28 |
"Overview\n" |
31 |
"--------\n" |
29 |
"--------\n" |
32 |
"Some kernel features may be built directly into the kernel.\n" |
30 |
"Some kernel features may be built directly into the kernel.\n" |
Lines 159-197
static const char mconf_readme[] = N_(
Link Here
|
159 |
"\n" |
157 |
"\n" |
160 |
"Note that this mode can eventually be a little more CPU expensive\n" |
158 |
"Note that this mode can eventually be a little more CPU expensive\n" |
161 |
"(especially with a larger number of unrolled categories) than the\n" |
159 |
"(especially with a larger number of unrolled categories) than the\n" |
162 |
"default mode.\n"), |
160 |
"default mode.\n", |
163 |
menu_instructions[] = N_( |
161 |
menu_instructions[] = |
164 |
"Arrow keys navigate the menu. " |
162 |
"Arrow keys navigate the menu. " |
165 |
"<Enter> selects submenus --->. " |
163 |
"<Enter> selects submenus --->. " |
166 |
"Highlighted letters are hotkeys. " |
164 |
"Highlighted letters are hotkeys. " |
167 |
"Pressing <Y> includes, <N> excludes, <M> modularizes features. " |
165 |
"Pressing <Y> includes, <N> excludes, <M> modularizes features. " |
168 |
"Press <Esc><Esc> to exit, <?> for Help, </> for Search. " |
166 |
"Press <Esc><Esc> to exit, <?> for Help, </> for Search. " |
169 |
"Legend: [*] built-in [ ] excluded <M> module < > module capable"), |
167 |
"Legend: [*] built-in [ ] excluded <M> module < > module capable", |
170 |
radiolist_instructions[] = N_( |
168 |
radiolist_instructions[] = |
171 |
"Use the arrow keys to navigate this window or " |
169 |
"Use the arrow keys to navigate this window or " |
172 |
"press the hotkey of the item you wish to select " |
170 |
"press the hotkey of the item you wish to select " |
173 |
"followed by the <SPACE BAR>. " |
171 |
"followed by the <SPACE BAR>. " |
174 |
"Press <?> for additional information about this option."), |
172 |
"Press <?> for additional information about this option.", |
175 |
inputbox_instructions_int[] = N_( |
173 |
inputbox_instructions_int[] = |
176 |
"Please enter a decimal value. " |
174 |
"Please enter a decimal value. " |
177 |
"Fractions will not be accepted. " |
175 |
"Fractions will not be accepted. " |
178 |
"Use the <TAB> key to move from the input field to the buttons below it."), |
176 |
"Use the <TAB> key to move from the input field to the buttons below it.", |
179 |
inputbox_instructions_hex[] = N_( |
177 |
inputbox_instructions_hex[] = |
180 |
"Please enter a hexadecimal value. " |
178 |
"Please enter a hexadecimal value. " |
181 |
"Use the <TAB> key to move from the input field to the buttons below it."), |
179 |
"Use the <TAB> key to move from the input field to the buttons below it.", |
182 |
inputbox_instructions_string[] = N_( |
180 |
inputbox_instructions_string[] = |
183 |
"Please enter a string value. " |
181 |
"Please enter a string value. " |
184 |
"Use the <TAB> key to move from the input field to the buttons below it."), |
182 |
"Use the <TAB> key to move from the input field to the buttons below it.", |
185 |
setmod_text[] = N_( |
183 |
setmod_text[] = |
186 |
"This feature depends on another which has been configured as a module.\n" |
184 |
"This feature depends on another which has been configured as a module.\n" |
187 |
"As a result, this feature will be built as a module."), |
185 |
"As a result, this feature will be built as a module.", |
188 |
nohelp_text[] = N_( |
186 |
nohelp_text[] = |
189 |
"There is no help available for this kernel option.\n"), |
187 |
"There is no help available for this kernel option.\n", |
190 |
load_config_text[] = N_( |
188 |
load_config_text[] = |
191 |
"Enter the name of the configuration file you wish to load. " |
189 |
"Enter the name of the configuration file you wish to load. " |
192 |
"Accept the name shown to restore the configuration you " |
190 |
"Accept the name shown to restore the configuration you " |
193 |
"last retrieved. Leave blank to abort."), |
191 |
"last retrieved. Leave blank to abort.", |
194 |
load_config_help[] = N_( |
192 |
load_config_help[] = |
195 |
"\n" |
193 |
"\n" |
196 |
"For various reasons, one may wish to keep several different kernel\n" |
194 |
"For various reasons, one may wish to keep several different kernel\n" |
197 |
"configurations available on a single machine.\n" |
195 |
"configurations available on a single machine.\n" |
Lines 201-211
load_config_help[] = N_(
Link Here
|
201 |
"to modify that configuration.\n" |
199 |
"to modify that configuration.\n" |
202 |
"\n" |
200 |
"\n" |
203 |
"If you are uncertain, then you have probably never used alternate\n" |
201 |
"If you are uncertain, then you have probably never used alternate\n" |
204 |
"configuration files. You should therefor leave this blank to abort.\n"), |
202 |
"configuration files. You should therefor leave this blank to abort.\n", |
205 |
save_config_text[] = N_( |
203 |
save_config_text[] = |
206 |
"Enter a filename to which this configuration should be saved " |
204 |
"Enter a filename to which this configuration should be saved " |
207 |
"as an alternate. Leave blank to abort."), |
205 |
"as an alternate. Leave blank to abort.", |
208 |
save_config_help[] = N_( |
206 |
save_config_help[] = |
209 |
"\n" |
207 |
"\n" |
210 |
"For various reasons, one may wish to keep different kernel\n" |
208 |
"For various reasons, one may wish to keep different kernel\n" |
211 |
"configurations available on a single machine.\n" |
209 |
"configurations available on a single machine.\n" |
Lines 215-222
save_config_help[] = N_(
Link Here
|
215 |
"configuration options you have selected at that time.\n" |
213 |
"configuration options you have selected at that time.\n" |
216 |
"\n" |
214 |
"\n" |
217 |
"If you are uncertain what all this means then you should probably\n" |
215 |
"If you are uncertain what all this means then you should probably\n" |
218 |
"leave this blank.\n"), |
216 |
"leave this blank.\n", |
219 |
search_help[] = N_( |
217 |
search_help[] = |
220 |
"\n" |
218 |
"\n" |
221 |
"Search for CONFIG_ symbols and display their relations.\n" |
219 |
"Search for CONFIG_ symbols and display their relations.\n" |
222 |
"Example: search for \"^FOO\"\n" |
220 |
"Example: search for \"^FOO\"\n" |
Lines 253-259
search_help[] = N_(
Link Here
|
253 |
"Examples: USB => find all CONFIG_ symbols containing USB\n" |
251 |
"Examples: USB => find all CONFIG_ symbols containing USB\n" |
254 |
" ^USB => find all CONFIG_ symbols starting with USB\n" |
252 |
" ^USB => find all CONFIG_ symbols starting with USB\n" |
255 |
" USB$ => find all CONFIG_ symbols ending with USB\n" |
253 |
" USB$ => find all CONFIG_ symbols ending with USB\n" |
256 |
"\n"); |
254 |
"\n"; |
257 |
|
255 |
|
258 |
static char buf[4096], *bufptr = buf; |
256 |
static char buf[4096], *bufptr = buf; |
259 |
static char input_buf[4096]; |
257 |
static char input_buf[4096]; |
Lines 308-315
static void init_wsize(void)
Link Here
|
308 |
} |
306 |
} |
309 |
|
307 |
|
310 |
if (rows < 19 || cols < 80) { |
308 |
if (rows < 19 || cols < 80) { |
311 |
fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); |
309 |
fprintf(stderr, "Your display is too small to run Menuconfig!\n"); |
312 |
fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); |
310 |
fprintf(stderr, "It must be at least 19 lines by 80 columns.\n"); |
313 |
exit(1); |
311 |
exit(1); |
314 |
} |
312 |
} |
315 |
|
313 |
|
Lines 529-537
static void search_conf(void)
Link Here
|
529 |
again: |
527 |
again: |
530 |
cprint_init(); |
528 |
cprint_init(); |
531 |
cprint("--title"); |
529 |
cprint("--title"); |
532 |
cprint(_("Search Configuration Parameter")); |
530 |
cprint("Search Configuration Parameter"); |
533 |
cprint("--inputbox"); |
531 |
cprint("--inputbox"); |
534 |
cprint(_("Enter Keyword")); |
532 |
cprint("Enter Keyword"); |
535 |
cprint("10"); |
533 |
cprint("10"); |
536 |
cprint("75"); |
534 |
cprint("75"); |
537 |
cprint(""); |
535 |
cprint(""); |
Lines 542-548
again:
Link Here
|
542 |
case 0: |
540 |
case 0: |
543 |
break; |
541 |
break; |
544 |
case 1: |
542 |
case 1: |
545 |
show_helptext(_("Search Configuration"), search_help); |
543 |
show_helptext("Search Configuration", search_help); |
546 |
goto again; |
544 |
goto again; |
547 |
default: |
545 |
default: |
548 |
return; |
546 |
return; |
Lines 551-557
again:
Link Here
|
551 |
sym_arr = sym_re_search(input_buf); |
549 |
sym_arr = sym_re_search(input_buf); |
552 |
res = get_relations_str(sym_arr); |
550 |
res = get_relations_str(sym_arr); |
553 |
free(sym_arr); |
551 |
free(sym_arr); |
554 |
show_textbox(_("Search Results"), str_get(&res), 0, 0); |
552 |
show_textbox("Search Results", str_get(&res), 0, 0); |
555 |
str_free(&res); |
553 |
str_free(&res); |
556 |
} |
554 |
} |
557 |
|
555 |
|
Lines 724-732
static void conf(struct menu *menu)
Link Here
|
724 |
while (1) { |
722 |
while (1) { |
725 |
cprint_init(); |
723 |
cprint_init(); |
726 |
cprint("--title"); |
724 |
cprint("--title"); |
727 |
cprint("%s", prompt ? prompt : _("Main Menu")); |
725 |
cprint("%s", prompt ? prompt : "Main Menu"); |
728 |
cprint("--menu"); |
726 |
cprint("--menu"); |
729 |
cprint(_(menu_instructions)); |
727 |
cprint(menu_instructions); |
730 |
cprint("%d", rows); |
728 |
cprint("%d", rows); |
731 |
cprint("%d", cols); |
729 |
cprint("%d", cols); |
732 |
cprint("%d", rows - 10); |
730 |
cprint("%d", rows - 10); |
Lines 739-747
static void conf(struct menu *menu)
Link Here
|
739 |
cprint(":"); |
737 |
cprint(":"); |
740 |
cprint("--- "); |
738 |
cprint("--- "); |
741 |
cprint("L"); |
739 |
cprint("L"); |
742 |
cprint(_(" Load an Alternate Configuration File")); |
740 |
cprint(" Load an Alternate Configuration File"); |
743 |
cprint("S"); |
741 |
cprint("S"); |
744 |
cprint(_(" Save Configuration to an Alternate File")); |
742 |
cprint(" Save Configuration to an Alternate File"); |
745 |
} |
743 |
} |
746 |
stat = exec_conf(); |
744 |
stat = exec_conf(); |
747 |
if (stat < 0) |
745 |
if (stat < 0) |
Lines 796-802
static void conf(struct menu *menu)
Link Here
|
796 |
if (sym) |
794 |
if (sym) |
797 |
show_help(submenu); |
795 |
show_help(submenu); |
798 |
else |
796 |
else |
799 |
show_helptext("README", _(mconf_readme)); |
797 |
show_helptext("README", mconf_readme); |
800 |
break; |
798 |
break; |
801 |
case 3: |
799 |
case 3: |
802 |
if (type == 't') { |
800 |
if (type == 't') { |
Lines 852-858
static void show_help(struct menu *menu)
Link Here
|
852 |
{ |
850 |
{ |
853 |
if (sym->name) { |
851 |
if (sym->name) { |
854 |
str_printf(&help, "CONFIG_%s:\n\n", sym->name); |
852 |
str_printf(&help, "CONFIG_%s:\n\n", sym->name); |
855 |
str_append(&help, _(sym->help)); |
853 |
str_append(&help, sym->help); |
856 |
str_append(&help, "\n"); |
854 |
str_append(&help, "\n"); |
857 |
} |
855 |
} |
858 |
} else { |
856 |
} else { |
Lines 889-897
static void conf_choice(struct menu *men
Link Here
|
889 |
while (1) { |
887 |
while (1) { |
890 |
cprint_init(); |
888 |
cprint_init(); |
891 |
cprint("--title"); |
889 |
cprint("--title"); |
892 |
cprint("%s", prompt ? prompt : _("Main Menu")); |
890 |
cprint("%s", prompt ? prompt : "Main Menu"); |
893 |
cprint("--radiolist"); |
891 |
cprint("--radiolist"); |
894 |
cprint(_(radiolist_instructions)); |
892 |
cprint(radiolist_instructions); |
895 |
cprint("15"); |
893 |
cprint("15"); |
896 |
cprint("70"); |
894 |
cprint("70"); |
897 |
cprint("6"); |
895 |
cprint("6"); |
Lines 938-954
static void conf_string(struct menu *men
Link Here
|
938 |
while (1) { |
936 |
while (1) { |
939 |
cprint_init(); |
937 |
cprint_init(); |
940 |
cprint("--title"); |
938 |
cprint("--title"); |
941 |
cprint("%s", prompt ? prompt : _("Main Menu")); |
939 |
cprint("%s", prompt ? prompt : "Main Menu"); |
942 |
cprint("--inputbox"); |
940 |
cprint("--inputbox"); |
943 |
switch (sym_get_type(menu->sym)) { |
941 |
switch (sym_get_type(menu->sym)) { |
944 |
case S_INT: |
942 |
case S_INT: |
945 |
cprint(_(inputbox_instructions_int)); |
943 |
cprint(inputbox_instructions_int); |
946 |
break; |
944 |
break; |
947 |
case S_HEX: |
945 |
case S_HEX: |
948 |
cprint(_(inputbox_instructions_hex)); |
946 |
cprint(inputbox_instructions_hex); |
949 |
break; |
947 |
break; |
950 |
case S_STRING: |
948 |
case S_STRING: |
951 |
cprint(_(inputbox_instructions_string)); |
949 |
cprint(inputbox_instructions_string); |
952 |
break; |
950 |
break; |
953 |
default: |
951 |
default: |
954 |
/* panic? */; |
952 |
/* panic? */; |
Lines 961-967
static void conf_string(struct menu *men
Link Here
|
961 |
case 0: |
959 |
case 0: |
962 |
if (sym_set_string_value(menu->sym, input_buf)) |
960 |
if (sym_set_string_value(menu->sym, input_buf)) |
963 |
return; |
961 |
return; |
964 |
show_textbox(NULL, _("You have made an invalid entry."), 5, 43); |
962 |
show_textbox(NULL, "You have made an invalid entry.", 5, 43); |
965 |
break; |
963 |
break; |
966 |
case 1: |
964 |
case 1: |
967 |
show_help(menu); |
965 |
show_help(menu); |
Lines 990-999
static void conf_load(void)
Link Here
|
990 |
return; |
988 |
return; |
991 |
if (!conf_read(input_buf)) |
989 |
if (!conf_read(input_buf)) |
992 |
return; |
990 |
return; |
993 |
show_textbox(NULL, _("File does not exist!"), 5, 38); |
991 |
show_textbox(NULL, "File does not exist!", 5, 38); |
994 |
break; |
992 |
break; |
995 |
case 1: |
993 |
case 1: |
996 |
show_helptext(_("Load Alternate Configuration"), load_config_help); |
994 |
show_helptext("Load Alternate Configuration", load_config_help); |
997 |
break; |
995 |
break; |
998 |
case 255: |
996 |
case 255: |
999 |
return; |
997 |
return; |
Lines 1019-1028
static void conf_save(void)
Link Here
|
1019 |
return; |
1017 |
return; |
1020 |
if (!conf_write(input_buf)) |
1018 |
if (!conf_write(input_buf)) |
1021 |
return; |
1019 |
return; |
1022 |
show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); |
1020 |
show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60); |
1023 |
break; |
1021 |
break; |
1024 |
case 1: |
1022 |
case 1: |
1025 |
show_helptext(_("Save Alternate Configuration"), save_config_help); |
1023 |
show_helptext("Save Alternate Configuration", save_config_help); |
1026 |
break; |
1024 |
break; |
1027 |
case 255: |
1025 |
case 255: |
1028 |
return; |
1026 |
return; |
Lines 1043-1058
int main(int ac, char **av)
Link Here
|
1043 |
char *mode; |
1041 |
char *mode; |
1044 |
int stat; |
1042 |
int stat; |
1045 |
|
1043 |
|
1046 |
setlocale(LC_ALL, ""); |
|
|
1047 |
bindtextdomain(PACKAGE, LOCALEDIR); |
1048 |
textdomain(PACKAGE); |
1049 |
|
1050 |
conf_parse(av[1]); |
1044 |
conf_parse(av[1]); |
1051 |
conf_read(NULL); |
1045 |
conf_read(NULL); |
1052 |
|
1046 |
|
1053 |
sym = sym_lookup("KERNELRELEASE", 0); |
1047 |
sym = sym_lookup("KERNELRELEASE", 0); |
1054 |
sym_calc_value(sym); |
1048 |
sym_calc_value(sym); |
1055 |
sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), |
1049 |
sprintf(menu_backtitle, "Linux Kernel v%s Configuration", |
1056 |
sym_get_string_value(sym)); |
1050 |
sym_get_string_value(sym)); |
1057 |
|
1051 |
|
1058 |
mode = getenv("MENUCONFIG_MODE"); |
1052 |
mode = getenv("MENUCONFIG_MODE"); |
Lines 1069-1075
int main(int ac, char **av)
Link Here
|
1069 |
do { |
1063 |
do { |
1070 |
cprint_init(); |
1064 |
cprint_init(); |
1071 |
cprint("--yesno"); |
1065 |
cprint("--yesno"); |
1072 |
cprint(_("Do you wish to save your new kernel configuration?")); |
1066 |
cprint("Do you wish to save your new kernel configuration?"); |
1073 |
cprint("5"); |
1067 |
cprint("5"); |
1074 |
cprint("60"); |
1068 |
cprint("60"); |
1075 |
stat = exec_conf(); |
1069 |
stat = exec_conf(); |
Lines 1077-1096
int main(int ac, char **av)
Link Here
|
1077 |
|
1071 |
|
1078 |
if (stat == 0) { |
1072 |
if (stat == 0) { |
1079 |
if (conf_write(NULL)) { |
1073 |
if (conf_write(NULL)) { |
1080 |
fprintf(stderr, _("\n\n" |
1074 |
fprintf(stderr, "\n\n" |
1081 |
"Error during writing of the kernel configuration.\n" |
1075 |
"Error during writing of the kernel configuration.\n" |
1082 |
"Your kernel configuration changes were NOT saved." |
1076 |
"Your kernel configuration changes were NOT saved." |
1083 |
"\n\n")); |
1077 |
"\n\n"); |
1084 |
return 1; |
1078 |
return 1; |
1085 |
} |
1079 |
} |
1086 |
printf(_("\n\n" |
1080 |
printf("\n\n" |
1087 |
"*** End of Linux kernel configuration.\n" |
1081 |
"*** End of Linux kernel configuration.\n" |
1088 |
"*** Execute 'make' to build the kernel or try 'make help'." |
1082 |
"*** Execute 'make' to build the kernel or try 'make help'." |
1089 |
"\n\n")); |
1083 |
"\n\n"); |
1090 |
} else { |
1084 |
} else { |
1091 |
fprintf(stderr, _("\n\n" |
1085 |
fprintf(stderr, "\n\n" |
1092 |
"Your kernel configuration changes were NOT saved." |
1086 |
"Your kernel configuration changes were NOT saved." |
1093 |
"\n\n")); |
1087 |
"\n\n"); |
1094 |
} |
1088 |
} |
1095 |
|
1089 |
|
1096 |
return 0; |
1090 |
return 0; |