summaryrefslogtreecommitdiff
path: root/plugins/StartupSilence/src
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2013-11-02 12:46:08 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2013-11-02 12:46:08 +0000
commit9d908611c335731a41f38c69acbb5aa42018d19d (patch)
tree1c6e44f0c6bf6f6b191fa642ec1f7c54c35c4f0a /plugins/StartupSilence/src
parent347e34fdae71d9a4878f21eee10450430df1a569 (diff)
- add external service
- add ability to display service popups on startup and filtered mode, such as keepstatus notification git-svn-id: http://svn.miranda-ng.org/main/trunk@6743 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StartupSilence/src')
-rw-r--r--plugins/StartupSilence/src/StartupSilence.h8
-rw-r--r--plugins/StartupSilence/src/main.cpp17
2 files changed, 23 insertions, 2 deletions
diff --git a/plugins/StartupSilence/src/StartupSilence.h b/plugins/StartupSilence/src/StartupSilence.h
index 41f0ae88d2..99cf3ed2be 100644
--- a/plugins/StartupSilence/src/StartupSilence.h
+++ b/plugins/StartupSilence/src/StartupSilence.h
@@ -31,11 +31,19 @@ void UpdateMenu();
void UpdateTTB();
INT_PTR SturtupSilenceEnabled(WPARAM wParam, LPARAM lParam);
+INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam);
#define MODULE_NAME "StartupSilence"
#define SS_SERVICE_NAME "StartupSilence/ToggleEnabled"
+#define SS_SILENCE_CONNECTION "StartupSilence/SilenceConnection"
+//StartupSilence/SilenceConnection
+//external service for mute sound and popups according to plugin settings
+//wParam = 2 - SilenceConnection is on
+//wParam = 0 - SilenceConnection is off
+//lParam = 0 - not in use
+
#define POPUPONOFF "Popup/ToggleEnabled"
#define POPUPONOFFPP "Popup/EnableDisableMenuCommand"
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp
index 208f2a2f9a..a3be4ce0ad 100644
--- a/plugins/StartupSilence/src/main.cpp
+++ b/plugins/StartupSilence/src/main.cpp
@@ -94,6 +94,7 @@ INT_PTR StartupSilence()
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
mir_forkthread((pThreadFunc)AdvSt, NULL);
CreateServiceFunction(SS_SERVICE_NAME, SturtupSilenceEnabled);
+ CreateServiceFunction(SS_SILENCE_CONNECTION, SilenceConnection);
IsMenu();
HookEvent(ME_OPT_INITIALISE, InitializeOptions);
return 0;
@@ -134,13 +135,16 @@ int DisablePopup(WPARAM wParam, LPARAM lParam)
if ((timer == 2 && NonStatusAllow == 1) //filtering while timer
|| (DefPopup == 1 && DefEnabled == 1)) //also filtered only: We do not run next lines every time
//if "Filtered only..." is unchecked --->
- {
+ {
HANDLE hContact = (HANDLE)wParam;
- if (hContact != NULL) {
+ if (hContact != NULL)
+ {
char* cp = GetContactProto(hContact);
if ( !strcmp(cp, "Weather") || !strcmp(cp, "mRadio") )
return 0;
}
+ else return 0; //allow popups for unread mail notification from MRA, keepstatus ... other services?
+
return 1; //filtering while timer
}
return 0; //---> just allow all popups with this return
@@ -278,6 +282,15 @@ static INT_PTR SturtupSilenceEnabled(WPARAM wParam, LPARAM lParam)
return 0;
}
+static INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam)
+{
+ timer = (BYTE)wParam;
+// if (timer == 2) //commented for now
+// db_set_b(NULL, "Skin", "UseSound", 0);
+// else db_set_b(NULL, "Skin", "UseSound", 1);
+ return 0;
+}
+
static INT_PTR InitMenu()
{
CLISTMENUITEM mi = {sizeof(mi)};