From 64303ec8f7d8fd491247a2c06ee133e4f5f3c942 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 30 Mar 2020 16:52:28 +0300 Subject: Contact lists: - all common options moved to the Clist namespace; - fixes #2281 (Add option to not clear "NotOnList" group at start); --- src/core/stdclist/res/resource.rc | 27 +++++++++++++++++---------- src/core/stdclist/src/clistopts.cpp | 29 ----------------------------- src/core/stdclist/src/resource.h | 8 ++------ src/core/stdmsg/src/msgoptions.cpp | 2 +- 4 files changed, 20 insertions(+), 46 deletions(-) (limited to 'src/core') diff --git a/src/core/stdclist/res/resource.rc b/src/core/stdclist/res/resource.rc index 0b367c5e78..c20cb6bfb6 100644 --- a/src/core/stdclist/res/resource.rc +++ b/src/core/stdclist/res/resource.rc @@ -15,13 +15,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -48,10 +46,6 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,17,124,10 - CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,33,124,10 - CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,50,124,10 - CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,67,124,10 CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,153,14,144,10 CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",BS_AUTORADIOBUTTON,153,26,149,10 CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",BS_AUTORADIOBUTTON,153,38,151,10 @@ -74,7 +68,7 @@ BEGIN GROUPBOX "System tray icon when using multiple protocols",IDC_STATIC,2,131,310,66 GROUPBOX "Contact list sorting",IDC_STATIC,143,2,169,54,WS_GROUP CONTROL "Spin5",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,173,97,11,21 - CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,84,97,10 + CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,15,97,10 END IDD_OPT_CLUI DIALOGEX 0, 0, 313, 245 @@ -222,7 +216,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_DELETECONTACT, DIALOG BEGIN @@ -344,10 +338,23 @@ END // IDC_HYPERLINKHAND CURSOR "hyperlin.cur" + IDC_DROP CURSOR "dragcopy.cur" + IDC_DROPUSER CURSOR "dropuser.cur" -#endif // English (U.S.) resources + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDD_OPT_CLIST AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index 8f5ac3150f..12b21edb8a 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -27,39 +27,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { - case WM_USER + 1: - { - MCONTACT hContact = wParam; - DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *)lParam; - if (hContact == NULL && ws != nullptr && ws->szModule != nullptr && ws->szSetting != nullptr && - strcmp(ws->szModule, "CList") == 0 && strcmp(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) - { - CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0 ? BST_CHECKED : BST_UNCHECKED); - } - } - break; - - case WM_DESTROY: - UnhookEvent((HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA)); - break; - case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1)); - CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, - g_plugin.getByte("HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, - g_plugin.getByte("HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, - g_plugin.getByte("UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED); CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !g_plugin.getByte("SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) && !g_plugin.getByte("SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, g_plugin.getByte("SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, g_plugin.getByte("SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, - g_plugin.getByte("ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_ONECLK, g_plugin.getByte("Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); @@ -146,16 +122,11 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - g_plugin.setByte("HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE)); - g_plugin.setByte("HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS)); - g_plugin.setByte("UseGroups", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS)); - g_bSortByStatus = IsDlgButtonChecked(hwndDlg, IDC_SORTBYSTATUS); g_bSortByProto = IsDlgButtonChecked(hwndDlg, IDC_SORTBYPROTO); g_plugin.setByte("SortByStatus", (BYTE)g_bSortByStatus); g_plugin.setByte("SortByProto", (BYTE)g_bSortByProto); - g_plugin.setByte("ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE)); g_plugin.setByte("Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK)); g_plugin.setByte("AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS)); g_plugin.setByte("AlwaysMulti", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI)); diff --git a/src/core/stdclist/src/resource.h b/src/core/stdclist/src/resource.h index 7315124d9c..92d8716ed6 100644 --- a/src/core/stdclist/src/resource.h +++ b/src/core/stdclist/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by resource.rc +// Used by w:\miranda-ng\src\core\stdclist\res\resource.rc // #define IDD_OPT_CLIST 126 #define IDC_DROP 183 @@ -20,18 +20,14 @@ #define IDC_TOOLWND 1097 #define IDC_ONECLK 1098 #define IDC_SHOWCAPTION 1098 -#define IDC_HIDEOFFLINE 1099 #define IDC_SHOWHIDE 1100 -#define IDC_HIDEEMPTYGROUPS 1100 #define IDC_SORTBYSTATUS 1101 #define IDC_FADEINOUT 1101 #define IDC_READMSG 1102 #define IDC_AUTOSIZE 1102 -#define IDC_DISABLEGROUPS 1102 #define IDC_AUTOSIZEUPWARD 1103 #define IDC_ALWAYSSTATUS 1103 #define IDC_NETSEARCH 1104 -#define IDC_CONFIRMDELETE 1104 #define IDC_SORTBYPROTO 1105 #define IDC_SHOWOPTIONS 1105 #define IDC_SEARCHURL 1106 @@ -134,7 +130,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 292 +#define _APS_NEXT_RESOURCE_VALUE 293 #define _APS_NEXT_COMMAND_VALUE 40018 #define _APS_NEXT_CONTROL_VALUE 1662 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 131862920b..561ef27cf0 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -435,7 +435,7 @@ public: void ResetCList(CCtrlClc::TEventInfo* = nullptr) { - clist.SetUseGroups(db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT)); + clist.SetUseGroups(Clist::UseGroups); clist.SetHideEmptyGroups(1); } -- cgit v1.2.3