From 02bb82c1c0a4031e7b2f5578370fa5acd620f8e1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Sep 2024 19:52:52 +0300 Subject: =?UTF-8?q?fixes=20#4653=20(=D0=9F=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?:=20=D0=BD=D0=B5=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20=D0=B8?= =?UTF-8?q?=D0=BC=D1=8F=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D1=8B=20=D1=87?= =?UTF-8?q?=D0=B0=D1=82=D0=BE=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Scriver/res/resource.rc | 2 +- plugins/Scriver/src/chat_options.cpp | 18 ++++++++++++------ plugins/Scriver/src/resource.h | 1 + plugins/TabSRMM/res/chat.rc | 2 +- plugins/TabSRMM/src/chat_options.cpp | 12 +++++++++++- plugins/TabSRMM/src/resource.h | 1 + 6 files changed, 27 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/res/resource.rc b/plugins/Scriver/res/resource.rc index fa5c9b1fd7..aba7df9289 100644 --- a/plugins/Scriver/res/resource.rc +++ b/plugins/Scriver/res/resource.rc @@ -269,7 +269,7 @@ BEGIN GROUPBOX "Options",IDC_STATIC,0,0,304,184 CONTROL "Tree1",IDC_CHAT_CHECKBOXES,"SysTreeView32",TVS_DISABLEDRAGDROP | WS_BORDER | WS_TABSTOP,8,12,288,164 GROUPBOX "Other",IDC_STATIC,0,184,304,47 - LTEXT "Add new rooms to group:",IDC_STATIC,8,198,132,8 + CONTROL "Add new rooms to group:",IDC_CHAT_USEGROUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,198,132,8 EDITTEXT IDC_CHAT_GROUP,153,195,49,12,ES_AUTOHSCROLL LTEXT "Nick list row height",IDC_STATIC,8,213,138,8 EDITTEXT IDC_CHAT_NICKROW,153,211,29,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER diff --git a/plugins/Scriver/src/chat_options.cpp b/plugins/Scriver/src/chat_options.cpp index d1fb83a817..594c2a8e20 100644 --- a/plugins/Scriver/src/chat_options.cpp +++ b/plugins/Scriver/src/chat_options.cpp @@ -49,6 +49,7 @@ class CGeneralOptsDlg : public CChatOptionsBaseDlg CCtrlSpin spin2; CCtrlEdit m_group; + CCtrlCheck m_useGroup; CCtrlTreeOpts m_opts; public: @@ -56,8 +57,12 @@ public: CChatOptionsBaseDlg(IDD_OPTIONS1), m_opts(this, IDC_CHAT_CHECKBOXES), m_group(this, IDC_CHAT_GROUP), + m_useGroup(this, IDC_CHAT_USEGROUP), spin2(this, IDC_CHAT_SPIN2, 255, 10) { + CreateLink(m_useGroup, Chat::bUseGroup); + m_useGroup.OnChange = Callback(this, &CGeneralOptsDlg::onChange_UseGroup); + auto *pwszSection = TranslateT("Appearance and functionality of chat windows"); m_opts.AddOption(pwszSection, TranslateT("Flash when someone speaks"), Chat::bFlashWindow); m_opts.AddOption(pwszSection, TranslateT("Flash when a word is highlighted"), Chat::bFlashWindowHighlight); @@ -88,17 +93,13 @@ public: bool OnInitDialog() override { spin2.SetPosition(db_get_b(0, CHAT_MODULE, "NicklistRowDist", 12)); - m_group.SetText(ptrW(Chat_GetGroup())); + m_group.SetText(Chat_GetGroup()); return true; } bool OnApply() override { - ptrW wszGroup(m_group.GetText()); - if (mir_wstrlen(wszGroup) > 0) - Chat_SetGroup(wszGroup); - else - Chat_SetGroup(nullptr); + Chat_SetGroup(ptrW(m_group.GetText())); int iPos = spin2.GetPosition(); if (iPos > 0) @@ -109,6 +110,11 @@ public: db_set_dw(0, CHAT_MODULE, "IconFlags", g_Settings.dwIconFlags = m_dwFlags); return true; } + + void onChange_UseGroup(CCtrlCheck *) + { + m_group.Enable(m_useGroup.IsChecked()); + } }; ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index 997cb99440..2f97993ce5 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -186,6 +186,7 @@ #define IDC_CHAT_LOGDIRECTORY 5048 #define IDC_CHAT_LIMIT 5050 #define IDC_CHAT_LOGTIMESTAMP 5051 +#define IDC_CHAT_USEGROUP 5052 #define IDC_CHAT_GROUP 5057 #define IDC_CHAT_HIGHLIGHT 5068 #define IDC_CHAT_TEXTO 5069 diff --git a/plugins/TabSRMM/res/chat.rc b/plugins/TabSRMM/res/chat.rc index 9d9e96f991..cae7e4d74b 100644 --- a/plugins/TabSRMM/res/chat.rc +++ b/plugins/TabSRMM/res/chat.rc @@ -92,7 +92,7 @@ BEGIN CONTROL "",IDC_CHECKBOXES,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,9,289,177 LTEXT "Text for autocomplete:",IDC_STATIC,10,210,177,10 EDITTEXT IDC_GROUP,191,192,102,14,ES_AUTOHSCROLL - LTEXT "Add new rooms to group:",IDC_STATIC,10,193,179,10 + CONTROL "Add new rooms to group:",IDC_CHAT_USEGROUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,193,179,10 EDITTEXT IDC_AUTOCOMPLETE,191,208,102,14,ES_AUTOHSCROLL END diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index bc19086e3e..df55931612 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -488,14 +488,19 @@ class CChatSettingsDlg : public CChatBaseOptionDlg CCtrlTreeOpts treeCheck; CCtrlEdit edtGroup, edtAutocomplete; + CCtrlCheck chkUseGroup; public: CChatSettingsDlg() : CChatBaseOptionDlg(IDD_OPTIONS1), + chkUseGroup(this, IDC_CHAT_USEGROUP), edtGroup(this, IDC_GROUP), edtAutocomplete(this, IDC_AUTOCOMPLETE), treeCheck(this, IDC_CHECKBOXES) { + CreateLink(chkUseGroup, Chat::bUseGroup); + chkUseGroup.OnChange = Callback(this, &CChatSettingsDlg::onChange_UseGroup); + auto *pwszSection = LPGENW("Appearance and functionality of chat room windows"); treeCheck.AddOption(pwszSection, LPGENW("Open new chat rooms in the default container"), g_plugin.bOpenInDefault); treeCheck.AddOption(pwszSection, LPGENW("Flash window when someone speaks"), Chat::bFlashWindow); @@ -534,7 +539,7 @@ public: if (mir_wstrlen(g_Settings.pwszAutoText)) edtAutocomplete.SetText(g_Settings.pwszAutoText); - edtGroup.SetText(ptrW(Chat_GetGroup())); + edtGroup.SetText(Chat_GetGroup()); return true; } @@ -555,6 +560,11 @@ public: b = treeCheck.GetItemState(hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0; db_set_b(0, CHAT_MODULE, "Branch2Exp", b); } + + void onChange_UseGroup(CCtrlCheck *) + { + edtGroup.Enable(chkUseGroup.IsChecked()); + } }; ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index 6482a1bb08..b9eb8f84a4 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -101,6 +101,7 @@ #define IDC_LOGLIMIT 1024 #define IDC_CLOSE 1025 #define IDC_CHKACTR_DISMISS 1026 +#define IDC_CHAT_USEGROUP 1027 #define IDC_CHKACTR_OPEN 1028 #define IDC_CONTACTPIC 1029 #define IDC_CHAT_SPIN2 1029 -- cgit v1.2.3