summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-03-02 16:56:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-03-02 16:56:34 +0300
commitec8df0b2db28de4184dfc868044dba41cc91d0f0 (patch)
tree97a21bc4a1a934e31de172778bb146f12e149a48 /plugins
parente408bf603abd2e8afa2c838a411ad52f5a6a7c92 (diff)
NEN: correct processing of timeouts = -1
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewEventNotify/res/resource.rc37
-rw-r--r--plugins/NewEventNotify/src/popup.cpp6
-rw-r--r--plugins/NewEventNotify/src/stdafx.h2
3 files changed, 25 insertions, 20 deletions
diff --git a/plugins/NewEventNotify/res/resource.rc b/plugins/NewEventNotify/res/resource.rc
index ab1cef6785..0a2ba370ad 100644
--- a/plugins/NewEventNotify/res/resource.rc
+++ b/plugins/NewEventNotify/res/resource.rc
@@ -32,37 +32,38 @@ BEGIN
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
+ CONTROL "",IDC_MESSAGEPREVIEWLIMITSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,192,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
+ CTEXT "Timeout, secs",IDC_STATIC,214,149,78,8
LTEXT "Message",IDC_STATIC,13,162,44,8
- CONTROL "",IDC_COLTEXT_MESSAGE,"ColourPicker",WS_TABSTOP,93,161,39,10
- CONTROL "",IDC_COLBACK_MESSAGE,"ColourPicker",WS_TABSTOP,142,161,39,10
+ CONTROL "",IDC_COLTEXT_MESSAGE,"ColourPicker",WS_TABSTOP,93,161,40,10
+ CONTROL "",IDC_COLBACK_MESSAGE,"ColourPicker",WS_TABSTOP,142,161,40,10
CONTROL "",IDC_CHKDEFAULTCOL_MESSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,161,11,10
- EDITTEXT IDC_DELAY_MESSAGE,212,160,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_SPIN_MESSAGE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,258,160,11,12
+ EDITTEXT IDC_DELAY_MESSAGE,230,160,46,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN_MESSAGE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,278,160,11,12
LTEXT "File",IDC_STATIC,13,175,44,8
- CONTROL "",IDC_COLTEXT_FILE,"ColourPicker",WS_TABSTOP,93,174,39,10
- CONTROL "",IDC_COLBACK_FILE,"ColourPicker",WS_TABSTOP,142,174,39,10
+ CONTROL "",IDC_COLTEXT_FILE,"ColourPicker",WS_TABSTOP,93,174,40,10
+ CONTROL "",IDC_COLBACK_FILE,"ColourPicker",WS_TABSTOP,142,174,40,10
CONTROL "",IDC_CHKDEFAULTCOL_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,174,11,10
- EDITTEXT IDC_DELAY_FILE,212,173,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_SPIN_FILE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,258,173,11,12
+ EDITTEXT IDC_DELAY_FILE,230,173,46,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN_FILE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,277,173,11,12
LTEXT "Errors",IDC_STATIC,13,187,44,8
- CONTROL "",IDC_COLTEXT_ERR,"ColourPicker",WS_TABSTOP,93,187,39,10
- CONTROL "",IDC_COLBACK_ERR,"ColourPicker",WS_TABSTOP,142,187,39,10
+ CONTROL "",IDC_COLTEXT_ERR,"ColourPicker",WS_TABSTOP,93,187,40,10
+ CONTROL "",IDC_COLBACK_ERR,"ColourPicker",WS_TABSTOP,142,187,40,10
CONTROL "",IDC_CHKDEFAULTCOL_ERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,187,11,10
- EDITTEXT IDC_DELAY_ERR,212,186,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_SPIN_ERR,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,258,186,11,12
+ EDITTEXT IDC_DELAY_ERR,230,186,46,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN_ERR,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,277,186,11,12
LTEXT "Others",IDC_STATIC,13,201,44,8
- CONTROL "",IDC_COLTEXT_OTHERS,"ColourPicker",WS_TABSTOP,93,200,39,10
- CONTROL "",IDC_COLBACK_OTHERS,"ColourPicker",WS_TABSTOP,142,200,39,10
+ CONTROL "",IDC_COLTEXT_OTHERS,"ColourPicker",WS_TABSTOP,93,200,40,10
+ CONTROL "",IDC_COLBACK_OTHERS,"ColourPicker",WS_TABSTOP,142,200,40,10
CONTROL "",IDC_CHKDEFAULTCOL_OTHERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,200,11,10
- EDITTEXT IDC_DELAY_OTHERS,212,199,26,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_SPIN_OTHERS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,258,199,11,12
+ EDITTEXT IDC_DELAY_OTHERS,230,199,46,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN_OTHERS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,277,199,11,12
PUSHBUTTON "Preview",IDC_PREVIEW,239,218,60,13
+ LTEXT "(timeout -1 means forever, 0 - default)",IDC_STATIC,7,219,227,8
END
IDD_OPT_MESSAGE DIALOGEX 0, 0, 302, 148
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 87ac31875a..6f70f20e25 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -374,7 +374,11 @@ int PopupShow(MCONTACT hContact, MEVENT hEvent, UINT eventType)
pdata->eventType = eventType;
pdata->hContact = hContact;
pdata->events.push_back(hEvent);
- pdata->iSeconds = (iSeconds > 0) ? iSeconds : g_plugin.iDelayDefault;
+ switch (iSeconds) {
+ case -1: pdata->iSeconds = 65535; break; // kinda forrever
+ case 0: pdata->iSeconds = g_plugin.iDelayDefault; break;
+ default: pdata->iSeconds = iSeconds; break;
+ }
// finally create the popup
pudw.lchContact = hContact;
diff --git a/plugins/NewEventNotify/src/stdafx.h b/plugins/NewEventNotify/src/stdafx.h
index 9262f1a608..1e0f5d515a 100644
--- a/plugins/NewEventNotify/src/stdafx.h
+++ b/plugins/NewEventNotify/src/stdafx.h
@@ -57,7 +57,7 @@
#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
-#define DEFAULT_DELAY -1
+#define DEFAULT_DELAY 0
#define EVENTTYPE_ERRMSG 25366