From f738c6cf01e4508b3af9a7fed4be3d98f9b087a5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 Dec 2015 21:06:26 +0000 Subject: Quotes menu items appear even for non-Quotes contacts, part II git-svn-id: http://svn.miranda-ng.org/main/trunk@15922 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Quotes/src/Forex.cpp | 4 ++-- plugins/Quotes/src/QuoteInfoDlg.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/Quotes/src') diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 5bd76ee082..2ce2a1d7db 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -13,7 +13,7 @@ HGENMENU g_hMenuOpenLogFile = NULL; #ifdef CHART_IMPLEMENT HGENMENU g_hMenuChart = NULL; #endif -HGENMENU g_hMenuRefresh = NULL; +HGENMENU g_hMenuRefresh = NULL, g_hMenuRoot = NULL; #define DB_STR_AUTO_UPDATE "AutoUpdate" @@ -125,7 +125,7 @@ void InitMenu() HookEvent(ME_CLIST_PREBUILDCONTACTMENU, Quotes_PrebuildContactMenu); - mi.root = Menu_CreateRoot(MO_CONTACT, _T(QUOTES_PROTOCOL_NAME), 0, Quotes_GetIconHandle(IDI_ICON_MAIN)); + g_hMenuRoot = mi.root = Menu_CreateRoot(MO_CONTACT, _T(QUOTES_PROTOCOL_NAME), 0, Quotes_GetIconHandle(IDI_ICON_MAIN)); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "C259BE01-642C-461E-997D-0E756B2A3AD6"); SET_UID(mi, 0xb9812194, 0x3235, 0x4e76, 0xa3, 0xa4, 0x73, 0x32, 0x96, 0x1c, 0x1c, 0xf4); diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index 17c0eea0ec..51970a044f 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -6,7 +6,7 @@ extern HGENMENU g_hMenuOpenLogFile; #ifdef CHART_IMPLEMENT extern HGENMENU g_hMenuChart; #endif -extern HGENMENU g_hMenuRefresh; +extern HGENMENU g_hMenuRefresh, g_hMenuRoot; #define WINDOW_PREFIX_INFO "Quote Info" @@ -246,13 +246,13 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) Menu_EnableItem(g_hMenuRefresh, false); MCONTACT hContact = MCONTACT(wp); - if (NULL == hContact) - return 0; - char *szProto = GetContactProto(hContact); - if (mir_strcmp(szProto, QUOTES_MODULE_NAME)) + if (mir_strcmp(szProto, QUOTES_MODULE_NAME)) { + Menu_ShowItem(g_hMenuRoot, false); return 0; + } + Menu_ShowItem(g_hMenuRoot, true); Menu_EnableItem(g_hMenuEditSettings, true); Menu_EnableItem(g_hMenuRefresh, true); -- cgit v1.2.3