diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-11 19:52:52 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-11 19:52:52 +0300 |
commit | 02bb82c1c0a4031e7b2f5578370fa5acd620f8e1 (patch) | |
tree | c18da4f063f47fc89cd2d57a5184bb15b7a135fb /plugins/Scriver/src | |
parent | 120b68869dab681e9c2360cd2b3905ee3a7ecf4a (diff) |
fixes #4653 (Плагины сообщений: невозможно удалить имя группы чатов)
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r-- | plugins/Scriver/src/chat_options.cpp | 18 | ||||
-rw-r--r-- | plugins/Scriver/src/resource.h | 1 |
2 files changed, 13 insertions, 6 deletions
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
|