summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/theme.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-30 20:27:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-30 20:27:23 +0000
commita8c93cfbf235c31cf604cb6bd40009e9bf88f36a (patch)
tree0eaf9592ee3cd752e8f2d0273132de0004aa1f6e /protocols/WhatsApp/src/theme.cpp
parent6b893bc94df93321a216ba62c3d56a6e08086e36 (diff)
- fix for the old perversion with manual protocol root calculation;
- protocol menu root is always created by the core; - other minor problems with protocol menus in main menu went away git-svn-id: http://svn.miranda-ng.org/main/trunk@14462 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/theme.cpp')
-rw-r--r--protocols/WhatsApp/src/theme.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp
index 1a11414f4b..d3a2cbd434 100644
--- a/protocols/WhatsApp/src/theme.cpp
+++ b/protocols/WhatsApp/src/theme.cpp
@@ -47,29 +47,13 @@ static WhatsAppProto* GetInstanceByHContact(MCONTACT hContact)
int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
{
- HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName);
- if (hRoot == NULL) {
- CMenuItem mi;
- mi.position = 500085000;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | (isOnline() ? 0 : CMIF_GRAYED);
- mi.hIcolibItem = GetIconHandle("whatsApp");
- mi.name.t = m_tszUserName;
- hRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
- }
- else {
- if (m_hMenuRoot) {
- Menu_RemoveItem(m_hMenuRoot);
- m_hMenuRoot = NULL;
- }
- }
-
CMenuItem mi;
mi.flags = (isOnline() ? 0 : CMIF_GRAYED);
mi.position = 201001;
mi.pszService = "/CreateGroup";
CreateProtoService(mi.pszService, &WhatsAppProto::OnCreateGroup);
- mi.root = hRoot;
+ mi.root = Menu_GetProtocolRoot(this);
mi.name.a = LPGEN("Create group");
mi.hIcolibItem = GetIconHandle("createGroup");
m_hMenuCreateGroup = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -78,6 +62,5 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
void WhatsAppProto::ToggleStatusMenuItems(bool bEnable)
{
- Menu_EnableItem(m_hMenuRoot, bEnable);
Menu_EnableItem(m_hMenuCreateGroup, bEnable);
}