summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h2
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp166
3 files changed, 84 insertions, 86 deletions
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 9b283b7fb8..dd1997873a 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -193,6 +193,6 @@ int OnLoadLangpack(WPARAM, LPARAM)
{
UnknownConctactTranslatedName = TranslateT("(Unknown contact)");
if (!MirandaLoading())
- ApplyViewMode(g_CluiData.current_viewmode, false);
+ ApplyViewMode(g_CluiData.current_viewmode);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index ca1d6870cb..5c838b5a25 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -197,7 +197,7 @@ void UnloadAvatarOverlayIcon(); /
void UnLoadContactListModule(); //clistmod.c
void UpdateAllAvatars(ClcData *dat); //cache_func.c
-void ApplyViewMode(const char *Name, bool onlySelector = false);
+void ApplyViewMode(const char *Name);
void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat);
// cluiframes.c
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index c6fb949c12..eed2ae3468 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -1194,7 +1194,7 @@ void CreateViewModeFrame()
ApplyViewMode(nullptr); // Apply last selected view mode
}
-void ApplyViewMode(const char *szName, bool onlySelector)
+void ApplyViewMode(const char *szName)
{
DBVARIANT dbv = { 0 };
@@ -1237,102 +1237,100 @@ void ApplyViewMode(const char *szName, bool onlySelector)
SetWindowText(hwndSelector, TranslateT("All contacts"));
}
else {
- if (!onlySelector) {
- mir_snprintf(szSetting, "%c%s_PF", 246, szName);
- ptrA szFilter(db_get_sa(0, CLVM_MODULE, szSetting));
- if (mir_strlen(szFilter) >= 2) {
- strncpy_s(g_CluiData.protoFilter, szFilter.get(), _TRUNCATE);
- g_CluiData.bFilterEffective |= CLVM_FILTER_PROTOS;
- }
+ mir_snprintf(szSetting, "%c%s_PF", 246, szName);
+ ptrA szFilter(db_get_sa(0, CLVM_MODULE, szSetting));
+ if (mir_strlen(szFilter) >= 2) {
+ strncpy_s(g_CluiData.protoFilter, szFilter.get(), _TRUNCATE);
+ g_CluiData.bFilterEffective |= CLVM_FILTER_PROTOS;
+ }
- mir_snprintf(szSetting, "%c%s_GF", 246, szName);
- ptrW wszGroupFilter(db_get_wsa(0, CLVM_MODULE, szSetting));
- if (mir_wstrlen(wszGroupFilter) >= 2) {
- wcsncpy_s(g_CluiData.groupFilter, wszGroupFilter.get(), _TRUNCATE);
- g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
- }
- mir_free(dbv.pwszVal);
+ mir_snprintf(szSetting, "%c%s_GF", 246, szName);
+ ptrW wszGroupFilter(db_get_wsa(0, CLVM_MODULE, szSetting));
+ if (mir_wstrlen(wszGroupFilter) >= 2) {
+ wcsncpy_s(g_CluiData.groupFilter, wszGroupFilter.get(), _TRUNCATE);
+ g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
+ }
+ mir_free(dbv.pwszVal);
- mir_snprintf(szSetting, "%c%s_SM", 246, szName);
- g_CluiData.statusMaskFilter = db_get_dw(0, CLVM_MODULE, szSetting, -1);
- if (g_CluiData.statusMaskFilter >= 1)
- g_CluiData.bFilterEffective |= CLVM_FILTER_STATUS;
+ mir_snprintf(szSetting, "%c%s_SM", 246, szName);
+ g_CluiData.statusMaskFilter = db_get_dw(0, CLVM_MODULE, szSetting, -1);
+ if (g_CluiData.statusMaskFilter >= 1)
+ g_CluiData.bFilterEffective |= CLVM_FILTER_STATUS;
- mir_snprintf(szSetting, "%c%s_SSM", 246, szName);
- g_CluiData.stickyMaskFilter = db_get_dw(0, CLVM_MODULE, szSetting, -1);
- if (g_CluiData.stickyMaskFilter != -1)
- g_CluiData.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
+ mir_snprintf(szSetting, "%c%s_SSM", 246, szName);
+ g_CluiData.stickyMaskFilter = db_get_dw(0, CLVM_MODULE, szSetting, -1);
+ if (g_CluiData.stickyMaskFilter != -1)
+ g_CluiData.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
- g_CluiData.filterFlags = db_get_dw(0, CLVM_MODULE, szName, 0);
+ g_CluiData.filterFlags = db_get_dw(0, CLVM_MODULE, szName, 0);
- KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
+ KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
- if (g_CluiData.filterFlags & CLVM_AUTOCLEAR) {
- mir_snprintf(szSetting, "%c%s_OPT", 246, szName);
- DWORD timerexpire = LOWORD(db_get_dw(0, CLVM_MODULE, szSetting, 0));
- strncpy_s(g_CluiData.old_viewmode, g_CluiData.current_viewmode, _TRUNCATE);
- CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, nullptr);
- }
- else { //store last selected view mode only if it is not autoclear
- mir_snprintf(szSetting, "%c_LastMode", 246);
- db_set_s(0, CLVM_MODULE, szSetting, szName);
- }
- strncpy_s(g_CluiData.current_viewmode, szName, _TRUNCATE);
-
- if (g_CluiData.filterFlags & CLVM_USELASTMSG) {
- g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG;
- mir_snprintf(szSetting, "%c%s_LM", 246, szName);
- g_CluiData.lastMsgFilter = db_get_dw(0, CLVM_MODULE, szSetting, 0);
- if (LOBYTE(HIWORD(g_CluiData.lastMsgFilter)))
- g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
- else
- g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_OLDERTHAN;
-
- DWORD unit = LOWORD(g_CluiData.lastMsgFilter);
- switch (HIBYTE(HIWORD(g_CluiData.lastMsgFilter))) {
- case 0:
- unit *= 60;
- break;
- case 1:
- unit *= 3600;
- break;
- case 2:
- unit *= 86400;
- break;
- }
- g_CluiData.lastMsgFilter = unit;
+ if (g_CluiData.filterFlags & CLVM_AUTOCLEAR) {
+ mir_snprintf(szSetting, "%c%s_OPT", 246, szName);
+ DWORD timerexpire = LOWORD(db_get_dw(0, CLVM_MODULE, szSetting, 0));
+ strncpy_s(g_CluiData.old_viewmode, g_CluiData.current_viewmode, _TRUNCATE);
+ CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, nullptr);
+ }
+ else { //store last selected view mode only if it is not autoclear
+ mir_snprintf(szSetting, "%c_LastMode", 246);
+ db_set_s(0, CLVM_MODULE, szSetting, szName);
+ }
+ strncpy_s(g_CluiData.current_viewmode, szName, _TRUNCATE);
+
+ if (g_CluiData.filterFlags & CLVM_USELASTMSG) {
+ g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG;
+ mir_snprintf(szSetting, "%c%s_LM", 246, szName);
+ g_CluiData.lastMsgFilter = db_get_dw(0, CLVM_MODULE, szSetting, 0);
+ if (LOBYTE(HIWORD(g_CluiData.lastMsgFilter)))
+ g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
+ else
+ g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_OLDERTHAN;
+
+ DWORD unit = LOWORD(g_CluiData.lastMsgFilter);
+ switch (HIBYTE(HIWORD(g_CluiData.lastMsgFilter))) {
+ case 0:
+ unit *= 60;
+ break;
+ case 1:
+ unit *= 3600;
+ break;
+ case 2:
+ unit *= 86400;
+ break;
}
+ g_CluiData.lastMsgFilter = unit;
+ }
- if (HIWORD(g_CluiData.filterFlags) > 0)
- g_CluiData.bFilterEffective |= CLVM_STICKY_CONTACTS;
+ if (HIWORD(g_CluiData.filterFlags) > 0)
+ g_CluiData.bFilterEffective |= CLVM_STICKY_CONTACTS;
- if (g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
- if (g_CluiData.boldHideOffline == (BYTE)-1)
- g_CluiData.boldHideOffline = Clist::HideOffline;
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
+ if (g_CluiData.boldHideOffline == (BYTE)-1)
+ g_CluiData.boldHideOffline = Clist::HideOffline;
- g_clistApi.pfnSetHideOffline(false);
- }
- else if (g_CluiData.boldHideOffline != (BYTE)-1) {
- g_clistApi.pfnSetHideOffline(g_CluiData.boldHideOffline);
- g_CluiData.boldHideOffline = -1;
- }
+ g_clistApi.pfnSetHideOffline(false);
+ }
+ else if (g_CluiData.boldHideOffline != (BYTE)-1) {
+ g_clistApi.pfnSetHideOffline(g_CluiData.boldHideOffline);
+ g_CluiData.boldHideOffline = -1;
+ }
- int bUseGroups = -1;
- if (g_CluiData.filterFlags & CLVM_USEGROUPS)
- bUseGroups = 1;
- else if (g_CluiData.filterFlags & CLVM_DONOTUSEGROUPS)
- bUseGroups = 0;
+ int bUseGroups = -1;
+ if (g_CluiData.filterFlags & CLVM_USEGROUPS)
+ bUseGroups = 1;
+ else if (g_CluiData.filterFlags & CLVM_DONOTUSEGROUPS)
+ bUseGroups = 0;
- if (bUseGroups != -1) {
- if (g_CluiData.bOldUseGroups == (BYTE)-1)
- g_CluiData.bOldUseGroups = Clist::UseGroups;
+ if (bUseGroups != -1) {
+ if (g_CluiData.bOldUseGroups == (BYTE)-1)
+ g_CluiData.bOldUseGroups = Clist::UseGroups;
- CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
- }
- else if (g_CluiData.bOldUseGroups != (BYTE)-1) {
- CallService(MS_CLIST_SETUSEGROUPS, g_CluiData.bOldUseGroups, 0);
- g_CluiData.bOldUseGroups = -1;
- }
+ CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
+ }
+ else if (g_CluiData.bOldUseGroups != (BYTE)-1) {
+ CallService(MS_CLIST_SETUSEGROUPS, g_CluiData.bOldUseGroups, 0);
+ g_CluiData.bOldUseGroups = -1;
}
SetWindowText(hwndSelector, ptrW(mir_utf8decodeW((szName[0] == 13) ? szName + 1 : szName)));