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/FacebookRM/src/proto.h | 1 - protocols/FacebookRM/src/theme.cpp | 20 ++------------------ 2 files changed, 2 insertions(+), 19 deletions(-) (limited to 'protocols/FacebookRM') diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 33cdd19bfe..9e4dafbab5 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -234,7 +234,6 @@ public: bool RunCaptchaForm(std::string imageUrl, std::string &result); // Menu items - HGENMENU m_hMenuRoot; HGENMENU m_hMenuServicesRoot; HGENMENU m_hStatusMind; diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 1c0abafb6d..adc1214647 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -208,25 +208,9 @@ int FacebookProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) { - HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName); - if (hRoot == NULL) { - CMenuItem miRoot; - miRoot.position = 500085000; - miRoot.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | (this->isOnline() ? 0 : CMIF_GRAYED); - miRoot.hIcolibItem = GetIconHandle("facebook"); - miRoot.name.t = m_tszUserName; - hRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&miRoot); - } - else { - if (m_hMenuRoot) { - Menu_RemoveItem(m_hMenuRoot); - m_hMenuRoot = NULL; - } - } - CMenuItem mi; mi.position = 201001; - mi.root = hRoot; + mi.root = Menu_GetProtocolRoot(this); mi.pszService = "/Mind"; CreateProtoService(mi.pszService, &FacebookProto::OnMind); @@ -275,7 +259,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) void FacebookProto::ToggleStatusMenuItems(bool bEnable) { - Menu_EnableItem(m_hMenuRoot, bEnable); + Menu_EnableItem(m_hMainMenuItem, bEnable); Menu_EnableItem(m_hStatusMind, bEnable); Menu_EnableItem(m_hMenuServicesRoot, bEnable); } -- cgit v1.2.3