[asterisk-commits] branch group/autoconf_and_menuselect r8853 - /team/group/autoconf_and_menusel...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 31 14:20:19 MST 2006


Author: russell
Date: Sat Jan 28 23:30:07 2006
New Revision: 8853

URL: http://svn.digium.com/view/asterisk?rev=8853&view=rev
Log:
add a help screen displayed with 'h', plus some other cosmetic updates

Modified:
    team/group/autoconf_and_menuselect/build_tools/menuselect.c
    team/group/autoconf_and_menuselect/build_tools/menuselect.h

Modified: team/group/autoconf_and_menuselect/build_tools/menuselect.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/menuselect.c?rev=8853&r1=8852&r2=8853&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/menuselect.c (original)
+++ team/group/autoconf_and_menuselect/build_tools/menuselect.c Sat Jan 28 23:30:07 2006
@@ -36,13 +36,8 @@
 #include "asterisk/linkedlists.h"
 #undef AST_LIST_NOLOCK
 
-#define HELP_MESSAGE	"scroll = up/down arrows, select = Enter, back = left arrow"
-#define HELP_MESSAGE2	"quit = q, save and quit = x"
-
-#define TITLE_HEIGHT	5
-
 #define MIN_X		80
-#define MIN_Y		25
+#define MIN_Y		20
 
 #define MENUSELECT_DEBUG
 
@@ -517,6 +512,19 @@
 	}
 }
 
+void show_help(WINDOW *win)
+{
+	int i;
+
+	wclear(win);
+	for (i = 0; help_info[i]; i++) {
+		wmove(win, i, max_x / 2 - 15);
+		waddstr(win, help_info[i]);	
+	}
+	wrefresh(win);
+	getch(); /* block until the user hits a key */
+}
+
 void draw_main_menu(WINDOW *menu, int curopt)
 {
 	struct category *cat;
@@ -644,6 +652,10 @@
 			toggle_enabled(cat, curopt);
 			draw_category_menu(menu, cat, start, end, curopt);
 			break;
+		case 'h':
+		case 'H':
+			show_help(menu);
+			draw_category_menu(menu, cat, start, end, curopt);
 		default:
 			break;	
 		}
@@ -658,12 +670,12 @@
 
 void draw_title_window(WINDOW *title)
 {
-	wmove(title, 1, (max_x / 2) - (strlen(MENU_TITLE) / 2));
-	waddstr(title, MENU_TITLE);
-	wmove(title, 2, (max_x / 2) - (strlen(HELP_MESSAGE) / 2));
-	waddstr(title, HELP_MESSAGE);
-	wmove(title, 3, (max_x / 2) - (strlen(HELP_MESSAGE2) / 2));
-	waddstr(title, HELP_MESSAGE2);
+	wmove(title, 1, (max_x / 2) - (strlen(MENU_TITLE1) / 2));
+	waddstr(title, MENU_TITLE1);
+	wmove(title, 2, (max_x / 2) - (strlen(MENU_TITLE2) / 2));
+	waddstr(title, MENU_TITLE2);
+	wmove(title, 3, (max_x / 2) - (strlen(MENU_TITLE3) / 2));
+	waddstr(title, MENU_TITLE3);
 	wmove(title, 0, 0);
 	wrefresh(title);
 }
@@ -723,6 +735,10 @@
 			c = run_category_menu(menu, curopt);
 			draw_main_menu(menu, curopt);
 			break;
+		case 'h':
+		case 'H':
+			show_help(menu);
+			draw_main_menu(menu, curopt);
 		default:
 			break;	
 		}

Modified: team/group/autoconf_and_menuselect/build_tools/menuselect.h
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/menuselect.h?rev=8853&r1=8852&r2=8853&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/menuselect.h (original)
+++ team/group/autoconf_and_menuselect/build_tools/menuselect.h Sat Jan 28 23:30:07 2006
@@ -23,11 +23,27 @@
  *
  */
 
-#define MENU_TITLE		"Asterisk Module Selection"
+#define MENU_TITLE1	"*************************************"
+#define MENU_TITLE2	"*     Asterisk Module Selection     *"
+#define MENU_TITLE3	"*************************************"
+
+#define TITLE_HEIGHT	5
+
 #define OUTPUT_MAKEOPTS_DEFAULT "asterisk.makeopts"
 #define MENUSELECT_DEPS		"autoconf/menuselect-deps"
 
-const char *makeopts_files[] = {
+const char * const help_info[] = {
+	"scroll        => up/down arrows",
+	"(de)select    => Enter",
+	"back          => left arrow",
+	"quit          => q",
+	"save and quit => x",
+	"",
+	"XXX means dependencies havenot been met",
+	NULL
+};
+
+const char * const makeopts_files[] = {
 	"apps/makeopts.xml",
 	"cdr/makeopts.xml",
 	"channels/makeopts.xml",



More information about the asterisk-commits mailing list