From 90239852e737675444727f45c2b6eb0ced31f989 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 12 Feb 2022 11:55:11 +0300 Subject: minor interface glitches in NEN --- plugins/NewEventNotify/src/menuitem.cpp | 6 +++--- plugins/NewEventNotify/src/options.cpp | 10 ++++++---- plugins/NewEventNotify/src/popup.cpp | 9 +++++++++ plugins/NewEventNotify/src/stdafx.h | 13 ++++--------- 4 files changed, 22 insertions(+), 16 deletions(-) (limited to 'plugins/NewEventNotify/src') 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 -- cgit v1.2.3