diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-18 14:40:59 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-18 14:40:59 +0000 |
commit | beed04fd78481c085df5f0342ce546b3fdd2e544 (patch) | |
tree | 90575f2478068a5f317728fbc2f1a82884d38356 /plugins | |
parent | 98ecab59cd29c9b45026d61aa98dcfb87ef5bd2d (diff) |
yet another TTB-dependent changes
git-svn-id: http://svn.miranda-ng.org/main/trunk@473 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Alarms/alarms.cpp | 2 | ||||
-rw-r--r-- | plugins/Console/Console.c | 8 | ||||
-rw-r--r-- | plugins/ListeningTo/listeningto.cpp | 5 | ||||
-rw-r--r-- | plugins/Popup/src/main.cpp | 63 | ||||
-rw-r--r-- | plugins/RecentContacts/RecentContacts.cpp | 2 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/main.cpp | 2 | ||||
-rw-r--r-- | plugins/WhenWasIt/hooked_events.cpp | 2 |
7 files changed, 37 insertions, 47 deletions
diff --git a/plugins/Alarms/alarms.cpp b/plugins/Alarms/alarms.cpp index e63e2090fc..c0dc60bb85 100644 --- a/plugins/Alarms/alarms.cpp +++ b/plugins/Alarms/alarms.cpp @@ -207,7 +207,7 @@ static int InitTopToolbarButton(WPARAM wParam, LPARAM lParam) ttb.cbSize = sizeof(ttb);
ttb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TBUP));
ttb.hIconDn = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TBDN));
- ttb.pszServiceDown = MODULE "/NewAlarm";
+ ttb.pszService = MODULE "/NewAlarm";
ttb.dwFlags = TTBBF_VISIBLE;// | TTBBF_DRAWBORDER;
ttb.name = Translate("Set Alarm");
diff --git a/plugins/Console/Console.c b/plugins/Console/Console.c index f6c451b5dd..877dc28c30 100644 --- a/plugins/Console/Console.c +++ b/plugins/Console/Console.c @@ -150,14 +150,12 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) ttbb.cbSize = sizeof(ttbb);
ttbb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONSOLE_UP));
ttbb.hIconDn = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONSOLE_DOWN));
- ttbb.dwFlags=(state?TTBBF_PUSHED:0)|TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP;
- ttbb.pszServiceDown = "Console/Show";
- ttbb.pszServiceUp = "Console/Hide";
+ ttbb.dwFlags = (state ? TTBBF_PUSHED : 0) | TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ ttbb.pszService = "Console/Hide";
ttbb.name = Translate("Show/Hide Console");
hTTBButt = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttbb, 0);
- if (hTTBButt)
- {
+ if (hTTBButt) {
CallService(MS_TTB_SETBUTTONOPTIONS,MAKEWPARAM(TTBO_TIPNAME,hTTBButt),
(LPARAM)(state?Translate("Hide Console"):Translate("Show Console")));
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp index 0dfb23d68b..68df0a7218 100644 --- a/plugins/ListeningTo/listeningto.cpp +++ b/plugins/ListeningTo/listeningto.cpp @@ -541,7 +541,7 @@ int PreShutdown(WPARAM wParam, LPARAM lParam) DestroyHookableEvent(hEnableStateChangedEvent);
DestroyHookableEvent(hListeningInfoChangedEvent);
- int i;
+ size_t i;
for(i = 0; i < hHooks.size(); i++)
UnhookEvent(hHooks[i]);
@@ -570,8 +570,7 @@ int TopToolBarLoaded(WPARAM wParam, LPARAM lParam) ttb.cbSize = sizeof(ttb);
ttb.hIconHandleDn = hIcon2;
ttb.hIconHandleUp = hIcon1;
- ttb.pszServiceUp = MS_LISTENINGTO_TTB;
- ttb.pszServiceDown = MS_LISTENINGTO_TTB;
+ ttb.pszService = MS_LISTENINGTO_TTB;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ICONBYHANDLE | TTBBF_SHOWTOOLTIP | (enabled ? TTBBF_PUSHED : 0);
ttb.name = Translate("Enable/Disable sending Listening To info (to all protocols)");
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 268226de9c..de8ae07f58 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -188,7 +188,8 @@ static int FontsChanged(WPARAM wParam,LPARAM lParam) return 0;
}
-static int IconsChanged(WPARAM wParam,LPARAM lParam){
+static int IconsChanged(WPARAM wParam,LPARAM lParam)
+{
LoadActions();
CLISTMENUITEM mi = { 0 };
@@ -209,41 +210,32 @@ static int IconsChanged(WPARAM wParam,LPARAM lParam){ mi.hIcon = IcoLib_GetIcon(ICO_HISTORY,0);
mi.flags = CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItemHistory,(LPARAM)&mi);
-
- if (hTTButton >= 0) {
- TTBButton btn = {0};
- btn.cbSize = sizeof(btn);
- btn.pszServiceUp = btn.pszServiceDown = MENUCOMMAND_SVC;
- btn.lParamUp = 1;
- btn.lParamDown = 0;
- btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- btn.name = Translate("Toggle Popups");
- btn.tooltipUp = Translate("Popups are disabled");
- btn.tooltipDn = Translate("Popups are enabled");
- btn.hIconUp = IcoLib_GetIcon(ICO_POPUP_OFF,0);
- btn.hIconDn = IcoLib_GetIcon(ICO_POPUP_ON,0);
- hTTButton = CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_ALLDATA, hTTButton), (LPARAM)&btn);
- }
-
return 0;
}
-static int TTBLoaded(WPARAM wParam,LPARAM lParam){
- if (hTTButton < 0) {
- TTBButton btn = {0};
- btn.cbSize = sizeof(btn);
- btn.pszServiceUp = btn.pszServiceDown = MENUCOMMAND_SVC;
- btn.lParamUp = 1;
- btn.lParamDown = 0;
- btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- btn.name = Translate("Toggle Popups");
- btn.tooltipUp = Translate("Popups are disabled");
- btn.tooltipDn = Translate("Popups are enabled");
- btn.hIconUp = IcoLib_GetIcon(ICO_POPUP_OFF,0);
- btn.hIconDn = IcoLib_GetIcon(ICO_POPUP_ON,0);
+static int TTBLoaded(WPARAM wParam,LPARAM lParam)
+{
+ if (hTTButton == -1) {
+ TTBButton btn = {0};
+ btn.cbSize = sizeof(btn);
+ btn.pszService = MENUCOMMAND_SVC;
+ btn.lParamUp = 1;
+ btn.lParamDown = 0;
+ btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ btn.name = "Toggle Popups";
+ btn.hIconUp = IcoLib_GetIcon(ICO_POPUP_OFF,0);
+ btn.hIconDn = IcoLib_GetIcon(ICO_POPUP_ON,0);
hTTButton = CallService(MS_TTB_ADDBUTTON, (WPARAM)&btn, 0);
}
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, PopUpOptions.ModuleIsEnabled?TTBST_RELEASED:TTBST_PUSHED);
+
+ if (PopUpOptions.ModuleIsEnabled) {
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, TTBST_RELEASED);
+ CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_TIPNAME,hTTButton), (LPARAM)LPGEN("Disable popups"));
+ }
+ else {
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, TTBST_PUSHED);
+ CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_TIPNAME,hTTButton), (LPARAM)LPGEN("Enable popups"));
+ }
return 0;
}
@@ -275,15 +267,16 @@ INT_PTR svcEnableDisableMenuCommand(WPARAM wp, LPARAM lp) CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
- if (PopUpOptions.ModuleIsEnabled)
- { //The module is enabled.
+ if (PopUpOptions.ModuleIsEnabled) {
+ //The module is enabled.
//The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
PopUpOptions.ModuleIsEnabled = FALSE;
DBWriteContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", FALSE);
mi.ptszName = LPGENT("Enable &popup module");
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF,0);
- } else
- { //The module is disabled.
+ }
+ else {
+ //The module is disabled.
//The action to do is enable popups (show enabled), then write "disable popup" in the new item.
PopUpOptions.ModuleIsEnabled = TRUE;
DBWriteContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", TRUE);
diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp index 8e0d13cd5d..3e43af0daa 100644 --- a/plugins/RecentContacts/RecentContacts.cpp +++ b/plugins/RecentContacts/RecentContacts.cpp @@ -462,7 +462,7 @@ int Create_TopToolbarShowList(WPARAM wParam, LPARAM lParam) TTBButton ttbb = { 0 };
ttbb.cbSize = sizeof(ttbb);
ttbb.hIconHandleDn = ttbb.hIconHandleDn = hIcon;
- ttbb.pszServiceUp = ttbb.pszServiceDown = msLastUC_ShowList;
+ ttbb.pszService = msLastUC_ShowList;
ttbb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP|TTBBF_DRAWBORDER;
ttbb.name = Translate(msLastUC_ShowListName);
diff --git a/plugins/SimpleStatusMsg/main.cpp b/plugins/SimpleStatusMsg/main.cpp index 59f27d9920..f2d3e16613 100644 --- a/plugins/SimpleStatusMsg/main.cpp +++ b/plugins/SimpleStatusMsg/main.cpp @@ -1604,7 +1604,7 @@ static int AddTopToolbarButton(WPARAM wParam, LPARAM lParam) ttbb.cbSize = sizeof(ttbb);
ttbb.hIconUp = ttbb.hIconDn = LoadIconEx("csmsg");
- ttbb.pszServiceUp = ttbb.pszServiceDown = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
+ ttbb.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
ttbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttbb.name = Translate("Change Status Message");
hTTBButton = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttbb, 0);
diff --git a/plugins/WhenWasIt/hooked_events.cpp b/plugins/WhenWasIt/hooked_events.cpp index e8dc2775a6..94c0e674dd 100644 --- a/plugins/WhenWasIt/hooked_events.cpp +++ b/plugins/WhenWasIt/hooked_events.cpp @@ -180,7 +180,7 @@ int OnTopToolBarModuleLoaded(WPARAM wParam, LPARAM lParam) TTBButton ttb = {0};
ttb.cbSize = sizeof(TTBButton);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- ttb.pszServiceDown = MS_WWI_CHECK_BIRTHDAYS;
+ ttb.pszService = MS_WWI_CHECK_BIRTHDAYS;
ttb.hIconUp = ttb.hIconDn = hiCheckMenu;
ttb.name = "Check for birthdays";
CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
|