summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-02-12 11:55:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-02-12 11:55:11 +0300
commit90239852e737675444727f45c2b6eb0ced31f989 (patch)
treec1e3f7321d8be6daf7484fb42e2013ec676877c8 /plugins
parentc9a014304af901c2266e1170b030956e8601e293 (diff)
minor interface glitches in NEN
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewEventNotify/res/resource.rc2
-rw-r--r--plugins/NewEventNotify/src/menuitem.cpp6
-rw-r--r--plugins/NewEventNotify/src/options.cpp10
-rw-r--r--plugins/NewEventNotify/src/popup.cpp9
-rw-r--r--plugins/NewEventNotify/src/stdafx.h13
5 files changed, 23 insertions, 17 deletions
diff --git a/plugins/NewEventNotify/res/resource.rc b/plugins/NewEventNotify/res/resource.rc
index 8f31179fef..7484fb0c98 100644
--- a/plugins/NewEventNotify/res/resource.rc
+++ b/plugins/NewEventNotify/res/resource.rc
@@ -61,7 +61,7 @@ BEGIN
PUSHBUTTON "Preview",IDC_PREVIEW,245,222,60,12
END
-IDD_OPT_MESSAGE DIALOGEX 0, 0, 314, 252
+IDD_OPT_MESSAGE DIALOGEX 0, 0, 314, 148
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp
index 6b29935b6f..42cb38e813 100644
--- a/plugins/NewEventNotify/src/menuitem.cpp
+++ b/plugins/NewEventNotify/src/menuitem.cpp
@@ -48,8 +48,6 @@ int MenuitemUpdate(BOOL bStatus)
int MenuitemInit(BOOL bStatus)
{
- CreateServiceFunction(MS_NEN_MENUNOTIFY, MenuitemNotifyCmd);
-
HGENMENU hRoot = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0);
CMenuItem mi(&g_plugin);
@@ -57,10 +55,12 @@ int MenuitemInit(BOOL bStatus)
mi.root = hRoot;
mi.position = 1;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_POPUP);
- mi.pszService = MS_NEN_MENUNOTIFY;
+ mi.pszService = "NewEventNotify/MenuitemNotifyCommand";
mi.flags = 0;
hMenuitemNotify = Menu_AddMainMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, MenuitemNotifyCmd);
+
bNotify = bStatus;
MenuitemUpdate(bNotify);
return 0;
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp
index 3b0d19c98f..b39975af81 100644
--- a/plugins/NewEventNotify/src/options.cpp
+++ b/plugins/NewEventNotify/src/options.cpp
@@ -55,10 +55,10 @@ void CMPlugin::OptionsRead(void)
other.textColor = getDword(OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
other.iDelay = getDword(OPT_DELAY_OTHERS, DEFAULT_DELAY);
- maskNotify = getByte(OPT_MASKNOTIFY, DEFAULT_MASKNOTIFY);
- maskActL = getByte(OPT_MASKACTL, DEFAULT_MASKACTL);
- maskActR = getByte(OPT_MASKACTR, DEFAULT_MASKACTR);
- maskActTE = getByte(OPT_MASKACTTE, DEFAULT_MASKACTE);
+ maskNotify = getByte(OPT_MASKNOTIFY, MASK_MESSAGE | MASK_ERROR | MASK_FILE | MASK_OTHER);
+ maskActL = getByte(OPT_MASKACTL, MASK_OPEN | MASK_REMOVE | MASK_DISMISS);
+ maskActR = getByte(OPT_MASKACTR, MASK_REMOVE | MASK_DISMISS);
+ maskActTE = getByte(OPT_MASKACTTE, MASK_DISMISS);
iDelayDefault = DBGetContactSettingRangedWord(NULL, "Popup", "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
@@ -211,6 +211,7 @@ public:
pwszSection = TranslateT("Notify me of...");
m_opts.AddOption(pwszSection, TranslateT("Message"), g_plugin.maskNotify, MASK_MESSAGE);
+ m_opts.AddOption(pwszSection, TranslateT("Error"), g_plugin.maskNotify, MASK_ERROR);
m_opts.AddOption(pwszSection, TranslateT("File"), g_plugin.maskNotify, MASK_FILE);
m_opts.AddOption(pwszSection, TranslateT("Others"), g_plugin.maskNotify, MASK_OTHER);
@@ -293,6 +294,7 @@ public:
{
GrabData();
PopupShow(0, 0, EVENTTYPE_MESSAGE);
+ PopupShow(0, 0, EVENTTYPE_ERRMSG);
PopupShow(0, 0, EVENTTYPE_FILE);
PopupShow(0, 0, -1);
}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index b991a40c7c..d4830b95d6 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -367,6 +367,15 @@ int PopupShow(MCONTACT hContact, MEVENT hEvent, UINT eventType)
sampleEvent = TranslateT("This is a sample file event :-D");
break;
+ case EVENTTYPE_ERRMSG:
+ if (!(g_plugin.maskNotify & MASK_ERROR)) return 1;
+ pudw.lchIcon = Skin_LoadIcon(SKINICON_OTHER_DELETE);
+ pudw.colorBack = g_plugin.err.bDefault ? 0 : g_plugin.err.backColor;
+ pudw.colorText = g_plugin.err.bDefault ? 0 : g_plugin.err.textColor;
+ iSeconds = g_plugin.err.iDelay;
+ sampleEvent = TranslateT("This is a sample error event :-D");
+ break;
+
default:
if (!(g_plugin.maskNotify & MASK_OTHER)) return 1;
pudw.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/NewEventNotify/src/stdafx.h b/plugins/NewEventNotify/src/stdafx.h
index bcb4362ab8..78b8021640 100644
--- a/plugins/NewEventNotify/src/stdafx.h
+++ b/plugins/NewEventNotify/src/stdafx.h
@@ -48,10 +48,6 @@
#include "resource.h"
#include "version.h"
-//VERY_PUBLIC Begin ... will be moved to m_neweventnotify.h
-#define MS_NEN_MENUNOTIFY "NewEventNotify/MenuitemNotifyCommand"
-//VERY_PUBLIC End
-
//---------------------------
//---Definitions
@@ -59,13 +55,12 @@
#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
-#define DEFAULT_MASKNOTIFY (MASK_MESSAGE|MASK_FILE|MASK_OTHER)
-#define DEFAULT_MASKACTL (MASK_OPEN|MASK_REMOVE|MASK_DISMISS)
-#define DEFAULT_MASKACTR (MASK_REMOVE|MASK_DISMISS)
-#define DEFAULT_MASKACTE (MASK_DISMISS)
-#define DEFAULT_DELAY -1
+#define DEFAULT_DELAY -1
+
+#define EVENTTYPE_ERRMSG 25366
#define MASK_MESSAGE 0x0001
+#define MASK_ERROR 0x0002
#define MASK_FILE 0x0004
#define MASK_OTHER 0x0008