soc.2009.vulture: 1f65f627: Menu for contact nodes.

gdick at soc.pidgin.im gdick at soc.pidgin.im
Sat Jul 18 16:50:23 EDT 2009


-----------------------------------------------------------------
Revision: 1f65f627f6deb3ef7111708b483f08fddaf77ad9
Ancestor: 87befac3a17ba2398b77ef7579d2455d0bff30a6
Author: gdick at soc.pidgin.im
Date: 2009-07-18T16:00:11
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/1f65f627f6deb3ef7111708b483f08fddaf77ad9

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

ChangeLog: 

Menu for contact nodes.

-------------- next part --------------
============================================================
--- vulture/resource.h	184fcd45fbf7bed29e1dcc5f72e1f0ebc3161380
+++ vulture/resource.h	58b1a0d28e14faa19ad81b0d256dbf921527dfff
@@ -46,6 +46,9 @@
 #define IDM_BLIST_CONTEXT_ALIAS                 40207
 #define IDM_BLIST_CONTEXT_REMOVE                40208
 #define IDM_BLIST_CONTEXT_BLOCK                 40209
+#define IDM_BLIST_CONTEXT_CUSTOMICON            40210
+#define IDM_BLIST_CONTEXT_REMOVEICON            40211
+#define IDM_BLIST_CONTEXT_SHOWBUDDIES           40212
 
 #define IDM_CONV                                1003
 #define IDM_CONV_CONV_CLOSE                     40401
============================================================
--- vulture/vulture-res.rc	90ee93a20dd3148415d547bfbeb66fcd0c497e8a
+++ vulture/vulture-res.rc	9f8cced84f786de0e1d44e3838c22809e8e94f56
@@ -36,24 +36,52 @@ IDM_CONV MENU
     }
 }
 
+#define BUDDY_CONTACT_VIEWLOG \
+	MENUITEM "View &log", IDM_BLIST_CONTEXT_VIEWLOG, MFT_STRING, MFS_GRAYED
 
+#define BUDDY_CONTACT_ALIAS_REMOVE \
+	MENUITEM "Set &alias...", IDM_BLIST_CONTEXT_ALIAS, MFT_STRING, MFS_GRAYED \
+	MENUITEM "&Remove from buddy list", IDM_BLIST_CONTEXT_REMOVE, MFT_STRING, MFS_GRAYED
+
+#define BUDDY_CONTACT_COMMON \
+	MENUITEM "Start &conversation", IDM_BLIST_CONTEXT_IM, MFT_STRING, MFS_DEFAULT \
+	MENUITEM "Get &info", IDM_BLIST_CONTEXT_GETINFO, MFT_STRING, MFS_GRAYED \
+	MENUITEM "Send &file...", IDM_BLIST_CONTEXT_SENDFILE, MFT_STRING, MFS_GRAYED \
+	MENUITEM "Add &pounce...", IDM_BLIST_CONTEXT_ADDPOUNCE, MFT_STRING, MFS_GRAYED \
+	BUDDY_CONTACT_VIEWLOG \
+	\
+	MENUITEM "", 0, MFT_SEPARATOR \
+	\
+	MENUITEM "&Block", IDM_BLIST_CONTEXT_BLOCK, MFT_STRING, MFS_GRAYED \
+	MENUITEM "Show when &offline", IDM_BLIST_CONTEXT_SHOWOFFLINE, MFT_STRING, MFS_GRAYED
+
+#define CONTACT_TAIL \
+	MENUITEM "", 0, MFT_SEPARATOR \
+	MENUITEM "Set custom &icon...", IDM_BLIST_CONTEXT_CUSTOMICON, MFT_STRING, MFS_GRAYED \
+	MENUITEM "Remo&ve custom icon", IDM_BLIST_CONTEXT_REMOVEICON, MFT_STRING, MFS_GRAYED \
+	BUDDY_CONTACT_ALIAS_REMOVE \
+	MENUITEM "", 0, MFT_SEPARATOR \
+	MENUITEM "Sho&w individual buddies", IDM_BLIST_CONTEXT_SHOWBUDDIES, MFT_STRING, MFS_GRAYED
+
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
 IDM_BLIST_CONTEXT MENUEX
 {
 	POPUP "Buddy"
 	{
-		MENUITEM "Start &conversation", IDM_BLIST_CONTEXT_IM, MFT_STRING, MFS_DEFAULT
-		MENUITEM "Get &info", IDM_BLIST_CONTEXT_GETINFO, MFT_STRING, MFS_GRAYED
-		MENUITEM "Send &file...", IDM_BLIST_CONTEXT_SENDFILE, MFT_STRING, MFS_GRAYED
-		MENUITEM "Add &pounce...", IDM_BLIST_CONTEXT_ADDPOUNCE, MFT_STRING, MFS_GRAYED
-		MENUITEM "View &log", IDM_BLIST_CONTEXT_VIEWLOG, MFT_STRING, MFS_GRAYED
+		BUDDY_CONTACT_COMMON
+		BUDDY_CONTACT_ALIAS_REMOVE
+	}
 
-		MENUITEM "", 0, MFT_SEPARATOR
+	POPUP "Contact (Composite)"
+	{
+		BUDDY_CONTACT_COMMON
+		CONTACT_TAIL
+	}
 
-		MENUITEM "&Block", IDM_BLIST_CONTEXT_BLOCK, MFT_STRING, MFS_GRAYED
-		MENUITEM "Show when &offline", IDM_BLIST_CONTEXT_SHOWOFFLINE, MFT_STRING, MFS_GRAYED
-		MENUITEM "Set &alias...", IDM_BLIST_CONTEXT_ALIAS, MFT_STRING, MFS_GRAYED
-		MENUITEM "&Remove from buddy list", IDM_BLIST_CONTEXT_REMOVE, MFT_STRING, MFS_GRAYED
+	POPUP "Contact (Basic)"
+	{
+		BUDDY_CONTACT_VIEWLOG
+		CONTACT_TAIL
 	}
 }
 
