From 9833de62bdc19d14695442c8a0e98fcc02fe15f7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 31 Oct 2013 12:35:53 +0000 Subject: 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 --- protocols/MRA/src/Mra_menus.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'protocols/MRA/src/Mra_menus.cpp') 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++) { -- cgit v1.2.3