diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-14 15:51:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-14 15:51:34 +0000 |
commit | e58823d961a630eb62e60d2ccb443761ba5f1704 (patch) | |
tree | 62d071be480d57af2a53f154a1468abe0b9449ff /plugins/Updater | |
parent | 721aea0764451e985d575236205808bbef298244 (diff) |
- all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs.
- massive cleanup of the menu-related code
git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Updater')
-rw-r--r-- | plugins/Updater/common.h | 1 | ||||
-rw-r--r-- | plugins/Updater/options.cpp | 42 | ||||
-rw-r--r-- | plugins/Updater/services.cpp | 26 |
3 files changed, 34 insertions, 35 deletions
diff --git a/plugins/Updater/common.h b/plugins/Updater/common.h index b1a070f78e..d51a1db85b 100644 --- a/plugins/Updater/common.h +++ b/plugins/Updater/common.h @@ -27,6 +27,7 @@ #include <m_netlib.h>
#include <m_utils.h>
#include <m_clist.h>
+#include <m_genmenu.h>
#include <m_icoLib.h>
#include <win2k.h>
diff --git a/plugins/Updater/options.cpp b/plugins/Updater/options.cpp index 22ace012a6..7539ce2047 100644 --- a/plugins/Updater/options.cpp +++ b/plugins/Updater/options.cpp @@ -9,30 +9,28 @@ HWND hwndOptions; HANDLE hMainMenuItemRestart, hMainMenuItemUpdateAndExit;
HANDLE hBackupPath, hDataPath, hArchivePath;
-void add_restart_menu_item() {
- CLISTMENUITEM menu = {0};
-
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
- menu.icolibItem = GetIconHandle(I_RSTRT);
-
- menu.pszName = "Restart";
- menu.pszService= MS_UPDATE_MENURESTART;
- menu.position = 2000099900;
- hMainMenuItemRestart = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+void add_restart_menu_item()
+{
+ CLISTMENUITEM mi = {0};
+ mi.cbSize=sizeof(mi);
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = GetIconHandle(I_RSTRT);
+ mi.pszName = "Restart";
+ mi.pszService= MS_UPDATE_MENURESTART;
+ mi.position = 2000099900;
+ hMainMenuItemRestart = Menu_AddMainMenuItem(&mi);
}
-void add_update_and_exit_menu_item() {
- CLISTMENUITEM menu = {0};
-
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
- menu.icolibItem = GetIconHandle(I_CHKUPDEXT);
-
- menu.pszName = "Update and Exit";
- menu.pszService= MS_UPDATE_MENUUPDATEANDEXIT;
- menu.position = 2000099901;
- hMainMenuItemUpdateAndExit = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+void add_update_and_exit_menu_item()
+{
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = GetIconHandle(I_CHKUPDEXT);
+ mi.pszName = "Update and Exit";
+ mi.pszService = MS_UPDATE_MENUUPDATEANDEXIT;
+ mi.position = 2000099901;
+ hMainMenuItemUpdateAndExit = Menu_AddMainMenuItem(&mi);
}
void remove_restart_menu_item() {
diff --git a/plugins/Updater/services.cpp b/plugins/Updater/services.cpp index 8d3883b895..3b11ddf850 100644 --- a/plugins/Updater/services.cpp +++ b/plugins/Updater/services.cpp @@ -788,26 +788,26 @@ VOID CALLBACK StartupTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwT HANDLE hEventServicesModulesLoaded2;
-int ServicesModulesLoaded(WPARAM wParam, LPARAM lParam) {
+int ServicesModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
// add main menu item
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = {0};
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
- menu.icolibItem = GetIconHandle(I_CHKUPD);
+ mi.cbSize=sizeof(mi);
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = GetIconHandle(I_CHKUPD);
- menu.pszName = "Check for updates";
- menu.pszService= MS_UPDATE_CHECKFORUPDATES;
- menu.position = 500010000;
+ mi.pszName = "Check for updates";
+ mi.pszService= MS_UPDATE_CHECKFORUPDATES;
+ mi.position = 500010000;
-#ifdef MS_CLIST_ADDGROUPMENUITEM
- if (ServiceExists(MS_CLIST_ADDGROUPMENUITEM)) {
+ if (ServiceExists(MS_CLIST_REMOVEGROUPMENUITEM)) {
GroupMenuParam gmp = {0};
- hGroupMenuItem = (HANDLE)CallService(MS_CLIST_ADDGROUPMENUITEM,(WPARAM)&gmp,(LPARAM)&menu);
+ hGroupMenuItem = Menu_AddGroupMenuItem(&gmp, &mi);
}
-#endif
- hMainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+
+ hMainMenuItem = Menu_AddMainMenuItem(&mi);
hEventServicesModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ServicesModulesLoaded2);
startup_timer_id = SetTimer(0, 0, 5000, StartupTimerProc);
|