summaryrefslogtreecommitdiff
path: root/plugins/Quotes/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-22 20:38:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-22 20:38:56 +0000
commit88790eed4ffd9ca555c8f9b73cb014a93b57a34f (patch)
treeb3e5bfe096005a9cac4bc14fdfbe5f6f5acad98a /plugins/Quotes/src
parent9ecc2aa50e2183e2c4a11861ca6dede7d2151139 (diff)
Menu_ModifyItem unbound from CLISTMENUITEM structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Quotes/src')
-rw-r--r--plugins/Quotes/src/Forex.cpp58
-rw-r--r--plugins/Quotes/src/QuoteInfoDlg.cpp7
2 files changed, 5 insertions, 60 deletions
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index 908f8074c5..d565deff7a 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -44,64 +44,14 @@ namespace
void UpdateMenu(bool bAutoUpdate)
{
- CLISTMENUITEM mi = { 0 };
-
- if (bAutoUpdate) { // to enable auto-update
- mi.pszName = LPGEN("Auto Update Enabled");
- mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
- //opt.AutoUpdate = 1;
- }
- else { // to disable auto-update
- mi.pszName = LPGEN("Auto Update Disabled");
- mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_DISABLED);
- //opt.AutoUpdate = 0;
- }
+ if (bAutoUpdate) // to enable auto-update
+ Menu_ModifyItem(g_hEnableDisableMenu, LPGENT("Auto Update Enabled"), Quotes_GetIconHandle(IDI_ICON_MAIN));
+ else // to disable auto-update
+ Menu_ModifyItem(g_hEnableDisableMenu, LPGENT("Auto Update Disabled"), Quotes_GetIconHandle(IDI_ICON_DISABLED));
- mi.flags = CMIM_ICON | CMIM_NAME;
- Menu_ModifyItem(g_hEnableDisableMenu, &mi);
CallService(MS_TTB_SETBUTTONSTATE, reinterpret_cast<WPARAM>(g_hTBButton), !bAutoUpdate ? TTBST_PUSHED : 0);
}
-
- // INT_PTR QuoteProtoFunc_SetStatus(WPARAM wp,LPARAM /*lp*/)
- // {
- // if ((ID_STATUS_ONLINE == wp) || (ID_STATUS_OFFLINE == wp))
- // {
- // bool bAutoUpdate = (ID_STATUS_ONLINE == wp);
- // bool bOldFlag = g_bAutoUpdate;
- //
- // if(bAutoUpdate != g_bAutoUpdate)
- // {
- // g_bAutoUpdate = bAutoUpdate;
- // db_set_b(NULL,QUOTES_MODULE_NAME,DB_STR_AUTO_UPDATE,g_bAutoUpdate);
- // if (bOldFlag && !g_bAutoUpdate)
- // {
- // BOOL b = ::SetEvent(g_hEventWorkThreadStop);
- // assert(b);
- // }
- // else if (g_bAutoUpdate && !bOldFlag)
- // {
- // BOOL b = ::ResetEvent(g_hEventWorkThreadStop);
- // assert(b && "Failed to reset event");
- //
- // const CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr();
- // const CQuotesProviders::TQuotesProviders& rapProviders = pProviders->GetProviders();
- // for(CQuotesProviders::TQuotesProviders::const_iterator i = rapProviders.begin();i != rapProviders.end();++i)
- // {
- // const CQuotesProviders::TQuotesProviderPtr& pProvider = *i;
- // g_ahThreads.push_back( mir_forkthread(WorkingThread, pProvider.get()));
- // }
- // }
- //
- // UpdateMenu(g_bAutoUpdate);
- // //ProtoBroadcastAck(QUOTES_PROTOCOL_NAME,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS,reinterpret_cast<HANDLE>(nOldStatus),g_nStatus);
- // }
- //
- // }
- //
- // return 0;
- // }
-
INT_PTR QuotesMenu_RefreshAll(WPARAM, LPARAM)
{
const CQuotesProviders::TQuotesProviders& apProviders = CModuleInfo::GetQuoteProvidersPtr()->GetProviders();
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp
index ddde8e2a73..32a5f5e84e 100644
--- a/plugins/Quotes/src/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/src/QuoteInfoDlg.cpp
@@ -273,12 +273,7 @@ namespace
{
void enable_menu(HGENMENU hMenu, bool bEnable)
{
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_FLAGS;
- if (false == bEnable)
- clmi.flags |= CMIF_GRAYED;
-
- Menu_ModifyItem(hMenu, &clmi);
+ Menu_ModifyItem(hMenu, NULL, INVALID_HANDLE_VALUE, (bEnable) ? 0 : CMIF_GRAYED);
}
}