From a8c93cfbf235c31cf604cb6bd40009e9bf88f36a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 30 Jun 2015 20:27:23 +0000 Subject: - 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 --- protocols/WhatsApp/src/proto.h | 2 +- protocols/WhatsApp/src/theme.cpp | 19 +------------------ 2 files changed, 2 insertions(+), 19 deletions(-) (limited to 'protocols/WhatsApp') diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 5a3cf8cac9..7c153ef781 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -141,7 +141,7 @@ private: // Private data ////////////////////////////////////////////////////////////////////// - HGENMENU m_hMenuRoot, m_hMenuCreateGroup; + HGENMENU m_hMenuCreateGroup; HANDLE update_loop_lock_; 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); } -- cgit v1.2.3