summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-11-15 17:07:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-11-15 17:07:08 +0300
commit7bc07a1bb6dc73029e98ce1c3e9c907ba09f7843 (patch)
treeaaa04c194d5ed99e53a015bee8aa12776719c611 /src/core
parent7d053a2f4a6c6b8ba7400fce490bab6418672191 (diff)
fixes #3240 (StdClist: get rid of inverted logic)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdclist/res/resource.rc59
-rw-r--r--src/core/stdclist/src/clistopts.cpp38
-rw-r--r--src/core/stdclist/src/contact.cpp6
-rw-r--r--src/core/stdclist/src/init.cpp7
-rw-r--r--src/core/stdclist/src/resource.h7
-rw-r--r--src/core/stdclist/src/stdafx.h2
6 files changed, 47 insertions, 72 deletions
diff --git a/src/core/stdclist/res/resource.rc b/src/core/stdclist/res/resource.rc
index 45f06891dc..22ccc72edc 100644
--- a/src/core/stdclist/res/resource.rc
+++ b/src/core/stdclist/res/resource.rc
@@ -45,27 +45,22 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
+ GROUPBOX "Contact list sorting",IDC_STATIC,2,2,310,68,WS_GROUP
CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,14,287,10
CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",BS_AUTORADIOBUTTON,10,26,287,10
CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",BS_AUTORADIOBUTTON,10,38,287,10
- CONTROL "Disable icon blinking",IDC_DISABLEBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,86,86,9
- EDITTEXT IDC_BLINKTIME,12,99,35,12,ES_NUMBER
- CONTROL "Spin5",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,43,99,11,14
- LTEXT "ms delay",IDC_STMSDELAY,52,102,113,8
- CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,133,90,10
- COMBOBOX IDC_PRIMARYSTATUS,104,132,78,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "icon when statuses differ",IDC_STATIC,189,134,116,8,NOT WS_GROUP
- CONTROL "Cycle icons every",IDC_CYCLE,"Button",BS_AUTORADIOBUTTON,10,150,89,10
- EDITTEXT IDC_CYCLETIME,103,149,30,12,ES_RIGHT | ES_NUMBER
- CONTROL "Spin1",IDC_CYCLETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,127,133,10,14
- LTEXT "seconds, when statuses differ",IDC_STATIC,141,151,165,8,NOT WS_GROUP
- CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",BS_AUTORADIOBUTTON,10,167,91,10
- CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,167,198,10
- GROUPBOX "System tray icon",IDC_STATIC,2,72,310,47
- GROUPBOX "System tray icon when using multiple protocols",IDC_STATIC,2,121,310,61
- GROUPBOX "Contact list sorting",IDC_STATIC,2,2,310,68,WS_GROUP
- CONTROL "Don't move offline user to bottom",IDC_NOOFFLINEMOVE,
+ CONTROL "Move offline users to bottom",IDC_MOVE_OFFLINE_BOTTOM,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,53,287,10
+ CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,83,90,10
+ COMBOBOX IDC_PRIMARYSTATUS,104,82,78,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "icon when statuses differ",IDC_STATIC,189,84,116,8,NOT WS_GROUP
+ CONTROL "Cycle icons every",IDC_CYCLE,"Button",BS_AUTORADIOBUTTON,10,100,89,10
+ EDITTEXT IDC_CYCLETIME,103,99,30,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_CYCLETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,127,98,11,14
+ LTEXT "seconds, when statuses differ",IDC_STATIC,141,101,165,8,NOT WS_GROUP
+ CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",BS_AUTORADIOBUTTON,10,117,91,10
+ CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,117,198,10
+ GROUPBOX "System tray icon when using multiple protocols",IDC_STATIC,2,71,310,61
END
IDD_OPT_CLUI DIALOGEX 0, 0, 313, 233
@@ -129,7 +124,7 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,59,179,10
CONTROL "Make selection highlight translucent",IDC_NOTNOTRANSLUCENTSEL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,71,179,10
- CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,83,155,10
+ CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,83,153,10
GROUPBOX "Groups",IDC_STATIC,2,99,148,117
CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,9,109,131,16
@@ -142,26 +137,26 @@ BEGIN
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,9,181,131,16
LTEXT "Indent groups by:",IDC_STATIC,9,201,67,8
EDITTEXT IDC_GROUPINDENT,78,199,31,12,ES_RIGHT | ES_NUMBER
- CONTROL "Spin1",IDC_GROUPINDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,103,204,10,14
+ CONTROL "Spin1",IDC_GROUPINDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,103,198,10,14
LTEXT "pixels",IDC_STATIC,112,201,36,8
GROUPBOX "Visual",IDC_STATIC,156,99,156,131
- CONTROL "Scroll list smoothly",IDC_NOTNOSMOOTHSCROLLING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,110,139,10
+ CONTROL "Scroll list smoothly",IDC_NOTNOSMOOTHSCROLLING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,110,139,10
LTEXT "Time:",IDC_STATIC11,174,122,42,8
EDITTEXT IDC_SMOOTHTIME,216,120,31,12,ES_RIGHT | ES_NUMBER
- CONTROL "Spin1",IDC_SMOOTHTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,126,10,14
+ CONTROL "Spin1",IDC_SMOOTHTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,119,10,14
LTEXT "milliseconds",IDC_STATIC12,250,122,56,8,SS_CENTERIMAGE
- CONTROL "Hide vertical scroll bar",IDC_NOSCROLLBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,135,140,10
- LTEXT "Left margin:",IDC_STATIC,164,148,51,8
+ CONTROL "Hide vertical scroll bar",IDC_NOSCROLLBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,135,140,10
+ LTEXT "Left margin:",IDC_STATIC,162,148,51,8
EDITTEXT IDC_LEFTMARGIN,215,146,31,12,ES_RIGHT | ES_NUMBER
- CONTROL "Spin1",IDC_LEFTMARGINSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,152,10,14
+ CONTROL "Spin1",IDC_LEFTMARGINSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,145,10,14
LTEXT "pixels",IDC_STATIC,250,148,54,8
- LTEXT "Row height:",IDC_STATIC,164,163,51,8
+ LTEXT "Row height:",IDC_STATIC,162,163,51,8
EDITTEXT IDC_ROWHEIGHT,215,161,31,12,ES_RIGHT | ES_NUMBER
- CONTROL "Spin1",IDC_ROWHEIGHTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,167,10,14
+ CONTROL "Spin1",IDC_ROWHEIGHTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,161,10,14
LTEXT "pixels",IDC_STATIC,250,163,54,8
- CONTROL "Gamma correction",IDC_GAMMACORRECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,174,140,10
- CONTROL "Gray out entire list when:",IDC_GREYOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,185,139,10
- CONTROL "Tree1",IDC_GREYOUTOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,164,195,141,32
+ CONTROL "Gamma correction",IDC_GAMMACORRECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,174,140,10
+ CONTROL "Gray out entire list when:",IDC_GREYOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,185,139,10
+ CONTROL "Tree1",IDC_GREYOUTOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,162,195,141,32
END
IDD_OPT_CLCBKG DIALOGEX 0, 0, 235, 154
@@ -257,13 +252,9 @@ BEGIN
LEFTMARGIN, 2
RIGHTMARGIN, 312
VERTGUIDE, 9
- VERTGUIDE, 164
- VERTGUIDE, 216
+ VERTGUIDE, 162
TOPMARGIN, 2
BOTTOMMARGIN, 232
- HORZGUIDE, 145
- HORZGUIDE, 163
- HORZGUIDE, 222
END
IDD_OPT_CLCBKG, DIALOG
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp
index 7a269a8a8b..29683b6506 100644
--- a/src/core/stdclist/src/clistopts.cpp
+++ b/src/core/stdclist/src/clistopts.cpp
@@ -26,10 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class ClistOptsDlg : public CDlgBase
{
- CCtrlSpin cycleTime, blink;
+ CCtrlSpin cycleTime;
CCtrlCombo status;
CCtrlCheck sortByName, sortByStatus, sortByProto, chkOfflineBottom;
- CCtrlCheck chkDisableBlink, chkCycle, chkDontCycle, chkMulti;
+ CCtrlCheck chkCycle, chkDontCycle, chkMulti;
public:
ClistOptsDlg() :
@@ -37,16 +37,13 @@ public:
chkCycle(this, IDC_CYCLE),
chkMulti(this, IDC_MULTITRAY),
chkDontCycle(this, IDC_DONTCYCLE),
- blink(this, IDC_BLINKSPIN, 0x3FFF, 250),
cycleTime(this, IDC_CYCLETIMESPIN, 120, 1),
status(this, IDC_PRIMARYSTATUS),
sortByName(this, IDC_SORTBYNAME),
sortByProto(this, IDC_SORTBYPROTO),
sortByStatus(this, IDC_SORTBYSTATUS),
- chkDisableBlink(this, IDC_DISABLEBLINK),
- chkOfflineBottom(this, IDC_NOOFFLINEMOVE)
+ chkOfflineBottom(this, IDC_MOVE_OFFLINE_BOTTOM)
{
- chkDisableBlink.OnChange = Callback(this, &ClistOptsDlg::onChange_DisableBlink);
chkCycle.OnChange = chkDontCycle.OnChange = chkMulti.OnChange = Callback(this, &ClistOptsDlg::onChange_Tray);
}
@@ -64,9 +61,6 @@ public:
chkMulti.SetState(iTrayIcon == SETTING_TRAYICON_MULTI);
chkDontCycle.SetState(iTrayIcon == SETTING_TRAYICON_SINGLE);
- chkDisableBlink.SetState(g_plugin.getBool("DisableTrayFlash", false));
-
- blink.SetPosition(g_plugin.getWord("IconFlashTime", 550));
cycleTime.SetPosition(g_plugin.getWord("CycleTime", SETTING_CYCLETIME_DEFAULT));
ptrA szPrimaryStatus(g_plugin.getStringA("PrimaryStatus"));
@@ -87,14 +81,12 @@ public:
bool OnApply() override
{
- g_plugin.setByte("SortByStatus", g_bSortByStatus = sortByStatus.GetState());
- g_plugin.setByte("SortByProto", g_bSortByProto = sortByProto.GetState());
- g_plugin.setByte("NoOfflineBottom", g_bNoOfflineBottom = chkOfflineBottom.GetState());
+ g_plugin.setByte("SortByStatus", g_bSortByStatus = sortByStatus.IsChecked());
+ g_plugin.setByte("SortByProto", g_bSortByProto = sortByProto.IsChecked());
+ g_plugin.setByte("OfflineBottom", g_bOfflineToBottom = chkOfflineBottom.IsChecked());
g_plugin.setByte("AlwaysMulti", !IsDlgButtonChecked(m_hwnd, IDC_ALWAYSMULTI));
- g_plugin.setByte("TrayIcon", (chkDontCycle.GetState() ? SETTING_TRAYICON_SINGLE : (chkCycle.GetState() ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
+ g_plugin.setByte("TrayIcon", (chkDontCycle.IsChecked() ? SETTING_TRAYICON_SINGLE : (chkCycle.IsChecked() ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
g_plugin.setWord("CycleTime", cycleTime.GetPosition());
- g_plugin.setWord("IconFlashTime", blink.GetPosition());
- g_plugin.setByte("DisableTrayFlash", IsDlgButtonChecked(m_hwnd, IDC_DISABLEBLINK));
PROTOACCOUNT *pa = (PROTOACCOUNT *)status.GetCurData();
if (pa == nullptr)
@@ -110,18 +102,10 @@ public:
void onChange_Tray(CCtrlCheck *)
{
- EnableWindow(GetDlgItem(m_hwnd, IDC_PRIMARYSTATUS), chkDontCycle.GetState());
- EnableWindow(GetDlgItem(m_hwnd, IDC_CYCLETIME), chkCycle.GetState());
- EnableWindow(GetDlgItem(m_hwnd, IDC_CYCLETIMESPIN), chkCycle.GetState());
- EnableWindow(GetDlgItem(m_hwnd, IDC_ALWAYSMULTI), chkMulti.GetState());
- }
-
- void onChange_DisableBlink(CCtrlCheck *)
- {
- bool bEnable = !chkDisableBlink.GetState();
- EnableWindow(GetDlgItem(m_hwnd, IDC_BLINKTIME), bEnable);
- EnableWindow(GetDlgItem(m_hwnd, IDC_BLINKSPIN), bEnable);
- EnableWindow(GetDlgItem(m_hwnd, IDC_STMSDELAY), bEnable);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_PRIMARYSTATUS), chkDontCycle.IsChecked());
+ EnableWindow(GetDlgItem(m_hwnd, IDC_CYCLETIME), chkCycle.IsChecked());
+ EnableWindow(GetDlgItem(m_hwnd, IDC_CYCLETIMESPIN), chkCycle.IsChecked());
+ EnableWindow(GetDlgItem(m_hwnd, IDC_ALWAYSMULTI), chkMulti.IsChecked());
}
};
diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp
index c72da2c0fd..daba1cdc61 100644
--- a/src/core/stdclist/src/contact.cpp
+++ b/src/core/stdclist/src/contact.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-bool g_bSortByStatus, g_bSortByProto, g_bNoOfflineBottom;
+bool g_bSortByStatus, g_bSortByProto, g_bOfflineToBottom;
const struct
{
@@ -80,8 +80,8 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2)
return ordera - orderb;
}
else {
- //one is offline: offline goes below online
- if (!g_bNoOfflineBottom)
+ // one is offline: offline goes below online
+ if (g_bOfflineToBottom)
if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE))
return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
}
diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp
index 46745f0361..3ca412c5f7 100644
--- a/src/core/stdclist/src/init.cpp
+++ b/src/core/stdclist/src/init.cpp
@@ -107,9 +107,14 @@ static INT_PTR GetStatusMode(WPARAM, LPARAM)
int CMPlugin::Load()
{
+ if (g_plugin.getBool("NoOfflineBottom")) {
+ g_plugin.setByte("OfflineBottom", false);
+ g_plugin.delSetting("NoOfflineBottom");
+ }
+
g_bSortByStatus = g_plugin.getBool("SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
g_bSortByProto = g_plugin.getBool("SortByProto", SETTING_SORTBYPROTO_DEFAULT);
- g_bNoOfflineBottom = g_plugin.getBool("NoOfflineBottom");
+ g_bOfflineToBottom = g_plugin.getBool("OfflineBottom", true);
Clist_GetInterface();
coreCli = g_clistApi;
diff --git a/src/core/stdclist/src/resource.h b/src/core/stdclist/src/resource.h
index 6f22f577d9..6e4960668e 100644
--- a/src/core/stdclist/src/resource.h
+++ b/src/core/stdclist/src/resource.h
@@ -109,9 +109,6 @@
#define IDC_TOPLINE 1535
#define IDC_HOTKEYURLSTR 1567
#define IDC_BRINGTOFRONT 1579
-#define IDC_BLINKTIME 1607
-#define IDC_BLINKSPIN 1608
-#define IDC_DISABLEBLINK 1609
#define IDC_IDLE 1610
#define IDC_SBPANELBEVEL 1611
#define IDC_DROPSHADOW 1612
@@ -120,9 +117,7 @@
#define IDC_ONDESKTOP 1657
#define IDC_DISABLEDOCKING 1658
#define IDC_WINCOLOUR 1659
-#define IDC_STMSDELAY 1661
-#define IDC_CHECK1 1662
-#define IDC_NOOFFLINEMOVE 1662
+#define IDC_MOVE_OFFLINE_BOTTOM 1662
// Next default values for new objects
//
diff --git a/src/core/stdclist/src/stdafx.h b/src/core/stdclist/src/stdafx.h
index 03c9854f24..d50af5e471 100644
--- a/src/core/stdclist/src/stdafx.h
+++ b/src/core/stdclist/src/stdafx.h
@@ -64,6 +64,6 @@ struct CMPlugin : public PLUGIN<CMPlugin>
// shared vars
extern CLIST_INTERFACE coreCli;
-extern bool g_bSortByStatus, g_bSortByProto, g_bNoOfflineBottom;
+extern bool g_bSortByStatus, g_bSortByProto, g_bOfflineToBottom;
void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst);