summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-31 12:35:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-31 12:35:53 +0000
commit9833de62bdc19d14695442c8a0e98fcc02fe15f7 (patch)
tree036371414d6208d325812746daf9f91997c07c76 /protocols
parenta1e7a7060fd0e73a0af3fdfd82fade1dab4deb80 (diff)
MRA to hide Service menu root in the contact's menu
git-svn-id: http://svn.miranda-ng.org/main/trunk@6713 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/MRA/src/MraProto.h6
-rw-r--r--protocols/MRA/src/Mra_menus.cpp11
2 files changed, 11 insertions, 6 deletions
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index ebd76449ab..6adc51259a 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -190,11 +190,11 @@ struct CMraProto : public PROTO<CMraProto>
DWORD dwEmailMessagesTotal, m_dwEmailMessagesUnread;
bool bHideXStatusUI;
- HGENMENU hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
+ HGENMENU hXStatusMenuItems[MRA_XSTATUS_COUNT+4], hContactMenuRoot;
HANDLE hExtraXstatusIcon;
HANDLE hExtraInfo;
- char szNewMailSound[MAX_PATH];
+ char szNewMailSound[MAX_PATH];
CRITICAL_SECTION csCriticalSectionSend;
@@ -284,7 +284,7 @@ struct CMraProto : public PROTO<CMraProto>
void SetExtraIcons(HANDLE hContact);
void InitMenus(void);
- void CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsStatus, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult);
+ HGENMENU CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsStatus, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult);
DWORD ProtoBroadcastAckAsync(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam);
CMStringA CreateBlobFromContact(HANDLE hContact, const CMStringW &wszRequestReason);
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp
index ea3a503d00..5fd0056bed 100644
--- a/protocols/MRA/src/Mra_menus.cpp
+++ b/protocols/MRA/src/Mra_menus.cpp
@@ -261,6 +261,9 @@ int CMraProto::MraRebuildContactMenu(WPARAM wParam, LPARAM lParam)
// non proto contact
else bHasEMail = bHasEMailMR = bChatAgent = FALSE;
+ // menu root;
+ Menu_ShowItem(hContactMenuRoot, bIsContactMRA);
+
//"Request authorization"
Menu_ShowItem(hContactMenuItems[0], (m_bLoggedIn && bIsContactMRA));// && (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
@@ -336,10 +339,10 @@ int CMraProto::MraRebuildStatusMenu(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsMain, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult)
+HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsMain, const IconItem *pgdiItems, size_t dwCount, HGENMENU *hResult)
{
if (!pgdiItems || !dwCount || !hResult)
- return;
+ return NULL;
char szServiceFunction[MAX_PATH];
strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
@@ -386,6 +389,8 @@ void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bIsMai
mi.pszName = pgdiItems[i].szDescr;
hResult[i] = fnAddFunc(&mi);
}
+
+ return hRootMenu;
}
void CMraProto::InitMenus()
@@ -405,7 +410,7 @@ void CMraProto::InitMenus()
CreateProtoService(MRA_CHK_USERS_AVATARS, &CMraProto::MraCheckUpdatesUsersAvt);
CreateProtoService(MRA_REQ_AUTH_FOR_ALL, &CMraProto::MraRequestAuthForAll);
- CListCreateMenu(-2000001001, -500050000, FALSE, gdiContactMenuItems, CONTACT_MENU_ITEMS_COUNT, hContactMenuItems);
+ hContactMenuRoot = CListCreateMenu(-2000001001, -500050000, FALSE, gdiContactMenuItems, CONTACT_MENU_ITEMS_COUNT, hContactMenuItems);
// xstatus menu
for (int i = 0; i < MRA_XSTATUS_COUNT; i++) {