mconf.c (4ba24fef3eb3b142197135223b90ced2f319cd53) | mconf.c (0a1f00a1c86421cc07cec87011c7cf4df68ee54b) |
---|---|
1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 * 5 * Introduced single menu mode (show all sub-menus in one large tree). 6 * 2002-11-06 Petr Baudis <pasky@ucw.cz> 7 * 8 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> --- 265 unchanged lines hidden (view full) --- 274 "\n"); 275 276static int indent; 277static struct menu *current_menu; 278static int child_count; 279static int single_menu_mode; 280static int show_all_options; 281static int save_and_exit; | 1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 * 5 * Introduced single menu mode (show all sub-menus in one large tree). 6 * 2002-11-06 Petr Baudis <pasky@ucw.cz> 7 * 8 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> --- 265 unchanged lines hidden (view full) --- 274 "\n"); 275 276static int indent; 277static struct menu *current_menu; 278static int child_count; 279static int single_menu_mode; 280static int show_all_options; 281static int save_and_exit; |
282static int silent; |
|
282 283static void conf(struct menu *menu, struct menu *active_menu); 284static void conf_choice(struct menu *menu); 285static void conf_string(struct menu *menu); 286static void conf_load(void); 287static void conf_save(void); 288static int show_textbox_ext(const char *title, char *text, int r, int c, 289 int *keys, int *vscroll, int *hscroll, --- 482 unchanged lines hidden (view full) --- 772 show_textbox(title, text, 0, 0); 773} 774 775static void conf_message_callback(const char *fmt, va_list ap) 776{ 777 char buf[PATH_MAX+1]; 778 779 vsnprintf(buf, sizeof(buf), fmt, ap); | 283 284static void conf(struct menu *menu, struct menu *active_menu); 285static void conf_choice(struct menu *menu); 286static void conf_string(struct menu *menu); 287static void conf_load(void); 288static void conf_save(void); 289static int show_textbox_ext(const char *title, char *text, int r, int c, 290 int *keys, int *vscroll, int *hscroll, --- 482 unchanged lines hidden (view full) --- 773 show_textbox(title, text, 0, 0); 774} 775 776static void conf_message_callback(const char *fmt, va_list ap) 777{ 778 char buf[PATH_MAX+1]; 779 780 vsnprintf(buf, sizeof(buf), fmt, ap); |
780 if (save_and_exit) 781 printf("%s", buf); 782 else | 781 if (save_and_exit) { 782 if (!silent) 783 printf("%s", buf); 784 } else { |
783 show_textbox(NULL, buf, 6, 60); | 785 show_textbox(NULL, buf, 6, 60); |
786 } |
|
784} 785 786static void show_help(struct menu *menu) 787{ 788 struct gstr help = str_new(); 789 790 help.max_width = getmaxx(stdscr) - 10; 791 menu_get_ext_help(menu, &help); --- 180 unchanged lines hidden (view full) --- 972 fprintf(stderr, _("\n\n" 973 "Error while writing of the configuration.\n" 974 "Your configuration changes were NOT saved." 975 "\n\n")); 976 return 1; 977 } 978 /* fall through */ 979 case -1: | 787} 788 789static void show_help(struct menu *menu) 790{ 791 struct gstr help = str_new(); 792 793 help.max_width = getmaxx(stdscr) - 10; 794 menu_get_ext_help(menu, &help); --- 180 unchanged lines hidden (view full) --- 975 fprintf(stderr, _("\n\n" 976 "Error while writing of the configuration.\n" 977 "Your configuration changes were NOT saved." 978 "\n\n")); 979 return 1; 980 } 981 /* fall through */ 982 case -1: |
980 printf(_("\n\n" 981 "*** End of the configuration.\n" 982 "*** Execute 'make' to start the build or try 'make help'." 983 "\n\n")); | 983 if (!silent) 984 printf(_("\n\n" 985 "*** End of the configuration.\n" 986 "*** Execute 'make' to start the build or try 'make help'." 987 "\n\n")); |
984 res = 0; 985 break; 986 default: | 988 res = 0; 989 break; 990 default: |
987 fprintf(stderr, _("\n\n" 988 "Your configuration changes were NOT saved." 989 "\n\n")); | 991 if (!silent) 992 fprintf(stderr, _("\n\n" 993 "Your configuration changes were NOT saved." 994 "\n\n")); |
990 if (res != KEY_ESC) 991 res = 0; 992 } 993 994 return res; 995} 996 997static void sig_handler(int signo) --- 7 unchanged lines hidden (view full) --- 1005 int res; 1006 1007 setlocale(LC_ALL, ""); 1008 bindtextdomain(PACKAGE, LOCALEDIR); 1009 textdomain(PACKAGE); 1010 1011 signal(SIGINT, sig_handler); 1012 | 995 if (res != KEY_ESC) 996 res = 0; 997 } 998 999 return res; 1000} 1001 1002static void sig_handler(int signo) --- 7 unchanged lines hidden (view full) --- 1010 int res; 1011 1012 setlocale(LC_ALL, ""); 1013 bindtextdomain(PACKAGE, LOCALEDIR); 1014 textdomain(PACKAGE); 1015 1016 signal(SIGINT, sig_handler); 1017 |
1018 if (ac > 1 && strcmp(av[1], "-s") == 0) { 1019 silent = 1; 1020 /* Silence conf_read() until the real callback is set up */ 1021 conf_set_message_callback(NULL); 1022 av++; 1023 } |
|
1013 conf_parse(av[1]); 1014 conf_read(NULL); 1015 1016 mode = getenv("MENUCONFIG_MODE"); 1017 if (mode) { 1018 if (!strcasecmp(mode, "single_menu")) 1019 single_menu_mode = 1; 1020 } --- 16 unchanged lines hidden --- | 1024 conf_parse(av[1]); 1025 conf_read(NULL); 1026 1027 mode = getenv("MENUCONFIG_MODE"); 1028 if (mode) { 1029 if (!strcasecmp(mode, "single_menu")) 1030 single_menu_mode = 1; 1031 } --- 16 unchanged lines hidden --- |