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/services.cpp | |
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/services.cpp')
-rw-r--r-- | protocols/YAMN/services.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
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},
|