[Pkg-mozext-commits] [firetray] 309/399: fix correctMailNotificationType()

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:24:04 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 90cd161f3c64b8ba69637c64ee317d60a83752ec
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Fri Sep 7 17:20:38 2012 +0200

    fix correctMailNotificationType()
---
 src/chrome/content/options.js     |    6 +++---
 src/modules/FiretrayHandler.jsm   |    6 ++++--
 src/modules/FiretrayMessaging.jsm |    2 +-
 src/modules/commons.js            |   12 ++++++------
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js
index 3fe06d7..25e5b27 100644
--- a/src/chrome/content/options.js
+++ b/src/chrome/content/options.js
@@ -194,7 +194,7 @@ var firetrayUIOptions = {
 
   initNotificationSettings: function() {
     document.getElementById("ui_radio_mail_notification_unread_count").value =
-      FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT;
+      FIRETRAY_NOTIFICATION_MESSAGE_COUNT;
     document.getElementById("ui_radio_mail_notification_newmail_icon").value =
       FIRETRAY_NOTIFICATION_NEWMAIL_ICON;
     document.getElementById("ui_radio_mail_notification_custom_mail_icon").value =
@@ -258,7 +258,7 @@ var firetrayUIOptions = {
 
     let iconTextColor = document.getElementById("icon_text_color");
     this.disableChildren(iconTextColor,
-      (notificationSetting !== FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT));
+      (notificationSetting !== FIRETRAY_NOTIFICATION_MESSAGE_COUNT));
 
     let newMailIconNames = document.getElementById("newmail_icon_names");
     this.disableNChildren(newMailIconNames, 2,
@@ -278,7 +278,7 @@ var firetrayUIOptions = {
 
     let radioMailNotify = document.getElementById("ui_radiogroup_mail_notification");
     let mailNotificationType = +radioMailNotify.getItemAtIndex(radioMailNotify.selectedIndex).value;
-    if (msgCountTypeIsNewMessages && (mailNotificationType === FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT)) {
+    if (msgCountTypeIsNewMessages && (mailNotificationType === FIRETRAY_NOTIFICATION_MESSAGE_COUNT)) {
       radioMailNotify.selectedIndex = this.radioGetIndexByValue(radioMailNotify, FIRETRAY_NOTIFICATION_NEWMAIL_ICON);
       let newMailIconNames = document.getElementById("newmail_icon_names");
       this.disableNChildren(newMailIconNames, 2, false);
diff --git a/src/modules/FiretrayHandler.jsm b/src/modules/FiretrayHandler.jsm
index 8f4f41b..5a031e6 100644
--- a/src/modules/FiretrayHandler.jsm
+++ b/src/modules/FiretrayHandler.jsm
@@ -484,8 +484,10 @@ firetray.VersionChangeHandler = {
   },
 
   correctMailNotificationType: function() {
-    if (firetray.Utils.prefService.getIntPref('message_count_type') ===
-        FIRETRAY_MESSAGE_COUNT_TYPE_NEW) {
+    let msgCountType = firetray.Utils.prefService.getIntPref('message_count_type');
+    let mailNotificationType = firetray.Utils.prefService.getIntPref('mail_notification_type');
+    if (msgCountType === FIRETRAY_MESSAGE_COUNT_TYPE_NEW &&
+        mailNotificationType === FIRETRAY_NOTIFICATION_MESSAGE_COUNT) {
       firetray.Utils.prefService.setIntPref('mail_notification_type',
         FIRETRAY_NOTIFICATION_NEWMAIL_ICON);
       log.warn("mail notification type set to newmail icon.");
diff --git a/src/modules/FiretrayMessaging.jsm b/src/modules/FiretrayMessaging.jsm
index 0b64ac1..39a8816 100644
--- a/src/modules/FiretrayMessaging.jsm
+++ b/src/modules/FiretrayMessaging.jsm
@@ -213,7 +213,7 @@ firetray.Messaging = {
     } else if (msgCount > 0) {
       let prefMailNotification = firetray.Utils.prefService.getIntPref('mail_notification_type');
       switch (prefMailNotification) {
-      case FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT:
+      case FIRETRAY_NOTIFICATION_MESSAGE_COUNT:
         let prefIconTextColor = firetray.Utils.prefService.getCharPref("icon_text_color");
         firetray.Handler.setIconText(msgCount.toString(), prefIconTextColor);
         break;
diff --git a/src/modules/commons.js b/src/modules/commons.js
index ecfd80e..33281e0 100644
--- a/src/modules/commons.js
+++ b/src/modules/commons.js
@@ -6,7 +6,7 @@ var EXPORTED_SYMBOLS =
   [ "firetray", "FIRETRAY_ID", "FIRETRAY_VERSION", "FIRETRAY_PREF_BRANCH",
     "FIRETRAY_SPLASH_PAGE", "FIRETRAY_APPLICATION_ICON_TYPE_THEMED",
     "FIRETRAY_APPLICATION_ICON_TYPE_CUSTOM",
-    "FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT",
+    "FIRETRAY_NOTIFICATION_MESSAGE_COUNT",
     "FIRETRAY_NOTIFICATION_NEWMAIL_ICON", "FIRETRAY_NOTIFICATION_CUSTOM_ICON",
     "FIRETRAY_IM_STATUS_AVAILABLE", "FIRETRAY_IM_STATUS_AWAY",
     "FIRETRAY_IM_STATUS_BUSY", "FIRETRAY_IM_STATUS_OFFLINE",
@@ -33,12 +33,12 @@ const FIRETRAY_SPLASH_PAGE = "http://foudfou.github.com/FireTray/";
 const FIRETRAY_APPLICATION_ICON_TYPE_THEMED = 0;
 const FIRETRAY_APPLICATION_ICON_TYPE_CUSTOM = 1;
 
-const FIRETRAY_MESSAGE_COUNT_TYPE_UNREAD         = 0;
-const FIRETRAY_MESSAGE_COUNT_TYPE_NEW            = 1;
+const FIRETRAY_MESSAGE_COUNT_TYPE_UNREAD  = 0;
+const FIRETRAY_MESSAGE_COUNT_TYPE_NEW     = 1;
 
-const FIRETRAY_NOTIFICATION_UNREAD_MESSAGE_COUNT = 0;
-const FIRETRAY_NOTIFICATION_NEWMAIL_ICON         = 1;
-const FIRETRAY_NOTIFICATION_CUSTOM_ICON          = 2;
+const FIRETRAY_NOTIFICATION_MESSAGE_COUNT = 0;
+const FIRETRAY_NOTIFICATION_NEWMAIL_ICON  = 1;
+const FIRETRAY_NOTIFICATION_CUSTOM_ICON   = 2;
 
 const FIRETRAY_IM_STATUS_AVAILABLE = "user-available";
 const FIRETRAY_IM_STATUS_AWAY      = "user-away";

-- 
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