summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-01 12:48:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-01 12:48:54 +0000
commit11ab7716e9d48c7505fbcf4fe1deba33b494cdc1 (patch)
tree795bb05caa502ed8e1f4fc7064563e112b077197 /plugins
parentecfe7288fee11443d9a0f48ca38daa2aabf955c5 (diff)
- MS_CLIST_SETHIDEOFFLINE replaced with pcli->pfnSetHideOffline();
- MS_CLIST_TOGGLEHIDEOFFLINE added to cover the only case with service call; git-svn-id: http://svn.miranda-ng.org/main/trunk@17237 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp6
-rw-r--r--plugins/Clist_nicer/src/clui.cpp4
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp4
-rw-r--r--plugins/TopToolBar/src/InternalButtons.cpp10
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp45
6 files changed, 31 insertions, 52 deletions
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index a545ba2928..5859cbd7eb 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -72,8 +72,8 @@ RECT g_rcEdgeSizingRect = { 0 };
/* Module global variables */
static BYTE bAlphaEnd;
-static BYTE bOldHideOffline;
-static BYTE bOldUseGroups;
+static int bOldHideOffline;
+static int bOldUseGroups;
static WORD wBehindEdgeShowDelay,
wBehindEdgeHideDelay,
@@ -423,14 +423,8 @@ HRESULT CLUI::CreateCLC()
nLastRequiredHeight = 0;
if (g_CluiData.current_viewmode[0] == '\0') {
- if (bOldHideOffline != (BYTE)-1)
- CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)bOldHideOffline, 0);
- else
- CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
- if (bOldUseGroups != (BYTE)-1)
- CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)bOldUseGroups, 0);
- else
- CallService(MS_CLIST_SETUSEGROUPS, 0, 0);
+ pcli->pfnSetHideOffline((bOldHideOffline == -1) ? false : bOldHideOffline);
+ CallService(MS_CLIST_SETUSEGROUPS, (bOldUseGroups == -1) ? false : bOldUseGroups, 0);
}
nLastRequiredHeight = 0;
mutex_bDisableAutoUpdate = 0;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index adb51b8167..0858bcbe5f 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -1246,7 +1246,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
SetDlgItemText(g_hwndViewModeFrame, IDC_SELECTMODE, TranslateT("All contacts"));
if (g_CluiData.boldHideOffline != (BYTE)-1)
- CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)g_CluiData.boldHideOffline, 0);
+ pcli->pfnSetHideOffline(g_CluiData.boldHideOffline);
if (g_CluiData.bOldUseGroups != (BYTE)-1)
CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
g_CluiData.boldHideOffline = (BYTE)-1;
@@ -1334,10 +1334,10 @@ void ApplyViewMode(const char *Name, bool onlySelector)
if (g_CluiData.boldHideOffline == (BYTE)-1)
g_CluiData.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
+ pcli->pfnSetHideOffline(false);
}
else if (g_CluiData.boldHideOffline != (BYTE)-1) {
- CallService(MS_CLIST_SETHIDEOFFLINE, g_CluiData.boldHideOffline, 0);
+ pcli->pfnSetHideOffline(g_CluiData.boldHideOffline);
g_CluiData.boldHideOffline = -1;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index a73e090873..f99c10ca7f 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -176,7 +176,7 @@ static HWND PreCreateCLC(HWND parent)
static int CreateCLC()
{
pcli->pfnReloadExtraIcons();
- CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)oldhideoffline, 0);
+ pcli->pfnSetHideOffline(oldhideoffline);
disableautoupd = 0;
{
CLISTFrame frame = { 0 };
@@ -1498,7 +1498,7 @@ buttons_done:
case POPUP_HIDEOFFLINE:
case IDC_TBHIDEOFFLINE:
case IDC_STBHIDEOFFLINE:
- CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)(-1), 0);
+ pcli->pfnSetHideOffline(-1);
break;
case POPUP_HIDEOFFLINEROOT:
CallService(MS_CLIST_TOGGLEHIDEOFFLINEROOT, 0, 0);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index b1ca3a8640..313c8065d2 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -971,7 +971,7 @@ clvm_reset_command:
cfg::dat.bFilterEffective = 0;
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetDlgItemText(hwnd, IDC_SELECTMODE, TranslateT("No view mode"));
- CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)cfg::dat.boldHideOffline, 0);
+ pcli->pfnSetHideOffline(cfg::dat.boldHideOffline);
cfg::dat.boldHideOffline = (BYTE)-1;
SetButtonStates();
cfg::dat.current_viewmode[0] = 0;
@@ -1112,7 +1112,7 @@ void ApplyViewMode(const char *name)
if (cfg::dat.boldHideOffline == (BYTE)-1)
cfg::dat.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", 0);
- CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
+ pcli->pfnSetHideOffline(false);
SetWindowTextA(hwndSelector, name);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetButtonStates();
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp
index dbc1b811dd..81bbdac991 100644
--- a/plugins/TopToolBar/src/InternalButtons.cpp
+++ b/plugins/TopToolBar/src/InternalButtons.cpp
@@ -4,7 +4,6 @@
#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
@@ -26,7 +25,7 @@ static stdButtons[] = {
{ LPGEN("Show accounts manager"), "Protos/ShowAccountManager", SKINICON_OTHER_ACCMGR, 0, LPGEN("Show accounts manager"), NULL, 0, 0 },
{ LPGEN("Find/add contacts"), MS_FINDADD_FINDADD, SKINICON_OTHER_FINDUSER, 0, LPGEN("Find/add contacts"), NULL, 0, 1 },
{ 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("Show/hide offline contacts"), MS_CLIST_TOGGLEHIDEOFFLINE, 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"), 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 },
@@ -83,12 +82,6 @@ INT_PTR TTBInternalSoundsOnOff(WPARAM, LPARAM)
return 0;
}
-INT_PTR TTBInternalShowHideOffline(WPARAM, LPARAM)
-{
- CallService(MS_CLIST_SETHIDEOFFLINE, -1, 0);
- return 0;
-}
-
///////////////////////////////////////////////////////////////////////////////
void InitInternalButtons()
@@ -98,7 +91,6 @@ void InitInternalButtons()
CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
CreateServiceFunction(TTBI_STATUSMENUBUTT, TTBInternalStatusMenuButt);
- CreateServiceFunction(TTBI_SHOWHIDEOFFLINE, TTBInternalShowHideOffline);
for (int i = 0; i < _countof(stdButtons); i++) {
TTBButton ttb = { 0 };
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
index 078f0ee27d..f18d2a2d1b 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
@@ -161,42 +161,35 @@ INT_PTR SvcExImport_Import(lpExImParam ExImContact, HWND hwndParent)
// create the filename to suggest the user for the to export contact
DisplayNameToFileName(ExImContact, szFileName, _countof(szFileName));
- int nIndex = DlgExIm_OpenFileName(hwndParent,
+ int nIndex = DlgExIm_OpenFileName(hwndParent,
Translate("Import User Details from VCard"),
FilterString(ExImContact),
szFileName);
-// Stop during develop
-if (ExImContact->Typ == EXIM_ACCOUNT ||
- ExImContact->Typ == EXIM_GROUP) return 1;
+ // Stop during develop
+ if (ExImContact->Typ == EXIM_ACCOUNT ||
+ ExImContact->Typ == EXIM_GROUP) return 1;
switch (nIndex) {
- case 1:
- {
- CFileXml xmlFile;
- CallService(MS_CLIST_SETHIDEOFFLINE, -1, 0); //workarround to refresh the clist....
- xmlFile.Import(ExImContact->hContact, szFileName);
- CallService(MS_CLIST_SETHIDEOFFLINE, -1, 0); //...after import.
- //Clist_Broadcast(CLM_AUTOREBUILD, 0, 0); //does not work
- return 0;
- }
+ case 1:
+ CFileXml().Import(ExImContact->hContact, szFileName);
+ Clist_BroadcastAsync(CLM_AUTOREBUILD, 0, 0);
+ return 0;
+
// .ini
- case 2:
- return SvcExImINI_Import(ExImContact->hContact, szFileName);
+ case 2:
+ return SvcExImINI_Import(ExImContact->hContact, szFileName);
// .vcf
- case 3:
- {
- CVCardFileVCF vcfFile;
-
- if (vcfFile.Open(ExImContact->hContact, szFileName, "rt")) {
- SetCursor(LoadCursor(NULL, IDC_WAIT));
- vcfFile.Import();
- vcfFile.Close();
- SetCursor(LoadCursor(NULL, IDC_ARROW));
- }
- return 0;
+ case 3:
+ CVCardFileVCF vcfFile;
+ if (vcfFile.Open(ExImContact->hContact, szFileName, "rt")) {
+ SetCursor(LoadCursor(NULL, IDC_WAIT));
+ vcfFile.Import();
+ vcfFile.Close();
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
}
+ return 0;
}
return 1;
}