From ac0147f8c31d95e2537dd7c53af78634a3e9d625 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 5 Apr 2020 13:50:39 +0300 Subject: another common clist option moved to the core --- plugins/Clist_modern/res/resource.rc | 2 -- plugins/Clist_modern/src/modern_clcopts.cpp | 20 ++------------------ plugins/Clist_modern/src/resource.h | 1 - 3 files changed, 2 insertions(+), 21 deletions(-) (limited to 'plugins/Clist_modern') diff --git a/plugins/Clist_modern/res/resource.rc b/plugins/Clist_modern/res/resource.rc index 038d21db4a..e0a3667736 100644 --- a/plugins/Clist_modern/res/resource.rc +++ b/plugins/Clist_modern/res/resource.rc @@ -384,8 +384,6 @@ BEGIN CONTROL "Make selection highlight translucent",IDC_NOTNOTRANSLUCENTSEL, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,77,175,10 CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,89,153,10 - CTEXT "'Hide offline' means to hide:",IDC_STATIC,185,14,112,8 - CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,191,24,105,73 GROUPBOX "Groups",IDC_STATIC,2,105,148,115 CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,114,131,16 diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index e090ed6601..e2a38d164a 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -244,9 +244,8 @@ struct CheckBoxValues_t { DWORD style; wchar_t *szDescr; -}; - -static const struct CheckBoxValues_t greyoutValues[] = { +} +static const greyoutValues[] = { { GREYF_UNFOCUS, LPGENW("Not focused") }, { MODEF_OFFLINE, LPGENW("Offline") }, { PF2_ONLINE, LPGENW("Online") }, @@ -258,17 +257,6 @@ static const struct CheckBoxValues_t greyoutValues[] = { { PF2_INVISIBLE, LPGENW("Invisible") } }; -static const struct CheckBoxValues_t offlineValues[] = { - { MODEF_OFFLINE, LPGENW("Offline") }, - { PF2_ONLINE, LPGENW("Online") }, - { PF2_SHORTAWAY, LPGENW("Away") }, - { PF2_LONGAWAY, LPGENW("Not available") }, - { PF2_LIGHTDND, LPGENW("Occupied") }, - { PF2_HEAVYDND, LPGENW("Do not disturb") }, - { PF2_FREECHAT, LPGENW("Free for chat") }, - { PF2_INVISIBLE, LPGENW("Invisible") } -}; - static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style) { TVINSERTSTRUCT tvis; @@ -373,7 +361,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); - SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); { DWORD exStyle = db_get_dw(0, "CLC", "ExStyle", GetDefaultExStyle()); for (auto &it : checkBoxToStyleEx) @@ -393,7 +380,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING)); EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)); FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, _countof(greyoutValues), db_get_dw(0, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS)); - FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, _countof(offlineValues), db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES)); CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(0, "CLC", "NoVScrollBar", CLCDEFAULT_NOVSCROLL) ? BST_CHECKED : BST_UNCHECKED); return TRUE; @@ -413,7 +399,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case IDC_GREYOUTOPTS: - case IDC_HIDEOFFLINEOPTS: if (((LPNMHDR)lParam)->code == NM_CLICK) { TVHITTESTINFO hti; hti.pt.x = (short)LOWORD(GetMessagePos()); @@ -450,7 +435,6 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar db_set_dw(0, "CLC", "GreyoutFlags", 0); db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0)); - db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS))); db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0)); db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0)); db_set_b(0, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0)); diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index 3351ae4ae6..7aac6af638 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -173,7 +173,6 @@ #define IDC_TILEV 1301 #define IDC_GAMMACORRECT 1302 #define IDC_TILEVROWH 1302 -#define IDC_HIDEOFFLINEOPTS 1308 #define IDC_CYCLETIME 1318 #define IDC_CYCLETIMESPIN 1319 #define IDC_HIDETIMESPIN 1320 -- cgit v1.2.3