summaryrefslogtreecommitdiff
path: root/plugins/Ping
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
commit30707c980d1560b358dbf2671a4d2a26a1e8173c (patch)
tree74aee5adaaac976e1398274ca64c5461a60f1feb /plugins/Ping
parent335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (diff)
various menu initialization quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Ping')
-rw-r--r--plugins/Ping/src/menu.cpp109
-rw-r--r--plugins/Ping/src/pingthread.cpp4
2 files changed, 20 insertions, 93 deletions
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp
index dbec0a3447..29b3d24696 100644
--- a/plugins/Ping/src/menu.cpp
+++ b/plugins/Ping/src/menu.cpp
@@ -4,95 +4,24 @@
HANDLE hMenuDisable, hMenuGraph, hMenuEdit;
HANDLE hEventMenuBuild;
-/*
-int MenuBuild(WPARAM wParam, LPARAM lParam) {
- CLISTMENUITEM menu;
- ZeroMemory(&menu,sizeof(menu));
- menu.cbSize=sizeof(menu);
-
- menu.flags = CMIM_NAME | CMIM_ICON;
- bool disable = DBGetContactSettingWord((HANDLE)wParam, PLUG, "Status", ID_STATUS_OFFLINE) != options.off_status;
- if(disable) {
- menu.hIcon = hIconDisabled;
- menu.pszName = Translate("Disable");
- } else {
- menu.hIcon = hIconEnabled;
- menu.pszName = Translate("Enable");
- }
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDisable, (LPARAM)&menu);
-
- // hide graph menu item if window displayed
- //menu.flags = CMIM_FLAGS | (DBGetContactSettingDword((HANDLE)wParam, PLUG, "WindowHandle", 0) == 0 ? 0 : CMIF_HIDDEN);
- //CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuGraph, (LPARAM)&menu);
-
- return 0;
-}
-*/
-
-void InitMenus() {
-
- CLISTMENUITEM menu;
- ZeroMemory(&menu,sizeof(menu));
- menu.cbSize=sizeof(menu);
-
+void InitMenus()
+{
// main menu
- menu.flags = CMIF_TCHAR;
- menu.popupPosition = 500099900;
- menu.ptszPopupName = LPGENT("PING");
- menu.cbSize = sizeof( menu );
- menu.position = 2000060000;
- menu.hIcon = hIconResponding;
- menu.ptszName = LPGENT("Enable All Pings");
- menu.pszService = PLUG "/EnableAll";
- Menu_AddMainMenuItem(&menu);
-
- menu.popupPosition = 500299901;
- menu.cbSize = sizeof( menu );
- menu.position = 2000060001;
- menu.popupPosition = 0;
- menu.hIcon = hIconDisabled;
- menu.ptszName = LPGENT("Disable All Pings");
- menu.pszService = PLUG "/DisableAll";
- Menu_AddMainMenuItem(&menu);
-
- /*
- // list items
- menu.flags = 0;
- menu.popupPosition = 0;
- menu.pszPopupName = 0;
- menu.cbSize = sizeof( menu );
- menu.position =-300100;
- //menu.popupPosition = 0;
- menu.hIcon = hIconDisabled;
- menu.pszName = Translate( "Disable" );
- menu.pszService = PLUG "/ToggleEnabled";
- menu.pszContactOwner = PLUG;
- hMenuDisable = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
-
- menu.flags = 0;
- menu.popupPosition = 0;
- menu.pszPopupName = 0;
- menu.cbSize = sizeof( menu );
- menu.position =-300090;
- //menu.popupPosition = 0;
- menu.hIcon = hIconResponding
- menu.pszName = Translate( "Graph" );
- menu.pszService = PLUG "/ShowGraph";
- menu.pszContactOwner = PLUG;
- hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
-
- menu.flags = 0;
- menu.popupPosition = 0;
- menu.pszPopupName = 0;
- menu.cbSize = sizeof( menu );
- menu.position =-300080;
- //menu.popupPosition = 0;
- menu.hIcon = hIconResponding;
- menu.pszName = Translate( "Edit..." );
- menu.pszService = PLUG "/Edit";
- menu.pszContactOwner = PLUG;
- hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu );
-
- hEventMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MenuBuild);
- */
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_TCHAR;
+ mi.popupPosition = 500099900;
+ mi.ptszPopupName = LPGENT("PING");
+ mi.position = 2000060000;
+ mi.hIcon = hIconResponding;
+ mi.ptszName = LPGENT("Enable All Pings");
+ mi.pszService = PLUG "/EnableAll";
+ Menu_AddMainMenuItem(&mi);
+
+ mi.popupPosition = 500299901;
+ mi.position = 2000060001;
+ mi.popupPosition = 0;
+ mi.hIcon = hIconDisabled;
+ mi.ptszName = LPGENT("Disable All Pings");
+ mi.pszService = PLUG "/DisableAll";
+ Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index 5db0f4322e..a5b2034e3f 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -1015,12 +1015,10 @@ void InitList() {
CreateServiceFunction(PLUG "/ShowWindow", PingPlugShowWindow);
- CLISTMENUITEM mi = {0};
-
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
mi.popupPosition = 1000200001;
mi.ptszPopupName = LPGENT( "Ping" );
- mi.cbSize = sizeof( mi );
mi.position = 3000320001;
mi.hIcon = 0;//LoadIcon( hInst, 0);
mi.ptszName = LPGENT( "Show/Hide &Ping Window" );