summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-01 10:56:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-01 10:56:58 +0000
commit95dccf315ba175eaf848fd6d85af6eb306a7482f (patch)
tree0e5d65712a914566cf76370c78ae256bd744218e /plugins
parent1fba79d0cd33719c33a431b0c6ecd4b169acd4d5 (diff)
duplicate code removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@17235 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/init.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h2
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_keyboard.cpp6
-rw-r--r--plugins/Clist_nicer/src/clui.cpp17
-rw-r--r--plugins/ExternalAPI/m_skin_eng.h4
-rw-r--r--plugins/TopToolBar/src/InternalButtons.cpp20
8 files changed, 9 insertions, 51 deletions
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 72b297c2bc..4e76e461f3 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -112,7 +112,6 @@ extern "C" __declspec(dllexport) int Unload(void)
XPThemesUnloadModule();
UnloadAvatarOverlayIcon();
- UninitSkinHotKeys();
FreeRowCell();
EventArea_UnloadModule();
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index bc23afacfe..d1786bb6a3 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -171,8 +171,6 @@ HRESULT CluiLoadModule()
HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
CreateServiceFunction(MS_CLIST_TOGGLEHIDEOFFLINE, ToggleHideOffline);
-
- CreateServiceFunction(MS_CLIST_TOGGLEGROUPS, ToggleGroups);
CreateServiceFunction(MS_CLIST_TOGGLESOUNDS, ToggleSounds);
CreateServiceFunction(MS_CLIST_SETUSEGROUPS, SetUseGroups);
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index b267c906b5..610778758a 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -200,7 +200,6 @@ int RestoreAllContactData(ClcData *dat); //c
int SkinSelector_DeleteMask(MODERNMASK *mm); //mod_skin_selector.c
int StoreAllContactData(ClcData *dat); //cache_func.c
INT_PTR ToggleHideOffline(WPARAM wParam, LPARAM lParam); //contact.c
-INT_PTR ToggleGroups(WPARAM wParam, LPARAM lParam); //contact.c
INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam); //contact.c
INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam); //contact.c
void ClcOptionsChanged(); //clc.c
@@ -220,7 +219,6 @@ void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *sz
int ExtraImage_ExtraIDToColumnNum(int extra);
int LoadSkinButtonModule();
-void UninitSkinHotKeys();
void GetDefaultFontSetting(int i, LOGFONTA *lf, COLORREF *colour);
int CLUI_OnSkinLoad(WPARAM wParam, LPARAM lParam);
HRESULT CluiLoadModule();
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index 6d6d5698e0..47ffcfc574 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -158,14 +158,6 @@ INT_PTR ToggleHideOffline(WPARAM, LPARAM)
return pcli->pfnSetHideOffline(-1);
}
-INT_PTR ToggleGroups(WPARAM, LPARAM)
-{
- db_set_b(NULL, "CList", "UseGroups",
- (BYTE)!db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
- pcli->pfnLoadContactTree();
- return 0;
-}
-
INT_PTR SetUseGroups(WPARAM wParam, LPARAM)
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
diff --git a/plugins/Clist_modern/src/modern_keyboard.cpp b/plugins/Clist_modern/src/modern_keyboard.cpp
index 174efbed7f..77707dc3ec 100644
--- a/plugins/Clist_modern/src/modern_keyboard.cpp
+++ b/plugins/Clist_modern/src/modern_keyboard.cpp
@@ -66,11 +66,5 @@ int InitSkinHotKeys(void)
shk.pwszSection = LPGENW("Main");
shk.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
Hotkey_Register(&shk);
-
-
return 0;
}
-
-void UninitSkinHotKeys(void)
-{
-}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 5cde52aab1..a73e090873 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -1501,25 +1501,16 @@ buttons_done:
CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)(-1), 0);
break;
case POPUP_HIDEOFFLINEROOT:
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT, !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0), 0);
+ CallService(MS_CLIST_TOGGLEHIDEOFFLINEROOT, 0, 0);
break;
case POPUP_HIDEEMPTYGROUPS:
- {
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
- }
+ CallService(MS_CLIST_TOGGLEEMPTYGROUPS, 0, 0);
break;
case IDC_TBHIDEGROUPS:
case IDC_STBHIDEGROUPS:
case POPUP_DISABLEGROUPS:
- {
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
- ClcSetButtonState(IDC_TBHIDEGROUPS, newVal);
- SetButtonStates();
- }
+ ClcSetButtonState(IDC_TBHIDEGROUPS, CallService(MS_CLIST_TOGGLEGROUPS, 0, 0));
+ SetButtonStates();
break;
case POPUP_HIDEMIRANDA:
pcli->pfnShowHide(0, 0);
diff --git a/plugins/ExternalAPI/m_skin_eng.h b/plugins/ExternalAPI/m_skin_eng.h
index a1b8b6cf55..e7241a9447 100644
--- a/plugins/ExternalAPI/m_skin_eng.h
+++ b/plugins/ExternalAPI/m_skin_eng.h
@@ -67,12 +67,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*SERVICES*/
//toggle the 'hide offline contacts' flag and call CLUI
-//wParam=0
-//lParam=0
#define MS_CLIST_TOGGLEHIDEOFFLINE "CList/ToggleHideOffline"
-#define MS_CLIST_TOGGLEGROUPS "CList/ToggleGroups"
-
#define MS_CLIST_TOGGLESOUNDS "CList/ToggleSounds"
// Add new object to skin object list.
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp
index 8bf37c6d23..dbc1b811dd 100644
--- a/plugins/TopToolBar/src/InternalButtons.cpp
+++ b/plugins/TopToolBar/src/InternalButtons.cpp
@@ -1,11 +1,10 @@
#include "stdafx.h"
-#define TTBI_GROUPSHOWHIDE "TTBInternal/GroupShowHide"
-#define TTBI_SOUNDSONOFF "TTBInternal/SoundsOnOFF"
-#define TTBI_MAINMENUBUTT "TTBInternal/MainMenuBUTT"
-#define TTBI_STATUSMENUBUTT "TTBInternal/StatusMenuButt"
-#define TTBI_SHOWHIDEOFFLINE "TTBInternal/ShowHideOffline"
+#define TTBI_SOUNDSONOFF "TTBInternal/SoundsOnOFF"
+#define TTBI_MAINMENUBUTT "TTBInternal/MainMenuBUTT"
+#define TTBI_STATUSMENUBUTT "TTBInternal/StatusMenuButt"
+#define TTBI_SHOWHIDEOFFLINE "TTBInternal/ShowHideOffline"
#define INDEX_OFFLINE 5
#define INDEX_META 6
@@ -29,7 +28,7 @@ static stdButtons[] = {
{ LPGEN("Show status menu"), TTBI_STATUSMENUBUTT, SKINICON_OTHER_STATUS, 0, LPGEN("Show status menu"), NULL, 0, 0 },
{ LPGEN("Show/hide offline contacts"), TTBI_SHOWHIDEOFFLINE, IDI_HIDEOFFLINE, IDI_SHOWOFFLINE, LPGEN("Hide offline contacts"), LPGEN("Show offline contacts"), 1, 1 },
{ LPGEN("Enable/disable metacontacts"), "MetaContacts/OnOff", IDI_METAOFF, IDI_METAON, LPGEN("Disable metacontacts"), LPGEN("Enable metacontacts"), 1, 1 },
- { LPGEN("Enable/disable groups"), TTBI_GROUPSHOWHIDE, IDI_GROUPSOFF, IDI_GROUPSON, LPGEN("Enable groups"), LPGEN("Disable groups"), 1, 1 },
+ { LPGEN("Enable/disable groups"), MS_CLIST_TOGGLEGROUPS, IDI_GROUPSOFF, IDI_GROUPSON, LPGEN("Enable groups"), LPGEN("Disable groups"), 1, 1 },
{ LPGEN("Enable/disable sounds"), TTBI_SOUNDSONOFF, IDI_SOUNDSOFF, IDI_SOUNDSON, LPGEN("Disable sounds"), LPGEN("Enable sounds"), 1, 1 },
{ LPGEN("Minimize contact list"), MS_CLIST_SHOWHIDE, SKINICON_OTHER_SHOWHIDE, 0, LPGEN("Minimize contact list"), NULL, 0, 1 },
{ LPGEN("Exit"), "CloseAction", SKINICON_OTHER_EXIT, 0, LPGEN("Exit"), NULL, 0, 0 }
@@ -77,14 +76,6 @@ INT_PTR TTBInternalStatusMenuButt(WPARAM, LPARAM)
return 0;
}
-INT_PTR TTBInternalGroupShowHide(WPARAM, LPARAM)
-{
- int newVal = !(GetWindowLongPtr(hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
- return 0;
-}
-
INT_PTR TTBInternalSoundsOnOff(WPARAM, LPARAM)
{
int newVal = !(db_get_b(NULL, "Skin", "UseSound", 1));
@@ -104,7 +95,6 @@ void InitInternalButtons()
{
hwndContactTree = pcli->hwndContactTree;
- CreateServiceFunction(TTBI_GROUPSHOWHIDE, TTBInternalGroupShowHide);
CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
CreateServiceFunction(TTBI_STATUSMENUBUTT, TTBInternalStatusMenuButt);