soc.2009.vulture: 266f22a3: Toggle visibility of empty groups.

gdick at soc.pidgin.im gdick at soc.pidgin.im
Sat Aug 8 16:06:24 EDT 2009


-----------------------------------------------------------------
Revision: 266f22a3477b94385b6252f6c9e2cb455f822cf8
Ancestor: 9e6ef160bdbe3166f47a681eb931a95cb577841f
Author: gdick at soc.pidgin.im
Date: 2009-08-07T16:24:27
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/266f22a3477b94385b6252f6c9e2cb455f822cf8

Modified files:
        vulture/purpleblist.c vulture/purplemain.c
        vulture/resource.h vulture/vulture-res.rc vulture/vulture.h
        vulture/vultureblist.c

ChangeLog: 

Toggle visibility of empty groups.

-------------- next part --------------
============================================================
--- vulture/purpleblist.c	6bd9c74ef96d9ca45744b633b664feaca88afd87
+++ vulture/purpleblist.c	15de20fd007925f20e4f6a5118886e30ced7a321
@@ -198,6 +198,11 @@ static BOOL ShouldShowNode(PurpleBlistNo
 	switch(lpblistnode->type)
 	{
 	case PURPLE_BLIST_GROUP_NODE:
+		if(g_vflags.bShowEmptyGroups)
+			return TRUE;
+
+		/* Fall through. */
+
 	case PURPLE_BLIST_CONTACT_NODE:
 		{
 			PurpleBlistNode *lpblistnodeRover;
============================================================
--- vulture/purplemain.c	74044c3f709cef6aa4fdcb31c7d30882c3f0bc25
+++ vulture/purplemain.c	c5fe877770c6e70a9fb3946d34ee4eb085b741e2
@@ -331,8 +331,10 @@ static void LoadFlags(void)
 	purple_prefs_add_none(VULTURE_PREFS_ROOT);
 	purple_prefs_add_none(VULTURE_PREFS_ROOT "/blist");
 	purple_prefs_add_bool(VULTURE_PREFS_ROOT "/blist/show_offline_buddies", FALSE);
+	purple_prefs_add_bool(VULTURE_PREFS_ROOT "/blist/show_empty_groups", TRUE);
 
 	g_vflags.bShowOffline = purple_prefs_get_bool(VULTURE_PREFS_ROOT "/blist/show_offline_buddies");
+	g_vflags.bShowEmptyGroups = purple_prefs_get_bool(VULTURE_PREFS_ROOT "/blist/show_empty_groups");
 }
 
 
@@ -340,4 +342,5 @@ static void SaveFlags(void)
 static void SaveFlags(void)
 {
 	purple_prefs_set_bool(VULTURE_PREFS_ROOT "/blist/show_offline_buddies", g_vflags.bShowOffline);
+	purple_prefs_set_bool(VULTURE_PREFS_ROOT "/blist/show_empty_groups", g_vflags.bShowEmptyGroups);
 }
============================================================
--- vulture/resource.h	4bfdf58961d7d035d67dc5294aea67ad4d04775d
+++ vulture/resource.h	153e1cc7ffdc425ec3efb777bdb5972e7b5d6f4b
@@ -48,6 +48,7 @@
 #define IDM_BLIST_BUDDIES_IM		40005
 #define IDM_BLIST_BUDDIES_ADDCHAT	40006
 #define IDM_BLIST_BUDDIES_ADDGROUP	40007
+#define IDM_BLIST_VIEW_SHOWEMPTYGROUPS	40008
 
 #define IDM_BLIST_CONTEXT		1002
 #define IDM_BLIST_CONTEXT_ACTIVATE	40201
============================================================
--- vulture/vulture-res.rc	8b275d772529861939dd7e406b2984d348669f23
+++ vulture/vulture-res.rc	7585d321ecc9e90b7bb85761470898965ac9fa32
@@ -37,6 +37,7 @@ IDM_BLIST MENU
 	POPUP "&View"
 	{
 		MENUITEM "Show &Offline Buddies", IDM_BLIST_VIEW_SHOWOFFLINE
+		MENUITEM "Show &Empty Groups", IDM_BLIST_VIEW_SHOWEMPTYGROUPS
 	}
 
 	POPUP "&Accounts"
============================================================
--- vulture/vulture.h	e05d8b9796e81217407c649e3932b7fc05f15f4b
+++ vulture/vulture.h	1ffdbf86f02bdb38494deb08c4f36995d25f9e43
@@ -35,6 +35,7 @@ typedef struct _VULTURE_FLAGS
 typedef struct _VULTURE_FLAGS
 {
 	BOOL	bShowOffline;
+	BOOL	bShowEmptyGroups;
 } VULTURE_FLAGS;
 
 
============================================================
--- vulture/vultureblist.c	8e99ff6d48302ae66cd330c3d5dbfd5a7a7e03c6
+++ vulture/vultureblist.c	250d5a788290fbaa2ba53caa0db8633042eb30d0
@@ -280,6 +280,11 @@ static LRESULT CALLBACK MainWndProc(HWND
 			VultureEnqueueAsyncPurpleCall(PC_REFRESHBLIST, NULL);
 			return 0;
 
+		case IDM_BLIST_VIEW_SHOWEMPTYGROUPS:
+			g_vflags.bShowEmptyGroups = !g_vflags.bShowEmptyGroups;
+			VultureEnqueueAsyncPurpleCall(PC_REFRESHBLIST, NULL);
+			return 0;
+
 		case IDM_BLIST_ACCOUNTS_MANAGE:
 			ManageAccounts(hwnd);
 			return 0;
@@ -291,6 +296,7 @@ static LRESULT CALLBACK MainWndProc(HWND
 		if(!HIWORD(lParam))
 		{
 			CheckMenuItem((HMENU)wParam, IDM_BLIST_VIEW_SHOWOFFLINE, g_vflags.bShowOffline ? MF_CHECKED : MF_UNCHECKED);
+			CheckMenuItem((HMENU)wParam, IDM_BLIST_VIEW_SHOWEMPTYGROUPS, g_vflags.bShowEmptyGroups ? MF_CHECKED : MF_UNCHECKED);
 		}
 
 		return 0;


More information about the Commits mailing list