============================================================
--- vulture/vultureblist.c	e7840807a05d053810fd96a9ebab3ac3d355fdc9
+++ vulture/vultureblist.c	9842aad8777354da393097978f46fceacd9293f1
@@ -64,6 +64,8 @@ enum CONTEXT_MENU_INDICES
 enum CONTEXT_MENU_INDICES
 {
 	CMI_BUDDY = 0,
+	CMI_CONTACT_COMPOSITE,
+	CMI_CONTACT_BASIC,
 };
 
 
@@ -627,6 +629,24 @@ static INT_PTR CALLBACK BuddyListDlgProc
 								
 								break;
 
+							case PURPLE_BLIST_CONTACT_NODE:
+								if(TreeView_GetChild(lpnmhdr->hwndFrom, tvitem.hItem))
+								{
+									hmenuSubmenu = GetSubMenu(hmenu, CMI_CONTACT_BASIC);
+								}
+								else
+								{
+									VULTURE_MAKE_CONTEXT_MENU vmcm;
+
+									vmcm.hmenu = hmenuSubmenu = GetSubMenu(hmenu, CMI_CONTACT_COMPOSITE);
+									vmcm.lpvblistnode = lpvblistnode;
+									vmcm.lplpglistVMA = &lpglistVMA;
+
+									VultureSingleSyncPurpleCall(PC_MAKEBUDDYMENU, &vmcm);
+								}
+
+								break;
+
 							default:
 								break;
 							}
@@ -640,7 +660,17 @@ static INT_PTR CALLBACK BuddyListDlgProc
 								iCmd = TrackPopupMenu(hmenuSubmenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, ptMouse.x, ptMouse.y, 0, hwndDlg, NULL);
 
 								if(iCmd != 0)
-									RunBuddyMenuCmd(lpvblistnode, hmenuSubmenu, iCmd);
+								{
+									switch(lpvblistnode->nodetype)
+									{
+									case PURPLE_BLIST_BUDDY_NODE:
+									case PURPLE_BLIST_CONTACT_NODE:
+										RunBuddyMenuCmd(lpvblistnode, hmenuSubmenu, iCmd);
+										break;
+									default:
+										break;
+									}
+								}
 							}
 
 							/* Destroy menu. This will also destroy our modifications. */
@@ -873,8 +903,8 @@ static void RemoveBListNode(HWND hwndBli
 
 
 /**
- * Executes a menu command from the context menu for a buddy node in the buddy
- * list.
+ * Executes a menu command from the context menu for a buddy or contact node in
+ * the buddy list.
  *
  * @param	lpvblistnode	List node to which the context menu relates.
  * @param	hmenu		Context menu.


More information about the Commits mailing list