diff options
author | George Hazan <ghazan@miranda.im> | 2022-07-29 14:40:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-07-29 14:40:05 +0300 |
commit | 07464892e2e68bf816fa0f96590a812ec67b75f3 (patch) | |
tree | 762ed15e19bf6078589e4efa11d8c7818d35d61f | |
parent | d95e27d5317d3a5cdea011e8459b4c7d427fd415 (diff) |
fixes #3127 (tabSRMM: сделать настройки про добавление двоеточия и запятой взаимоисключающими)
-rw-r--r-- | include/m_chat_int.h | 1 | ||||
-rw-r--r-- | plugins/Scriver/src/chat.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/chat_main.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/res/chat.rc | 26 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat.h | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_options.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/resource.h | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 1 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_opts.cpp | 1 |
10 files changed, 33 insertions, 22 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index d57c594607..d6361eef5a 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -211,7 +211,6 @@ struct GlobalLogSettingsBase bool bSoundsFocus;
bool bPopupInactiveOnly;
bool bTrayIconInactiveOnly;
- bool bAddColonToAutoComplete;
bool bLogLimitNames;
bool bTimeStampEventColour;
bool bShowContactStatus;
diff --git a/plugins/Scriver/src/chat.h b/plugins/Scriver/src/chat.h index 71227293df..48ad5567d3 100644 --- a/plugins/Scriver/src/chat.h +++ b/plugins/Scriver/src/chat.h @@ -62,6 +62,8 @@ struct SESSION_INFO : public GCSessionInfoBase struct GlobalLogSettings : public GlobalLogSettingsBase
{
HFONT MessageBoxFont;
+ bool bAddColonToAutoComplete;
+
};
extern GlobalLogSettings g_Settings;
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index d06974eb58..69b04f0207 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -113,6 +113,8 @@ static BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) static void OnLoadSettings()
{
+ g_Settings.bAddColonToAutoComplete = db_get_b(0, CHAT_MODULE, "AddColonToAutoComplete", 1) != 0;
+
if (g_Settings.MessageBoxFont)
DeleteObject(g_Settings.MessageBoxFont);
diff --git a/plugins/TabSRMM/res/chat.rc b/plugins/TabSRMM/res/chat.rc index 4c78a06712..862e1f0e95 100644 --- a/plugins/TabSRMM/res/chat.rc +++ b/plugins/TabSRMM/res/chat.rc @@ -84,9 +84,11 @@ EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Options",IDC_STATIC,3,0,300,229
- CONTROL "",IDC_CHECKBOXES,"SysTreeView32",TVS_HASBUTTONS | TVS_DISABLEDRAGDROP | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,9,286,192
- LTEXT "Add new rooms to group:",IDC_STATIC_ADD,10,209,133,10
- EDITTEXT IDC_GROUP,152,208,142,14,ES_AUTOHSCROLL
+ CONTROL "",IDC_CHECKBOXES,"SysTreeView32",TVS_HASBUTTONS | TVS_DISABLEDRAGDROP | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,9,289,177
+ LTEXT "Text for autocomplete",IDC_STATIC,10,210,133,10
+ EDITTEXT IDC_GROUP,152,192,142,14,ES_AUTOHSCROLL
+ LTEXT "Add new rooms to group:",IDC_STATIC,10,193,133,10
+ EDITTEXT IDC_AUTOCOMPLETE,152,208,142,14,ES_AUTOHSCROLL
END
IDD_OPTIONS2 DIALOGEX 0, 0, 306, 209
@@ -178,12 +180,6 @@ BEGIN IDD_OPTIONS1, DIALOG
BEGIN
RIGHTMARGIN, 300
- VERTGUIDE, 10
- VERTGUIDE, 290
- HORZGUIDE, 12
- HORZGUIDE, 174
- HORZGUIDE, 192
- HORZGUIDE, 213
END
IDD_OPTIONS2, DIALOG
@@ -200,13 +196,6 @@ BEGIN HORZGUIDE, 146
HORZGUIDE, 150
END
-
- IDD_OPTIONS3, DIALOG
- BEGIN
- VERTGUIDE, 22
- VERTGUIDE, 42
- VERTGUIDE, 142
- END
END
#endif // APSTUDIO_INVOKED
@@ -251,6 +240,11 @@ BEGIN 0
END
+IDD_OPTIONS1 AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h index c8c24bc843..a326144485 100644 --- a/plugins/TabSRMM/src/chat.h +++ b/plugins/TabSRMM/src/chat.h @@ -75,9 +75,11 @@ struct TMUCSettings : public GlobalLogSettingsBase bool bLogClassicIndicators, bAlternativeSorting, bAnnoyingHighlight, bCreateWindowOnHighlight;
bool bLogSymbols, bClassicIndicators, bClickableNicks, bColorizeNicks, bColorizeNicksInLog;
- bool bScaleIcons, bUseCommaAsColon, bNewLineAfterNames;
+ bool bScaleIcons, bNewLineAfterNames;
CMUCHighlight *Highlight;
+
+ wchar_t *pwszAutoText;
};
extern TMUCSettings g_Settings;
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 5829a29ef3..1e9dee98e3 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -531,12 +531,13 @@ class CChatSettingsDlg : public CChatBaseOptionDlg HTREEITEM hListHeading2 = nullptr;
CCtrlTreeView treeCheck;
- CCtrlEdit edtGroup;
+ CCtrlEdit edtGroup, edtAutocomplete;
public:
CChatSettingsDlg() :
CChatBaseOptionDlg(IDD_OPTIONS1),
edtGroup(this, IDC_GROUP),
+ edtAutocomplete(this, IDC_AUTOCOMPLETE),
treeCheck(this, IDC_CHECKBOXES)
{}
@@ -546,6 +547,9 @@ public: TreeViewInit(treeCheck, lvGroupsChat, lvItemsChat, CHAT_MODULE);
+ if (mir_wstrlen(g_Settings.pwszAutoText))
+ edtAutocomplete.SetText(g_Settings.pwszAutoText);
+
edtGroup.SetText(ptrW(Chat_GetGroup()));
return true;
}
@@ -554,6 +558,12 @@ public: {
Chat_SetGroup(ptrW(edtGroup.GetText()));
+ replaceStrW(g_Settings.pwszAutoText, edtAutocomplete.GetText());
+ if (mir_wstrlen(g_Settings.pwszAutoText))
+ db_set_ws(0, CHAT_MODULE, "TextAutocomplete", g_Settings.pwszAutoText);
+ else
+ db_unset(0, CHAT_MODULE, "TextAutocomplete");
+
TreeViewToDB(treeCheck, lvItemsChat, CHAT_MODULE, nullptr);
return true;
}
diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index c28f3a31a0..be0770e65d 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -128,6 +128,7 @@ #define IDC_GROUP 1057
#define IDC_CHKMERGEPOPUP 1058
#define IDC_IMGTAG 1058
+#define IDC_AUTOCOMPLETE 1058
#define IDC_SHOWURLS 1059
#define IDC_ANIAVATAR 1059
#define IDC_SCROLLFIX 1060
@@ -155,7 +156,6 @@ #define IDC_LOADCOUNTN 1074
#define IDC_TEXTO5 1074
#define IDC_LOADCOUNTSPIN 1076
-#define IDC_STATIC_ADD 1077
#define IDC_SHOWINFOLINE 1078
#define IDC_STATIC_ULIST 1078
#define IDC_STATIC_OTHER 1079
@@ -792,7 +792,7 @@ //
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 3add13cfd6..9fd934ded6 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -116,6 +116,7 @@ static void OnLoadSettings() g_Settings.bTabsEnable = db_get_b(0, CHAT_MODULE, "Tabs", 1) != 0; g_Settings.bTabsAtBottom = db_get_b(0, CHAT_MODULE, "TabBottom", 0) != 0; g_Settings.bTabCloseOnDblClick = db_get_b(0, CHAT_MODULE, "TabCloseOnDblClick", 0) != 0; + g_Settings.bAddColonToAutoComplete = db_get_b(0, CHAT_MODULE, "AddColonToAutoComplete", 1) != 0; g_Settings.iSplitterX = db_get_w(0, CHAT_MODULE, "SplitterX", 105); if (g_Settings.iSplitterX <= 50) diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 9d2e1ca151..00fe48a237 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -143,7 +143,9 @@ struct GlobalLogSettings : public GlobalLogSettingsBase {
int iX, iY;
int iSplitterX, iSplitterY;
+
bool bTabsEnable, bTabsAtBottom, bTabCloseOnDblClick;
+ bool bAddColonToAutoComplete;
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 2fc6966d28..64a36af0bd 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -225,7 +225,6 @@ void LoadGlobalSettings(void) g_Settings->bStripFormat = db_get_b(0, CHAT_MODULE, "StripFormatting", 0) != 0;
g_Settings->bTrayIconInactiveOnly = g_bChatTrayInactive;
g_Settings->bPopupInactiveOnly = g_bChatPopupInactive;
- g_Settings->bAddColonToAutoComplete = db_get_b(0, CHAT_MODULE, "AddColonToAutoComplete", 1) != 0;
g_Settings->iPopupStyle = db_get_b(0, CHAT_MODULE, "PopupStyle", 1);
g_Settings->iPopupTimeout = db_get_w(0, CHAT_MODULE, "PopupTimeout", 3);
g_Settings->crPUBkgColour = db_get_dw(0, CHAT_MODULE, "PopupColorBG", GetSysColor(COLOR_WINDOW));
|