summaryrefslogtreecommitdiff
path: root/protocols/GTalkExt/src/menu.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-25 20:37:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-25 20:37:12 +0000
commit5a3fa95fbe1930c035cd1adffee0792b7d1d8846 (patch)
tree017dfe1d07b1dc16bddf1aa77e85eb19d385f551 /protocols/GTalkExt/src/menu.cpp
parent3d411171eba820bffa2998f2442c197a553153f4 (diff)
GTalk menu item is inserted now into the Jabber protocol menu
git-svn-id: http://svn.miranda-ng.org/main/trunk@4190 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt/src/menu.cpp')
-rw-r--r--protocols/GTalkExt/src/menu.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp
index 377b776091..ea241e6f55 100644
--- a/protocols/GTalkExt/src/menu.cpp
+++ b/protocols/GTalkExt/src/menu.cpp
@@ -25,26 +25,30 @@
#include "inbox.h"
static const LPSTR MS_GTALKEXT_OPENMAILBOX = SHORT_PLUGIN_NAME "/OpenMailbox";
-static const LPTSTR _T(OPEN_MAILBOX_ITEM_CAPTION) = LPGENT("Open mailbox");
extern HICON g_hPopupIcon;
-HANDLE hOnPrebuildMenu = 0;
-
-INT_PTR OpenMailboxMenuHandler(WPARAM wParam, LPARAM lParam)
+INT_PTR OpenMailboxMenuHandler(WPARAM wParam, LPARAM lParam, LPARAM param)
{
- OpenContactInbox((HANDLE)wParam);
+ OpenContactInbox((LPCSTR)param);
return 0;
}
-void InitMenus()
+int InitMenus(WPARAM wParam, LPARAM lParam)
{
- CreateServiceFunction(MS_GTALKEXT_OPENMAILBOX, OpenMailboxMenuHandler);
-/*!!!!!!!!!!!!!!!!!!!!!
- CLISTMENUITEM cmi = { sizeof(cmi) };
- cmi.flags = CMIF_TCHAR;
- cmi.hIcon = g_hPopupIcon;
- cmi.ptszName = _T(OPEN_MAILBOX_ITEM_CAPTION);
- cmi.pszService = MS_GTALKEXT_OPENMAILBOX;
- Menu_AddContactMenuItem(&cmi); */
+ IJabberInterface *ji = (IJabberInterface*)lParam;
+
+ char szServiceName[100];
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s/%s", ji->Sys()->GetModuleName(), MS_GTALKEXT_OPENMAILBOX);
+ CreateServiceFunctionParam(szServiceName, OpenMailboxMenuHandler, (LPARAM)ji->Sys()->GetModuleName());
+
+ CLISTMENUITEM cmi = { sizeof(cmi) };
+ cmi.flags = CMIF_CHILDPOPUP;
+ cmi.hParentMenu = HGENMENU(wParam);
+ cmi.hIcon = g_hPopupIcon;
+ cmi.position = 200101;
+ cmi.pszName = LPGEN("Open mailbox");
+ cmi.pszService = szServiceName;
+ Menu_AddProtoMenuItem(&cmi);
+ return 0;
}