[Pkg-mozext-commits] [firetray] 372/399: * fix merge: ChatStatusIcon.stopCrossFading() was defined twice * fix: ChatStatusIcon.dropPixBuf() at right time * cleaning

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:24:16 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 5ddf23a59d436fe8801bb158af16d9b4ae42d023
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Thu May 30 22:52:01 2013 +0200

    * fix merge: ChatStatusIcon.stopCrossFading() was defined twice
    * fix: ChatStatusIcon.dropPixBuf() at right time
    * cleaning
---
 src/chrome/content/options.js                |    4 ++--
 src/chrome/content/options.xul               |    2 +-
 src/chrome/locale/en-US/options.dtd          |    2 +-
 src/modules/FiretrayChat.jsm                 |   12 +++++-----
 src/modules/FiretrayHandler.jsm              |   10 ++++----
 src/modules/commons.js                       |    6 ++---
 src/modules/linux/FiretrayChatStatusIcon.jsm |   33 ++++++++++----------------
 7 files changed, 31 insertions(+), 38 deletions(-)

diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js
index 5029789..bde3d46 100644
--- a/src/chrome/content/options.js
+++ b/src/chrome/content/options.js
@@ -233,8 +233,8 @@ var firetrayUIOptions = {
   initChatBlinkSettings: function() {
     document.getElementById("ui_chat_icon_blink_style_normal").value =
       FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL;
-    document.getElementById("ui_chat_icon_blink_style_cross_fade").value =
-      FIRETRAY_CHAT_ICON_BLINK_STYLE_CROSS_FADE;
+    document.getElementById("ui_chat_icon_blink_style_fade").value =
+      FIRETRAY_CHAT_ICON_BLINK_STYLE_FADE;
 
     let blinkStyle = document.getElementById("ui_chat_icon_blink_style");
     let prefBlinkStyle = firetray.Utils.prefService.getIntPref("chat_icon_blink_style");
diff --git a/src/chrome/content/options.xul b/src/chrome/content/options.xul
index 78db2b1..f501e31 100644
--- a/src/chrome/content/options.xul
+++ b/src/chrome/content/options.xul
@@ -333,7 +333,7 @@
           <radio id="ui_chat_icon_blink_style_normal" label="&chat_icon_blink_style_normal;"
                  oncommand="firetrayUIOptions.updateChatBlinkSettings()"
                  observes="broadcaster-chat-icon-disabled"/>
-          <radio id="ui_chat_icon_blink_style_cross_fade" label="&chat_icon_blink_style_cross_fade;"
+          <radio id="ui_chat_icon_blink_style_fade" label="&chat_icon_blink_style_fade;"
                  oncommand="firetrayUIOptions.updateChatBlinkSettings()"
                  observes="broadcaster-chat-icon-disabled"/>
         </hbox>
diff --git a/src/chrome/locale/en-US/options.dtd b/src/chrome/locale/en-US/options.dtd
index 8c6e370..4105d5c 100644
--- a/src/chrome/locale/en-US/options.dtd
+++ b/src/chrome/locale/en-US/options.dtd
@@ -97,4 +97,4 @@
 <!ENTITY chat_icon_blink_style.label "Blink style">
 <!ENTITY chat_icon_blink_style.accesskey "B">
 <!ENTITY chat_icon_blink_style_normal "Simple">
-<!ENTITY chat_icon_blink_style_cross_fade "Cross-fade">
+<!ENTITY chat_icon_blink_style_fade "Fade">
diff --git a/src/modules/FiretrayChat.jsm b/src/modules/FiretrayChat.jsm
index eace0a7..981d3b9 100644
--- a/src/modules/FiretrayChat.jsm
+++ b/src/modules/FiretrayChat.jsm
@@ -145,9 +145,9 @@ firetray.Chat = {
     let blinkStyle = firetray.Utils.prefService.getIntPref("chat_icon_blink_style");
     log.debug("chat_icon_blink_style="+blinkStyle);
     if (blinkStyle === FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL)
-      firetray.ChatStatusIcon.startIconBlinking();
-    else if (blinkStyle === FIRETRAY_CHAT_ICON_BLINK_STYLE_CROSS_FADE)
-      firetray.ChatStatusIcon.startCrossFading();
+      firetray.ChatStatusIcon.startBlinking();
+    else if (blinkStyle === FIRETRAY_CHAT_ICON_BLINK_STYLE_FADE)
+      firetray.ChatStatusIcon.startFading();
     else
       throw new Error("Undefined chat icon blink style.");
   },
@@ -181,9 +181,9 @@ firetray.Chat = {
 
     let blinkStyle = firetray.Utils.prefService.getIntPref("chat_icon_blink_style");
     if (blinkStyle === FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL)
-      firetray.ChatStatusIcon.stopIconBlinking();
-    else if (blinkStyle === FIRETRAY_CHAT_ICON_BLINK_STYLE_CROSS_FADE)
-      firetray.ChatStatusIcon.stopCrossFading();
+      firetray.ChatStatusIcon.stopBlinking();
+    else if (blinkStyle === FIRETRAY_CHAT_ICON_BLINK_STYLE_FADE)
+      firetray.ChatStatusIcon.stopFading();
     else
       throw new Error("Undefined chat icon blink style.");
   },
diff --git a/src/modules/FiretrayHandler.jsm b/src/modules/FiretrayHandler.jsm
index 24dd138..26fc424 100644
--- a/src/modules/FiretrayHandler.jsm
+++ b/src/modules/FiretrayHandler.jsm
@@ -497,12 +497,12 @@ firetray.PrefListener = new PrefListener(
 
       switch (firetray.Utils.prefService.getIntPref("chat_icon_blink_style")) {
       case FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL:
-        firetray.ChatStatusIcon.stopCrossFading();
-        firetray.ChatStatusIcon.startIconBlinking();
+        firetray.ChatStatusIcon.stopFading();
+        firetray.ChatStatusIcon.startBlinking();
         break;
-      case FIRETRAY_CHAT_ICON_BLINK_STYLE_CROSS_FADE:
-        firetray.ChatStatusIcon.stopIconBlinking();
-        firetray.ChatStatusIcon.startCrossFading();
+      case FIRETRAY_CHAT_ICON_BLINK_STYLE_FADE:
+        firetray.ChatStatusIcon.stopBlinking();
+        firetray.ChatStatusIcon.startFading();
         break;
       default:
         throw new Error("Undefined chat icon blink style.");
diff --git a/src/modules/commons.js b/src/modules/commons.js
index 0b15664..8d57c1d 100644
--- a/src/modules/commons.js
+++ b/src/modules/commons.js
@@ -16,7 +16,7 @@ var EXPORTED_SYMBOLS =
     "FIRETRAY_DELAY_PREF_CLEANING_MILLISECONDS",
     "FIRETRAY_MESSAGE_COUNT_TYPE_UNREAD", "FIRETRAY_MESSAGE_COUNT_TYPE_NEW",
     "FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL",
-    "FIRETRAY_CHAT_ICON_BLINK_STYLE_CROSS_FADE",
+    "FIRETRAY_CHAT_ICON_BLINK_STYLE_FADE",
     "FIRETRAY_APP_DB" ];
 
 const Cc = Components.classes;
@@ -52,8 +52,8 @@ const FIRETRAY_DELAY_STARTUP_MILLISECONDS       = 500;
 const FIRETRAY_DELAY_NOWAIT_MILLISECONDS        = 0;
 const FIRETRAY_DELAY_PREF_CLEANING_MILLISECONDS = 15*60*1000;
 
-const FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL     = 0;
-const FIRETRAY_CHAT_ICON_BLINK_STYLE_CROSS_FADE = 1;
+const FIRETRAY_CHAT_ICON_BLINK_STYLE_NORMAL = 0;
+const FIRETRAY_CHAT_ICON_BLINK_STYLE_FADE   = 1;
 
 const FIRETRAY_APP_DB = {
 
diff --git a/src/modules/linux/FiretrayChatStatusIcon.jsm b/src/modules/linux/FiretrayChatStatusIcon.jsm
index 9115778..55dae2e 100644
--- a/src/modules/linux/FiretrayChatStatusIcon.jsm
+++ b/src/modules/linux/FiretrayChatStatusIcon.jsm
@@ -134,8 +134,7 @@ firetray.ChatStatusIcon = {
       alpha_bak[(i-3)/n_channels] = pixels.contents[i];
 
     log.debug("pixbuf created");
-
-    let ret = {
+    return {
       pixbuf: pixbuf,           // TO BE UNREFED WITH to g_object_unref() !!
       width: width,
       height: height,
@@ -145,15 +144,14 @@ firetray.ChatStatusIcon = {
       buffer: buffer,
       alpha_bak: alpha_bak
     };
-    return ret;
   },
   dropPixBuf: function(p) {
-    gobject.g_object_unref(p.pixbuf); // FIXME: not sure if this shouldn't be done at 'stop-cross-fade'
+    gobject.g_object_unref(p.pixbuf);
     log.debug("pixbuf unref'd");
   },
 
-  startCrossFading: function() {  // TODO: Foudil: rename to startFading
-    log.debug("startCrossFading");
+  startFading: function() {
+    log.debug("startFading");
     const ALPHA_STEP                    = 5;
     const ALPHA_STEP_SLEEP_MILLISECONDS = 10;
     const FADE_OVER_SLEEP_MILLISECONDS  = 500;
@@ -187,9 +185,11 @@ firetray.ChatStatusIcon = {
                                  Ci.nsITimer.TYPE_ONE_SHOT, step);
         } catch (e if e instanceof StopIteration) {
 
-          if (firetray.ChatStatusIcon.events['stop-cross-fade']) {
-            delete firetray.ChatStatusIcon.events['stop-cross-fade'];
+          if (firetray.ChatStatusIcon.events['stop-fade']) {
+            log.debug("stop-fade");
+            delete firetray.ChatStatusIcon.events['stop-fade'];
             firetray.ChatStatusIcon.setIconImage(firetray.ChatStatusIcon.themedIconNameCurrent);
+            firetray.ChatStatusIcon.dropPixBuf(p);
             return;
           }
 
@@ -210,17 +210,14 @@ firetray.ChatStatusIcon = {
     }
     let pixbufObj = this.buildPixBuf();
     fadeLoop(pixbufObj);
-
-    firetray.ChatStatusIcon.dropPixBuf(pixbufObj);
   },
 
-  stopCrossFading: function() {
-    log.debug("stopCrossFading");
-    this.timers['cross-fade'].cancel();
-    this.setIconImage(firetray.ChatStatusIcon.themedIconNameCurrent);
+  stopFading: function() {
+    log.debug("stopFading");
+    this.events['stop-fade'] = true;
   },
 
-  startIconBlinking: function() { // gtk_status_icon_set_blinking() deprecated
+  startBlinking: function() { // gtk_status_icon_set_blinking() deprecated
     this.on = true;
     firetray.ChatStatusIcon.timers['blink'] = firetray.Utils.timer(
       500, Ci.nsITimer.TYPE_REPEATING_SLACK, function() {
@@ -232,16 +229,12 @@ firetray.ChatStatusIcon = {
       });
   },
 
-  stopIconBlinking: function() {
+  stopBlinking: function() {
     this.timers['blink'].cancel();
     this.setIconImage(firetray.ChatStatusIcon.themedIconNameCurrent);
     this.on = false;
   },
 
-  stopCrossFading: function() {
-    this.events['stop-cross-fade'] = true;
-  },
-
   setUrgency: function(xid, urgent) {
     gtk.gtk_window_set_urgency_hint(firetray.Handler.gtkWindows.get(xid), urgent);
   },

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