[Pkg-mozext-commits] [firetray] 246/399: added functions to run scripts on new / no new mail... should be working
David Prévot
taffit at alioth.debian.org
Tue Oct 29 18:23:52 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch dfsg-clean
in repository firetray.
commit 51edcf43771af3c9aed8960688f470414a730714
Author: David Wille <david.wille at ewetel.net>
Date: Sun May 13 21:35:42 2012 +0200
added functions to run scripts on new / no new mail... should be working
---
src/modules/FiretrayMessaging.jsm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/src/modules/FiretrayMessaging.jsm b/src/modules/FiretrayMessaging.jsm
index f7dddb8..2253ec6 100644
--- a/src/modules/FiretrayMessaging.jsm
+++ b/src/modules/FiretrayMessaging.jsm
@@ -138,6 +138,36 @@ firetray.Messaging = {
}
}
},
+
+ runNewMailScript: function() {
+ // create a file for the process
+ var file = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(firetray.Utils.prefService.getCharPref("new_mail_script"));
+
+ // create the process
+ var process = Components.classes["@mozilla.org/process/util;1"]
+ .createInstance(Components.interfaces.nsIProcess);
+ process.init(file);
+
+ var args = [ ];
+ process.run(false, args, args.length);
+ },
+
+ runNoNewMailScript: function() {
+ // create a file for the process
+ var file = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(firetray.Utils.prefService.getCharPref("no_new_mail_script"));
+
+ // create the process
+ var process = Components.classes["@mozilla.org/process/util;1"]
+ .createInstance(Components.interfaces.nsIProcess);
+ process.init(file);
+
+ var args = [ ];
+ process.run(false, args, args.length);
+ },
/**
* computes and display new msg count
@@ -168,8 +198,10 @@ firetray.Messaging = {
if (newMsgCount == 0) {
firetray.Handler.setIconImageDefault();
firetray.Handler.setIconTooltipDefault();
+ this.runNoNewMailScript();
} else if (newMsgCount > 0) {
+ this.runNewMailScript();
let prefMailNotification = firetray.Utils.prefService.getIntPref('mail_notification_type');
switch (prefMailNotification) {
case FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git
More information about the Pkg-mozext-commits
mailing list