[svn-commits] russell: trunk r917 - /trunk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 14 14:43:58 CDT 2011


Author: russell
Date: Thu Jul 14 14:43:54 2011
New Revision: 917

URL: http://svnview.digium.com/svn/menuselect?view=rev&rev=917
Log:
Add support for displaying support level and replacement.

Modified:
    trunk/menuselect.c
    trunk/menuselect.h
    trunk/menuselect_curses.c
    trunk/menuselect_newt.c

Modified: trunk/menuselect.c
URL: http://svnview.digium.com/svn/menuselect/trunk/menuselect.c?view=diff&rev=917&r1=916&r2=917
==============================================================================
--- trunk/menuselect.c (original)
+++ trunk/menuselect.c Thu Jul 14 14:43:54 2011
@@ -291,10 +291,22 @@
 				mem->was_enabled = mem->enabled = 1;
 				print_debug("Enabling %s because the category does not have positive output\n", mem->name);
 			}
+
 			cur3 = mxmlFindElement(cur2, cur2, "defaultenabled", NULL, NULL, MXML_DESCEND);
-			if (cur3 && cur3->child)
+			if (cur3 && cur3->child) {
 				mem->defaultenabled = cur3->child->value.opaque;
-			
+			}
+
+			cur3 = mxmlFindElement(cur2, cur2, "support_level", NULL, NULL, MXML_DESCEND);
+			if (cur3 && cur3->child) {
+				mem->support_level = cur3->child->value.opaque;
+			}
+
+			cur3 = mxmlFindElement(cur2, cur2, "replacement", NULL, NULL, MXML_DESCEND);
+			if (cur3 && cur3->child) {
+				mem->replacement = cur3->child->value.opaque;
+			}
+
 			for (cur3 = mxmlFindElement(cur2, cur2, "depend", NULL, NULL, MXML_DESCEND_FIRST);
 			     cur3 && cur3->child;
 			     cur3 = mxmlFindElement(cur3, cur2, "depend", NULL, NULL, MXML_NO_DESCEND))

Modified: trunk/menuselect.h
URL: http://svnview.digium.com/svn/menuselect/trunk/menuselect.h?view=diff&rev=917&r1=916&r2=917
==============================================================================
--- trunk/menuselect.h (original)
+++ trunk/menuselect.h Thu Jul 14 14:43:54 2011
@@ -64,6 +64,8 @@
 	const char *remove_on_change;
 	/*! Touch these file(s) if this member changes */
 	const char *touch_on_change;
+	const char *support_level;
+	const char *replacement;
 	/*! This module is currently selected */
 	unsigned int enabled:1;
 	/*! This module was enabled when the config was loaded */

Modified: trunk/menuselect_curses.c
URL: http://svnview.digium.com/svn/menuselect/trunk/menuselect_curses.c?view=diff&rev=917&r1=916&r2=917
==============================================================================
--- trunk/menuselect_curses.c (original)
+++ trunk/menuselect_curses.c Thu Jul 14 14:43:54 2011
@@ -194,6 +194,8 @@
 	wclrtoeol(menu);
 	wmove(menu, end - start + 5, max_x / 2 - 16);
 	wclrtoeol(menu);
+	wmove(menu, end - start + 6, max_x / 2 - 16);
+	wclrtoeol(menu);
 
 	if (mem->displayname) {
 		wmove(menu, end - start + 2, max_x / 2 - 16);
@@ -232,7 +234,17 @@
 		}
 		waddstr(menu, buf);
 	}
-
+	{ /* support level */
+		wmove(menu, end - start + 6, max_x / 2 - 16);
+		snprintf(buf, sizeof(buf), "Support Level: %s",
+				(mem->support_level && *mem->support_level) ? mem->support_level : "core");
+		if (mem->replacement && *mem->replacement) {
+			char buf2[64];
+			snprintf(buf2, sizeof(buf2), ", Replaced by: %s", mem->replacement);
+			strncat(buf, buf2, sizeof(buf) - strlen(buf) - 1);
+		}
+		waddstr(menu, buf);
+	}
 }
 
 static void draw_category_menu(WINDOW *menu, struct category *cat, int start, int end, int curopt, int changed, int flags)
