From 88790eed4ffd9ca555c8f9b73cb014a93b57a34f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 20:38:56 +0000 Subject: Menu_ModifyItem unbound from CLISTMENUITEM structure git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_mwin.cpp | 6 ++---- plugins/Weather/src/weather_svcs.cpp | 29 ++++++----------------------- 2 files changed, 8 insertions(+), 27 deletions(-) (limited to 'plugins/Weather') diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 91eac1360a..0e7ed6998f 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -305,10 +305,8 @@ INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam) int BuildContactMenu(WPARAM wparam,LPARAM lparam) { - CLISTMENUITEM mi = { 0 }; - mi.flags = CMIM_FLAGS | - (db_get_dw((MCONTACT)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0); - Menu_ModifyItem(hMwinMenu, &mi); + int flags = db_get_dw((MCONTACT)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0; + Menu_ModifyItem(hMwinMenu, NULL, INVALID_HANDLE_VALUE, flags); return 0; } diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 689f88976a..278525c496 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -226,23 +226,16 @@ void UpdateMenu(BOOL State) opt.CAutoUpdate = State; db_set_b(NULL, WEATHERPROTONAME, "AutoUpdate", (BYTE)State); - CLISTMENUITEM mi = { 0 }; - if (State) { // to enable auto-update - mi.pszName = LPGEN("Auto Update Enabled"); - mi.icolibItem = GetIconHandle("main"); + Menu_ModifyItem(hEnableDisableMenu, LPGENT("Auto Update Enabled"), GetIconHandle("main")); opt.AutoUpdate = 1; } else { // to disable auto-update - mi.pszName = LPGEN("Auto Update Disabled"); - mi.icolibItem = GetIconHandle("disabled"); + Menu_ModifyItem(hEnableDisableMenu, LPGENT("Auto Update Disabled"), GetIconHandle("disabled")); opt.AutoUpdate = 0; } - mi.flags = CMIM_ICON | CMIM_NAME; - Menu_ModifyItem(hEnableDisableMenu, &mi); CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, !State ? TTBST_PUSHED : 0); - } void UpdatePopupMenu(BOOL State) @@ -251,20 +244,10 @@ void UpdatePopupMenu(BOOL State) opt.UsePopup = State; db_set_b(NULL, WEATHERPROTONAME, "UsePopup", (BYTE)opt.UsePopup); - CLISTMENUITEM mi = { 0 }; - if (State) - { // to enable popup - mi.pszName = LPGEN("Disable &weather notification"); - mi.icolibItem = GetIconHandle("popup"); - } - else - { // to disable popup - mi.pszName = LPGEN("Enable &weather notification"); - mi.icolibItem = GetIconHandle("nopopup"); - } - - mi.flags = CMIM_ICON | CMIM_NAME; - Menu_ModifyItem(hEnableDisablePopupMenu, &mi); + if (State) // to enable popup + Menu_ModifyItem(hEnableDisablePopupMenu, LPGENT("Disable &weather notification"), GetIconHandle("popup")); + else // to disable popup + Menu_ModifyItem(hEnableDisablePopupMenu, LPGENT("Enable &weather notification"), GetIconHandle("nopopup")); } // update the weather auto-update menu item when click on it -- cgit v1.2.3