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/src/chat_options.cpp | 18 ++++++++++++------ plugins/Scriver/src/resource.h | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'plugins/Scriver/src') 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 -- cgit v1.2.3