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 /src/core/stdmsg | |
parent | 120b68869dab681e9c2360cd2b3905ee3a7ecf4a (diff) |
fixes #4653 (Плагины сообщений: невозможно удалить имя группы чатов)
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/res/resource.rc | 44 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_options.cpp | 30 | ||||
-rw-r--r-- | src/core/stdmsg/src/resource.h | 1 |
3 files changed, 37 insertions, 38 deletions
diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc index 52d4c4731e..fc41cbb773 100644 --- a/src/core/stdmsg/res/resource.rc +++ b/src/core/stdmsg/res/resource.rc @@ -88,8 +88,8 @@ BEGIN CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,108,251,1
LISTBOX IDC_SRMM_NICKLIST,182,2,69,94,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
CONTROL "",IDC_AVATAR,"Button",BS_OWNERDRAW | NOT WS_VISIBLE,1,127,6,13
- CONTROL "",IDC_SRMM_QUOTE,"RichEdit50W",ES_AUTOHSCROLL | WS_DISABLED | WS_BORDER | WS_TABSTOP,0,95,235,16
- CONTROL "",IDC_SRMM_CLOSEQUOTE,"MButtonClass", WS_TABSTOP,237,97,16,16
+ CONTROL "",IDC_SRMM_QUOTE,"RichEdit50W",WS_DISABLED | WS_BORDER | WS_TABSTOP | 0x80,0,95,235,16
+ CONTROL "",IDC_SRMM_CLOSEQUOTE,"MButtonClass",WS_TABSTOP,237,97,16,16
END
IDD_OPT_MSGHIST DIALOGEX 0, 0, 311, 171
@@ -192,8 +192,10 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_CHECKBOXES,"SysTreeView32",TVS_DISABLEDRAGDROP | WS_HSCROLL | WS_TABSTOP,10,12,280,205
- GROUPBOX "Options",IDC_STATIC,0,0,300,227
+ CONTROL "",IDC_CHECKBOXES,"SysTreeView32",TVS_DISABLEDRAGDROP | WS_HSCROLL | WS_TABSTOP,6,11,287,188
+ GROUPBOX "Options",IDC_STATIC,0,0,300,206
+ CONTROL "Add new rooms to group:",IDC_CHAT_USEGROUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,213,186,8
+ EDITTEXT IDC_GROUP,202,211,93,12,ES_AUTOHSCROLL
END
IDD_OPTIONS2 DIALOGEX 0, 0, 300, 200
@@ -225,11 +227,9 @@ BEGIN EDITTEXT IDC_LIMIT,248,114,38,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Spin1",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,275,114,11,14
GROUPBOX "Other",IDC_STATIC,1,145,294,53
- LTEXT "Add new rooms to group:",IDC_STATIC,11,159,132,8
- EDITTEXT IDC_GROUP,158,158,49,14,ES_AUTOHSCROLL
- LTEXT "Nick list row distance (pixels):",IDC_STATIC,11,180,140,8
- EDITTEXT IDC_NICKROW2,158,178,29,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,183,178,11,14
+ LTEXT "Nick list row distance (pixels):",IDC_STATIC,11,158,140,8
+ EDITTEXT IDC_NICKROW2,158,156,29,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,183,156,11,14
END
@@ -297,35 +297,14 @@ BEGIN IDD_OPTIONS1, DIALOG
BEGIN
- VERTGUIDE, 10
- VERTGUIDE, 153
- VERTGUIDE, 181
- VERTGUIDE, 202
- VERTGUIDE, 290
- HORZGUIDE, 12
- HORZGUIDE, 174
- HORZGUIDE, 192
- HORZGUIDE, 213
END
IDD_OPTIONS2, DIALOG
BEGIN
LEFTMARGIN, 1
RIGHTMARGIN, 295
- VERTGUIDE, 10
- VERTGUIDE, 60
- VERTGUIDE, 144
- VERTGUIDE, 158
- VERTGUIDE, 183
- VERTGUIDE, 221
- VERTGUIDE, 286
TOPMARGIN, 1
BOTTOMMARGIN, 198
- HORZGUIDE, 108
- HORZGUIDE, 126
- HORZGUIDE, 146
- HORZGUIDE, 158
- HORZGUIDE, 174
END
END
#endif // APSTUDIO_INVOKED
@@ -535,6 +514,11 @@ BEGIN 0
END
+IDD_OPTIONS1 AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 2518807485..9755a3218c 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -91,13 +91,20 @@ class COptMainDlg : public CChatOptionsBaseDlg { uint32_t m_dwFlags; + CCtrlEdit edtGroup; + CCtrlCheck chkUseGroup; CCtrlTreeOpts checkBoxes; public: COptMainDlg() : CChatOptionsBaseDlg(IDD_OPTIONS1), - checkBoxes(this, IDC_CHECKBOXES) + edtGroup(this, IDC_GROUP), + checkBoxes(this, IDC_CHECKBOXES), + chkUseGroup(this, IDC_CHAT_USEGROUP) { + CreateLink(chkUseGroup, Chat::bUseGroup); + chkUseGroup.OnChange = Callback(this, &COptMainDlg::onChange_UseGroup); + m_dwFlags = db_get_dw(0, CHAT_MODULE, "IconFlags"); auto *pwszSection = TranslateT("Appearance and functionality of chat room windows"); @@ -135,11 +142,23 @@ public: checkBoxes.AddOption(pwszSection, TranslateT("Show icon for status changes"), m_dwFlags, GC_EVENT_ADDSTATUS); } + bool OnInitDialog() override + { + edtGroup.SetText(Chat_GetGroup()); + return true; + } + bool OnApply() override { + Chat_SetGroup(ptrW(rtrimw(edtGroup.GetText()))); db_set_dw(0, CHAT_MODULE, "IconFlags", m_dwFlags); return true; } + + void onChange_UseGroup(CCtrlCheck *) + { + edtGroup.Enable(chkUseGroup.IsChecked()); + } }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -163,7 +182,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p class COptLogDlg : public CChatOptionsBaseDlg { - CCtrlEdit edtGroup, edtLogDir, edtLogTimestamp, edtTimestamp, edtHighlight, edtInStamp, edtOutStamp, edtLimit; + CCtrlEdit edtLogDir, edtLogTimestamp, edtTimestamp, edtHighlight, edtInStamp, edtOutStamp, edtLimit; CCtrlSpin spin2, spin3, spin4; CCtrlCheck chkLogging, chkHighlight; CCtrlButton btnFontChoose; @@ -175,7 +194,6 @@ public: spin3(this, IDC_SPIN3, 10000), spin4(this, IDC_SPIN4, 255, 10), - edtGroup(this, IDC_GROUP), edtLimit(this, IDC_LIMIT), edtLogDir(this, IDC_LOGDIRECTORY), edtInStamp(this, IDC_INSTAMP), @@ -186,7 +204,7 @@ public: chkLogging(this, IDC_LOGGING), chkHighlight(this, IDC_HIGHLIGHT), - + btnFontChoose(this, IDC_FONTCHOOSE) { chkLogging.OnChange = Callback(this, &COptLogDlg::onChange_Logging); @@ -201,8 +219,6 @@ public: spin3.SetPosition(db_get_w(0, CHAT_MODULE, "LoggingLimit", 100)); spin4.SetPosition(db_get_b(0, CHAT_MODULE, "NicklistRowDist", 12)); - edtGroup.SetText(ptrW(Chat_GetGroup())); - wchar_t szTemp[MAX_PATH]; PathToRelativeW(g_Settings.pszLogDir, szTemp); edtLogDir.SetText(szTemp); @@ -261,8 +277,6 @@ public: else db_unset(0, CHAT_MODULE, "HeaderOutgoing"); - Chat_SetGroup(ptrW(rtrimw(edtGroup.GetText()))); - g_Settings.bHighlightEnabled = chkHighlight.GetState(); db_set_b(0, CHAT_MODULE, "HighlightEnabled", g_Settings.bHighlightEnabled); diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h index aaefd5ce20..dbdb870663 100644 --- a/src/core/stdmsg/src/resource.h +++ b/src/core/stdmsg/src/resource.h @@ -106,6 +106,7 @@ #define IDC_RADIO2 1068
#define IDC_RADIO3 1069
#define IDC_ADD 1070
+#define IDC_CHAT_USEGROUP 1071
#define IDC_TAB 1074
#define IDC_1 1075
#define IDC_2 1076
|