From 696f4ea57845f48d6d979ecd9d66bb22bd9f738d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 8 Jul 2012 20:51:14 +0000 Subject: TopToolbar usage fixed everywhere git-svn-id: http://svn.miranda-ng.org/main/trunk@861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StatusPlugins/StartupStatus/options.cpp | 2 +- plugins/StatusPlugins/StartupStatus/profiles.cpp | 9 +-- .../StatusPlugins/StartupStatus/startupstatus.h | 5 +- plugins/StatusPlugins/StartupStatus/toolbars.cpp | 83 ++-------------------- 4 files changed, 10 insertions(+), 89 deletions(-) (limited to 'plugins/StatusPlugins') diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index e1e9f0dbbe..2a712bbe87 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -569,7 +569,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP } arProfiles.insert(ppo); } - if ( !ServiceExists( MS_TTB_ADDBUTTON ) && !ServiceExists( MS_TB_ADDBUTTON )) + if (hTTBModuleLoadedHook) EnableWindow(GetDlgItem(hwndDlg, IDC_CREATETTB), FALSE); SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 3d93f1b37d..c1235b848d 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -274,7 +274,7 @@ INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam) CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&profileSettings, (LPARAM)DBGetContactSettingDword(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5)); } - if ( ServiceExists( MS_TTB_ADDBUTTON ) || ServiceExists( MS_TB_ADDBUTTON )) + if (hTTBModuleLoadedHook) // add timer here releaseTtbTimerId = SetTimer(NULL, 0, 100, releaseTtbTimerFunction); @@ -361,11 +361,7 @@ static int UnregisterHotKeys() int LoadMainOptions() { - if (ServiceExists(MS_TTB_ADDBUTTON)) { - RemoveTopToolbarButtons(); - CreateTopToolbarButtons(0,0); - } - if (ServiceExists(MS_TTB_ADDBUTTON)) { + if (hTTBModuleLoadedHook) { RemoveTopToolbarButtons(); CreateTopToolbarButtons(0,0); } @@ -385,7 +381,6 @@ int LoadProfileModule() int InitProfileModule() { hTTBModuleLoadedHook = HookEvent(ME_TTB_MODULELOADED, CreateTopToolbarButtons); - hTBModuleLoadedHook = HookEvent(ME_TB_MODULELOADED, CreateToolbarButtons); hPrebuildProfilesMenu = HookEvent( ME_CLIST_PREBUILDSTATUSMENU, CreateMainMenuItems); CreateMainMenuItems(0,0); diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h index b7681952c9..02d8e36c41 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.h +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.h @@ -25,7 +25,6 @@ #include #include #include -#include #include "version.h" #define MODULENAME "StartupStatus" @@ -159,11 +158,9 @@ INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam); INT_PTR GetProfileCount(WPARAM wParam, LPARAM lParam); INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam); +extern HANDLE hTTBModuleLoadedHook; int RemoveTopToolbarButtons(); int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam); - -int RemoveToolbarButtons(); -int CreateToolbarButtons(WPARAM wParam, LPARAM lParam); void RegisterButtons(); int LoadProfileModule(); diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index 175615df6b..a135ee1a23 100644 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp @@ -34,11 +34,11 @@ static int ttbButtonCount = 0; int RemoveTopToolbarButtons() { - int profileCount, i, orgButtonCount; + int profileCount, orgButtonCount; profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0); orgButtonCount = ttbButtonCount; - for (i=0;i 0) - ttbButtons = ( HANDLE* )realloc(ttbButtons, ttbButtonCount*sizeof(HANDLE)); - else { - free(ttbButtons); - ttbButtons = NULL; - } - - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - void RegisterButtons() { TCHAR szFile[MAX_PATH]; -- cgit v1.2.3