@@ -329,7 +341,7 @@
 	struct category *cat;
 	int i = 0;
 	int start = 0;
-	int end = max_y - TITLE_HEIGHT - 6;
+	int end = max_y - TITLE_HEIGHT - 8;
 	int c;
 	int curopt = 0;
 	int maxopt;

Modified: trunk/menuselect_newt.c
URL: http://svnview.digium.com/svn/menuselect/trunk/menuselect_newt.c?view=diff&rev=917&r1=916&r2=917
==============================================================================
--- trunk/menuselect_newt.c (original)
+++ trunk/menuselect_newt.c Thu Jul 14 14:43:54 2011
@@ -43,9 +43,11 @@
 static newtComponent dependsLabel;
 static newtComponent usesLabel;
 static newtComponent conflictsLabel;
+static newtComponent supportLevelLabel;
 static newtComponent dependsDataTextbox;
 static newtComponent usesDataTextbox;
 static newtComponent conflictsDataTextbox;
+static newtComponent supportLevelDataTextbox;
 
 static newtComponent exitButton;
 static newtComponent saveAndExitButton;
@@ -83,6 +85,7 @@
 	newtTextboxSetText(dependsDataTextbox, "");
 	newtTextboxSetText(usesDataTextbox, "");
 	newtTextboxSetText(conflictsDataTextbox, "");
+	newtTextboxSetText(supportLevelDataTextbox, "");
 	newtRefresh();
 }
 
@@ -139,7 +142,16 @@
 		newtTextboxSetText(conflictsDataTextbox, buffer);
 	}
 
-	return;
+	{ /* Support Level */
+		snprintf(buffer, sizeof(buffer), "%s",
+				(mem->support_level && *mem->support_level) ? mem->support_level : "core");
+		if (mem->replacement && *mem->replacement) {
+			char buf2[64];
+			snprintf(buf2, sizeof(buf2), ", Replaced by: %s", mem->replacement);
+			strncat(buffer, buf2, sizeof(buffer) - strlen(buffer) - 1);
+		}
+		newtTextboxSetText(supportLevelDataTextbox, buffer);
+	}
 }
 
 static void build_members_menu(int overlay)
@@ -279,13 +291,15 @@
 	newtFormAddComponent(form, subOptions);
 	newtComponentAddCallback(subOptions, category_menu_callback, NULL);
 
-	memberNameTextbox    = newtTextbox(2, y - 13, x - 10, 1, 0);
-	dependsLabel         = newtLabel(2, y - 11, "    Depends on:");
-	usesLabel            = newtLabel(2, y - 10, "       Can use:");
-	conflictsLabel       = newtLabel(2, y - 9, "Conflicts with:");
-	dependsDataTextbox   = newtTextbox(18, y - 11, x - 27, 1, 0);
-	usesDataTextbox      = newtTextbox(18, y - 10, x - 27, 1, 0);
-	conflictsDataTextbox = newtTextbox(18, y - 9, x - 27, 1, 0);
+	memberNameTextbox       = newtTextbox(2, y - 13, x - 10, 1, 0);
+	dependsLabel            = newtLabel(2, y - 11, "    Depends on:");
+	usesLabel               = newtLabel(2, y - 10, "       Can use:");
+	conflictsLabel          = newtLabel(2, y - 9,  "Conflicts with:");
+	supportLevelLabel       = newtLabel(2, y - 8,  " Support Level:");
+	dependsDataTextbox      = newtTextbox(18, y - 11, x - 27, 1, 0);
+	usesDataTextbox         = newtTextbox(18, y - 10, x - 27, 1, 0);
+	conflictsDataTextbox    = newtTextbox(18, y - 9, x - 27, 1, 0);
+	supportLevelDataTextbox = newtTextbox(18, y - 8, x - 27, 1, 0);
 
 	exitButton = newtButton(x - 23, y - 11, "  Exit  ");
 	saveAndExitButton = newtButton(x - 43, y - 11, " Save & Exit ");
@@ -299,6 +313,8 @@
 		usesDataTextbox,
 		conflictsLabel,
 		conflictsDataTextbox,
+		supportLevelLabel,
+		supportLevelDataTextbox,
 		saveAndExitButton,
 		exitButton,
 		NULL);




More information about the svn-commits mailing list