diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-30 20:27:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-30 20:27:23 +0000 |
commit | a8c93cfbf235c31cf604cb6bd40009e9bf88f36a (patch) | |
tree | 0eaf9592ee3cd752e8f2d0273132de0004aa1f6e /protocols/JabberG | |
parent | 6b893bc94df93321a216ba62c3d56a6e08086e36 (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/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 26 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_privacy.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 5 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 2 |
4 files changed, 5 insertions, 30 deletions
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 88f3746d36..e241a5200c 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -579,24 +579,8 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) void CJabberProto::MenuInit()
{
- HGENMENU hJabberRoot = Menu_GetProtocolRoot(m_szModuleName);
- if (hJabberRoot == NULL) {
- CMenuItem mi;
- mi.name.t = m_tszUserName;
- mi.position = -1999901006;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.hIcolibItem = m_hProtoIcon;
- hJabberRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
- }
- else {
- if (m_hMenuRoot) {
- Menu_RemoveItem(m_hMenuRoot);
- m_hMenuRoot = NULL;
- }
- }
-
CMenuItem mi;
- mi.root = hJabberRoot;
+ mi.root = m_hMenuRoot = Menu_GetProtocolRoot(this);
// "Bookmarks..."
mi.pszService = "/Bookmarks";
@@ -693,7 +677,7 @@ void CJabberProto::MenuInit() mi.pszService = NULL;
mi.position = 200006;
- mi.root = hJabberRoot;
+ mi.root = m_hMenuRoot;
mi.name.a = LPGEN("Resource priority");
mi.flags = CMIF_HIDDEN;
m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
@@ -743,7 +727,7 @@ void CJabberProto::MenuInit() m_pepServices.RebuildMenu();
CheckMenuItems();
- NotifyFastHook(hStatusMenuInit, (WPARAM)hJabberRoot, (LPARAM)(IJabberInterface*)this);
+ NotifyFastHook(hStatusMenuInit, (WPARAM)m_hMenuRoot, (LPARAM)(IJabberInterface*)this);
}
//////////////////////////////////////////////////////////////////////////
@@ -876,10 +860,6 @@ void CJabberProto::GlobalMenuUninit() m_phMenuResourceItems = NULL;
}
m_nMenuResourceItems = 0;
-
- if (m_hMenuRoot)
- Menu_RemoveItem(m_hMenuRoot);
- m_hMenuRoot = NULL;
}
void CJabberProto::EnableMenuItems(BOOL bEnable)
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 35fdcde2f6..f70aa8741e 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2095,7 +2095,7 @@ void CJabberProto::BuildPrivacyMenu() mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
mi.flags = CMIF_HIDDEN;
mi.name.a = LPGEN("Privacy Lists");
- mi.root = Menu_GetProtocolRoot(m_szModuleName);
+ mi.root = m_hMenuRoot;
m_hPrivacyMenuRoot = Menu_AddProtoMenuItem(&mi);
mi.pszService = "/PrivacyLists";
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index f589828244..0cfc3446f8 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1318,11 +1318,6 @@ int __cdecl CJabberProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARA MenuInit();
break;
- case EV_PROTO_ONRENAME:
- if (m_hMenuRoot)
- Menu_ModifyItem(m_hMenuRoot, m_tszUserName);
- break;
-
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index f28aa0abc4..ddde385b99 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -458,7 +458,7 @@ void CPepGuiService::InitGui() void CPepGuiService::RebuildMenu()
{
- HGENMENU hJabberRoot = Menu_GetProtocolRoot(m_proto->m_szModuleName);
+ HGENMENU hJabberRoot = m_proto->m_hMenuRoot;
if (hJabberRoot == NULL)
return;
|