diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-08 20:51:14 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-08 20:51:14 +0000 |
commit | 696f4ea57845f48d6d979ecd9d66bb22bd9f738d (patch) | |
tree | c32ac05d363bff47320c1b204561b966aa1c81fd /protocols/YAMN | |
parent | 3b396a2da6b0b8e0f4d2c051aca133772d317820 (diff) |
TopToolbar usage fixed everywhere
git-svn-id: http://svn.miranda-ng.org/main/trunk@861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/YAMN')
-rw-r--r-- | protocols/YAMN/main.cpp | 2 | ||||
-rw-r--r-- | protocols/YAMN/services.cpp | 31 | ||||
-rw-r--r-- | protocols/YAMN/yamn.cpp | 3 | ||||
-rw-r--r-- | protocols/YAMN/yamn.h | 3 |
4 files changed, 10 insertions, 29 deletions
diff --git a/protocols/YAMN/main.cpp b/protocols/YAMN/main.cpp index 267d0db355..978a2fa233 100644 --- a/protocols/YAMN/main.cpp +++ b/protocols/YAMN/main.cpp @@ -53,7 +53,7 @@ PLUGININFOEX pluginInfo = { HANDLE hNewMailHook;
HANDLE NoWriterEV;
-HANDLE hTTButton, hTButton;
+HANDLE hTTButton;
UINT SecTimer;
diff --git a/protocols/YAMN/services.cpp b/protocols/YAMN/services.cpp index 48e38ea4d4..616b6ce9a9 100644 --- a/protocols/YAMN/services.cpp +++ b/protocols/YAMN/services.cpp @@ -308,40 +308,24 @@ HBITMAP LoadBmpFromIcon(HICON hIcon) int AddTopToolbarIcon(WPARAM,LPARAM)
{
if ( DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1)) {
- if ( ServiceExists(MS_TTB_ADDBUTTON) && hTTButton == NULL) {
+ if ( ServiceExists(MS_TTB_REMOVEBUTTON) && hTTButton == NULL) {
TTBButton btn = { 0 };
- btn.cbSize = sizeof(TTBButton);
+ btn.cbSize = sizeof(btn);
btn.pszService = MS_YAMN_FORCECHECK;
btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | TTBBF_ICONBYHANDLE;
- btn.name = Translate("Check mail");
+ btn.name = "Check mail";
btn.hIconHandleUp = g_GetIconHandle(5);
btn.hIconHandleDn = g_GetIconHandle(6);
- hTTButton = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&btn, 0);
- CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM((WORD)TTBO_TIPNAME, (WORD)hTTButton), (LPARAM)Translate("Check mail"));
- }
- if ( ServiceExists(MS_TB_ADDBUTTON) && hTButton == NULL) {
- TBButton btn = { 0 };
- btn.cbSize = sizeof(TBButton);
- btn.pszServiceName = MS_YAMN_FORCECHECK;
- btn.tbbFlags = TBBF_VISIBLE | TBBF_SHOWTOOLTIP;
- btn.defPos = 10114;
- btn.pszButtonID = "yamn_btn";
- btn.pszButtonName = "Check mail";
- btn.hPrimaryIconHandle = g_GetIconHandle(5);
- btn.hSecondaryIconHandle = g_GetIconHandle(6);
btn.pszTooltipDn = btn.pszTooltipUp = "Check mail";
- hTButton = (HANDLE)CallService(MS_TB_ADDBUTTON, 0, (WPARAM)&btn);
+ hTTButton = TopToolbar_AddButton(&btn);
}
}
else {
- if (ServiceExists(MS_TTB_ADDBUTTON) && hTTButton != NULL) {
+ if (hTTButton != NULL) {
CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hTTButton, 0);
hTTButton = NULL;
}
- if (ServiceExists(MS_TB_ADDBUTTON) && hTButton != NULL) {
- CallService(MS_TB_REMOVEBUTTON, (WPARAM)hTButton, 0);
- hTButton = NULL;
- } }
+ }
return 0;
}
@@ -369,8 +353,7 @@ int SystemModulesLoaded(WPARAM, LPARAM); //in main.cpp typedef struct { HANDLE hookHandle; const char *hookName; MIRANDAHOOK mirandaFunction;} HookDataType;
static HookDataType hookData[] = {
{0, ME_SYSTEM_MODULESLOADED, SystemModulesLoaded}, //pop3 plugin must be included after all miranda modules are loaded
- {0, ME_TB_MODULELOADED, AddTopToolbarIcon},
- {0, ME_TTB_MODULELOADED, AddTopToolbarIcon},
+ {0, ME_TTB_MODULELOADED, AddTopToolbarIcon},
{0, ME_OPT_INITIALISE, YAMNOptInitSvc},
{0, ME_SYSTEM_PRESHUTDOWN, Shutdown},
{0, ME_CLIST_DOUBLECLICKED, Service_ContactDoubleclicked},
diff --git a/protocols/YAMN/yamn.cpp b/protocols/YAMN/yamn.cpp index c1ffda847a..c93225e609 100644 --- a/protocols/YAMN/yamn.cpp +++ b/protocols/YAMN/yamn.cpp @@ -328,7 +328,6 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM) LeaveCriticalSection(&PluginRegCS);
CloseHandle(ThreadRunningEV);
- if ( hTTButton ) CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, TTBST_RELEASED);
- if ( hTButton ) CallService(MS_TB_SETBUTTONSTATE, (WPARAM)hTButton, TBST_RELEASED);
+ if (hTTButton) CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, TTBST_RELEASED);
return 1;
}
diff --git a/protocols/YAMN/yamn.h b/protocols/YAMN/yamn.h index 4bb8d149e4..8cec3eda86 100644 --- a/protocols/YAMN/yamn.h +++ b/protocols/YAMN/yamn.h @@ -32,7 +32,6 @@ #include "m_protomod.h" //protocols module
#include "m_protosvc.h"
#include "m_toptoolbar.h"
-#include "m_toolbar.h"
#include "m_icolib.h"
#include "m_kbdnotify.h"
#include "m_popup.h"
@@ -190,7 +189,7 @@ extern CRITICAL_SECTION PluginRegCS; extern YAMN_VARIABLES YAMNVar;
extern HANDLE hNewMailHook;
extern HANDLE WriteToFileEV;
-extern HANDLE hTTButton, hTButton;
+extern HANDLE hTTButton;
extern HCURSOR hCurSplitNS, hCurSplitWE;
extern UINT SecTimer;
|