summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-11 19:52:52 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-11 19:52:52 +0300
commit02bb82c1c0a4031e7b2f5578370fa5acd620f8e1 (patch)
treec18da4f063f47fc89cd2d57a5184bb15b7a135fb /plugins/Scriver
parent120b68869dab681e9c2360cd2b3905ee3a7ecf4a (diff)
fixes #4653 (Плагины сообщений: невозможно удалить имя группы чатов)
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/res/resource.rc2
-rw-r--r--plugins/Scriver/src/chat_options.cpp18
-rw-r--r--plugins/Scriver/src/resource.h1
3 files changed, 14 insertions, 7 deletions
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