diff options
author | George Hazan <ghazan@miranda.im> | 2022-02-16 19:44:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-02-16 19:44:08 +0300 |
commit | e919cfd6e9891c0f15b0550a2936cc278a8ab235 (patch) | |
tree | 6de4a94d39899ff9254294b2fbb17f8454925ccd /plugins | |
parent | 2654e0d0443d3d66cc18e3f9923e667013b17f07 (diff) |
more fixes for #3027
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewEventNotify/res/resource.rc | 76 | ||||
-rw-r--r-- | plugins/NewEventNotify/src/options.cpp | 31 | ||||
-rw-r--r-- | plugins/NewEventNotify/src/resource.h | 3 |
3 files changed, 67 insertions, 43 deletions
diff --git a/plugins/NewEventNotify/res/resource.rc b/plugins/NewEventNotify/res/resource.rc index 7484fb0c98..b654e93e9e 100644 --- a/plugins/NewEventNotify/res/resource.rc +++ b/plugins/NewEventNotify/res/resource.rc @@ -24,55 +24,59 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Dialog
//
-IDD_OPT_MAIN DIALOGEX 0, 0, 314, 238
+IDD_OPT_MAIN DIALOGEX 0, 0, 302, 232
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_OPT_TREE,"SysTreeView32",TVS_DISABLEDRAGDROP | WS_BORDER | WS_HSCROLL | WS_TABSTOP,10,0,298,138
- GROUPBOX "Popup options",IDC_STATIC,7,139,298,79
- LTEXT "Text",IDC_STATIC,93,145,23,8
- LTEXT "Background",IDC_STATIC,142,145,44,8
- CTEXT "Timeout",IDC_STATIC,200,145,56,8
- LTEXT "Message",IDC_STATIC,13,158,44,8
- CONTROL "",IDC_COLTEXT_MESSAGE,"ColourPicker",WS_TABSTOP,93,157,39,11
- CONTROL "",IDC_COLBACK_MESSAGE,"ColourPicker",WS_TABSTOP,142,157,39,11
- CONTROL "",IDC_CHKDEFAULTCOL_MESSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,158,11,10
- EDITTEXT IDC_DELAY_MESSAGE,212,155,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_CHKINFINITE_MESSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,158,11,10
- LTEXT "File",IDC_STATIC,13,172,44,8
- CONTROL "",IDC_COLTEXT_FILE,"ColourPicker",WS_TABSTOP,93,171,39,11
- CONTROL "",IDC_COLBACK_FILE,"ColourPicker",WS_TABSTOP,142,171,39,11
- CONTROL "",IDC_CHKDEFAULTCOL_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,172,11,10
- EDITTEXT IDC_DELAY_FILE,212,170,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_CHKINFINITE_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,172,11,10
- LTEXT "Errors",IDC_STATIC,13,185,44,8
- CONTROL "",IDC_COLTEXT_ERR,"ColourPicker",WS_TABSTOP,93,185,39,11
- CONTROL "",IDC_COLBACK_ERR,"ColourPicker",WS_TABSTOP,142,185,39,11
- CONTROL "",IDC_CHKDEFAULTCOL_ERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,186,11,10
- EDITTEXT IDC_DELAY_ERR,212,184,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_CHKINFINITE_ERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,186,11,10
- LTEXT "Others",IDC_STATIC,13,200,44,8
- CONTROL "",IDC_COLTEXT_OTHERS,"ColourPicker",WS_TABSTOP,93,199,39,11
- CONTROL "",IDC_COLBACK_OTHERS,"ColourPicker",WS_TABSTOP,142,199,39,11
- CONTROL "",IDC_CHKDEFAULTCOL_OTHERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,200,11,10
- EDITTEXT IDC_DELAY_OTHERS,212,198,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_CHKINFINITE_OTHERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,200,11,10
- PUSHBUTTON "Preview",IDC_PREVIEW,245,222,60,12
+ CONTROL "",IDC_OPT_TREE,"SysTreeView32",TVS_DISABLEDRAGDROP | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,5,293,121
+ CONTROL "Limit message preview to",IDC_LIMITPREVIEW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,130,138,12
+ EDITTEXT IDC_MESSAGEPREVIEWLIMIT,153,130,37,13,ES_AUTOHSCROLL
+ CONTROL "",IDC_MESSAGEPREVIEWLIMITSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,196,130,9,13
+ LTEXT "characters",IDC_STATIC,210,131,82,10
+ GROUPBOX "Popup options",IDC_STATIC,7,143,291,73
+ LTEXT "Text",IDC_STATIC,93,149,23,8
+ LTEXT "Background",IDC_STATIC,142,149,44,8
+ CTEXT "Timeout",IDC_STATIC,200,149,56,8
+ LTEXT "Message",IDC_STATIC,13,162,44,8
+ CONTROL "",IDC_COLTEXT_MESSAGE,"ColourPicker",WS_TABSTOP,93,161,39,11
+ CONTROL "",IDC_COLBACK_MESSAGE,"ColourPicker",WS_TABSTOP,142,161,39,11
+ CONTROL "",IDC_CHKDEFAULTCOL_MESSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,162,11,10
+ EDITTEXT IDC_DELAY_MESSAGE,212,159,26,12,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_CHKINFINITE_MESSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,162,11,10
+ LTEXT "File",IDC_STATIC,13,175,44,8
+ CONTROL "",IDC_COLTEXT_FILE,"ColourPicker",WS_TABSTOP,93,174,39,11
+ CONTROL "",IDC_COLBACK_FILE,"ColourPicker",WS_TABSTOP,142,174,39,11
+ CONTROL "",IDC_CHKDEFAULTCOL_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,175,11,10
+ EDITTEXT IDC_DELAY_FILE,212,173,26,12,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_CHKINFINITE_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,175,11,10
+ LTEXT "Errors",IDC_STATIC,13,187,44,8
+ CONTROL "",IDC_COLTEXT_ERR,"ColourPicker",WS_TABSTOP,93,187,39,11
+ CONTROL "",IDC_COLBACK_ERR,"ColourPicker",WS_TABSTOP,142,187,39,11
+ CONTROL "",IDC_CHKDEFAULTCOL_ERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,188,11,10
+ EDITTEXT IDC_DELAY_ERR,212,186,26,12,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_CHKINFINITE_ERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,188,11,10
+ LTEXT "Others",IDC_STATIC,13,201,44,8
+ CONTROL "",IDC_COLTEXT_OTHERS,"ColourPicker",WS_TABSTOP,93,200,39,11
+ CONTROL "",IDC_COLBACK_OTHERS,"ColourPicker",WS_TABSTOP,142,200,39,11
+ CONTROL "",IDC_CHKDEFAULTCOL_OTHERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,201,11,10
+ EDITTEXT IDC_DELAY_OTHERS,212,199,26,12,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_CHKINFINITE_OTHERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,258,201,11,10
+ PUSHBUTTON "Preview",IDC_PREVIEW,239,218,60,13
END
-IDD_OPT_MESSAGE DIALOGEX 0, 0, 314, 148
+IDD_OPT_MESSAGE DIALOGEX 0, 0, 302, 148
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "Don't show popup when message dialog is already open",IDC_CHKWINDOWCHECK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,297,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,284,10
CONTROL "Hide popup when sending new message",IDC_CHKHIDESEND,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,20,297,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,20,284,10
CONTROL "Open reply dialog instead of reading the message",IDC_CHKREPLYWINDOW,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,32,297,11
- CONTROL "Merge popups from one user",IDC_CHKMERGEPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,63,295,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,32,284,11
+ CONTROL "Merge popups from one user",IDC_CHKMERGEPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,63,284,10
CONTROL "Show date",IDC_CHKSHOWDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,74,227,10
CONTROL "Show time",IDC_CHKSHOWTIME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,85,214,10
CONTROL "Show headers",IDC_CHKSHOWHEADERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,96,220,10
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp index b39975af81..7fb0e21e43 100644 --- a/plugins/NewEventNotify/src/options.cpp +++ b/plugins/NewEventNotify/src/options.cpp @@ -155,7 +155,8 @@ public: class COptionsMainDlg : public COptionsBaseDlg
{
- CCtrlCheck chkDefaultColorMsg, chkDefaultColorFile, chkDefaultColorErr, chkDefaultColorOthers;
+ CCtrlSpin spinLimit;
+ CCtrlCheck chkLimit, chkDefaultColorMsg, chkDefaultColorFile, chkDefaultColorErr, chkDefaultColorOthers;
CCtrlColor clrBackMessage, clrTextMessage, clrBackFile, clrTextFile, clrBackErr, clrTextErr, clrBackOther, clrTextOther;
CCtrlButton btnPreview;
CCtrlTreeOpts m_opts;
@@ -164,6 +165,8 @@ class COptionsMainDlg : public COptionsBaseDlg {
m_opts.OnApply();
+ g_plugin.iLimitPreview = (chkLimit.GetState()) ? spinLimit.GetPosition() : 0;
+
// update options
g_plugin.msg.bDefault = IsDlgButtonChecked(m_hwnd, IDC_CHKDEFAULTCOL_MESSAGE);
g_plugin.msg.backColor = clrBackMessage.GetColor();
@@ -172,7 +175,7 @@ class COptionsMainDlg : public COptionsBaseDlg g_plugin.file.bDefault = IsDlgButtonChecked(m_hwnd, IDC_CHKDEFAULTCOL_FILE);
g_plugin.file.backColor = clrBackFile.GetColor();
- g_plugin.file.textColor = clrBackFile.GetColor();
+ g_plugin.file.textColor = clrTextFile.GetColor();
g_plugin.file.iDelay = IsDlgButtonChecked(m_hwnd, IDC_CHKINFINITE_FILE) ? -1 : (uint32_t)GetDlgItemInt(m_hwnd, IDC_DELAY_FILE, nullptr, FALSE);
g_plugin.err.bDefault = IsDlgButtonChecked(m_hwnd, IDC_CHKDEFAULTCOL_ERR);
@@ -202,12 +205,15 @@ public: chkDefaultColorMsg(this, IDC_CHKDEFAULTCOL_MESSAGE),
chkDefaultColorFile(this, IDC_CHKDEFAULTCOL_FILE),
chkDefaultColorErr(this, IDC_CHKDEFAULTCOL_ERR),
- chkDefaultColorOthers(this, IDC_CHKDEFAULTCOL_OTHERS)
+ chkDefaultColorOthers(this, IDC_CHKDEFAULTCOL_OTHERS),
+ chkLimit(this, IDC_LIMITPREVIEW),
+ spinLimit(this, IDC_MESSAGEPREVIEWLIMITSPIN, 1000)
{
auto *pwszSection = TranslateT("General options");
m_opts.AddOption(pwszSection, TranslateT("Show entry in the Popups menu"), g_plugin.bMenuitem);
- m_opts.AddOption(pwszSection, TranslateT("Temporarily disable event popups"), g_plugin.bDisable);
m_opts.AddOption(pwszSection, TranslateT("Show preview of event in popup"), g_plugin.bPreview);
+ m_opts.AddOption(pwszSection, TranslateT("Disable event notifications for instant messages"), g_plugin.bDisable);
+ m_opts.AddOption(pwszSection, TranslateT("Disable event notifications for group chats"), g_plugin.bMUCDisable);
pwszSection = TranslateT("Notify me of...");
m_opts.AddOption(pwszSection, TranslateT("Message"), g_plugin.maskNotify, MASK_MESSAGE);
@@ -221,9 +227,9 @@ public: m_opts.AddOption(pwszSection, TranslateT("Dismiss event"), g_plugin.maskActL, MASK_REMOVE);
pwszSection = TranslateT("Right click actions");
- m_opts.AddOption(pwszSection, TranslateT("Dismiss popup"), g_plugin.maskActL, MASK_DISMISS);
- m_opts.AddOption(pwszSection, TranslateT("Open event"), g_plugin.maskActL, MASK_OPEN);
- m_opts.AddOption(pwszSection, TranslateT("Dismiss event"), g_plugin.maskActL, MASK_REMOVE);
+ m_opts.AddOption(pwszSection, TranslateT("Dismiss popup"), g_plugin.maskActR, MASK_DISMISS);
+ m_opts.AddOption(pwszSection, TranslateT("Open event"), g_plugin.maskActR, MASK_OPEN);
+ m_opts.AddOption(pwszSection, TranslateT("Dismiss event"), g_plugin.maskActR, MASK_REMOVE);
pwszSection = TranslateT("Timeout actions");
m_opts.AddOption(pwszSection, TranslateT("Dismiss popup"), g_plugin.maskActTE, MASK_DISMISS);
@@ -236,6 +242,7 @@ public: btnPreview.OnClick = Callback(this, &COptionsMainDlg::onClick_Preview);
+ chkLimit.OnChange = Callback(this, &COptionsMainDlg::onChange_Limit);
chkDefaultColorMsg.OnChange = Callback(this, &COptionsMainDlg::onChange_DefaultMsg);
chkDefaultColorFile.OnChange = Callback(this, &COptionsMainDlg::onChange_DefaultFile);
chkDefaultColorErr.OnChange = Callback(this, &COptionsMainDlg::onChange_DefaultErr);
@@ -254,6 +261,9 @@ public: clrBackOther.SetColor(g_plugin.other.backColor);
clrTextOther.SetColor(g_plugin.other.textColor);
+ chkLimit.SetState(g_plugin.iLimitPreview > 0);
+ spinLimit.SetPosition(g_plugin.iLimitPreview);
+
chkDefaultColorMsg.SetState(g_plugin.msg.bDefault);
chkDefaultColorFile.SetState(g_plugin.file.bDefault);
chkDefaultColorErr.SetState(g_plugin.err.bDefault);
@@ -299,6 +309,13 @@ public: PopupShow(0, 0, -1);
}
+ void onChange_Limit(CCtrlCheck *)
+ {
+ bool bEnabled = chkLimit.GetState();
+ spinLimit.Enable(bEnabled);
+ EnableDlgItem(m_hwnd, IDC_MESSAGEPREVIEWLIMIT, bEnabled);
+ }
+
void onChange_DefaultMsg(CCtrlCheck *)
{
bool bEnabled = chkDefaultColorMsg.GetState();
diff --git a/plugins/NewEventNotify/src/resource.h b/plugins/NewEventNotify/src/resource.h index de868af136..cc09b63989 100644 --- a/plugins/NewEventNotify/src/resource.h +++ b/plugins/NewEventNotify/src/resource.h @@ -5,6 +5,9 @@ #define IDD_OPT_MAIN 101
#define IDD_OPT_MESSAGE 102
#define IDC_PREVIEW 1000
+#define IDC_LIMITPREVIEW 1001
+#define IDC_MESSAGEPREVIEWLIMIT 1002
+#define IDC_MESSAGEPREVIEWLIMITSPIN 1003
#define IDC_CHKWINDOWCHECK 1013
#define IDC_CHKREPLYWINDOW 1014
#define IDC_DELAY_ERR 1015
|