[Pkg-mozext-commits] [firetray] 09/399: try supporting more applications (Firefox, Thunderbird for now)

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:23: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 fded2c2a3136a55557c75cd29e9f34380cde519c
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Wed Jul 6 02:32:21 2011 +0200

    try supporting more applications (Firefox, Thunderbird for now)
    
    export 'Cc' and 'Ci' in common.js module. This helps managing the different
    behaviours in FF and TB: TB requires Ci and Cc to be defined explicitly in
    overlay.js, and FF fails to load overlay.js silently when Ci and Cc are defined
    explicitly (const defined twice ?)...
---
 src/Makefile                      |   56 +++++++++++++++++--------------------
 src/chrome.manifest               |    7 ++++-
 src/chrome/content/overlay.js     |    7 ++---
 src/chrome/skin/thunderbird32.png |  Bin 0 -> 2884 bytes
 src/install.rdf                   |   10 +++++++
 src/modules/commons.js            |   11 +++++++-
 6 files changed, 54 insertions(+), 37 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 899774c..eb4232c 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -10,7 +10,8 @@ help:
 	@echo "  DEBUG=on make all"
 	@echo
 	@echo "to create the dev profile:"
-	@echo "  firefox -no-remote -P	# then create '$(profile_dir)'"
+	@echo "  firefox -no-remote -P	# then create '$(profile_id)'"
+	@echo "  thunderbird -no-remote -P	# then create '$(profile_id)'"
 	@echo
 	@echo "to deploy to dev profile:"
 	@echo "  make clean"
@@ -18,6 +19,7 @@ help:
 	@echo
 	@echo "to test with dev profile:"
 	@echo "  firefox -no-remote -P mozilla-dev"
+	@echo "  thunderbird -no-remote -P mozilla-dev"
 	@echo
 	@echo "Have fun !"
 
@@ -25,7 +27,7 @@ help:
 extension_uuid := moztray at foudil.fr
 
 # The name of the profile dir where the extension can be installed.
-profile_dir := mozilla-dev
+profile_id := mozilla-dev
 
 # The zip application to be used.
 ZIP := zip
@@ -33,24 +35,10 @@ ZIP := zip
 # The target location of the build and build files.
 build_dir := ../build
 
-# The type of operating system this make command is running on.
-# os_type := $(patsubst darwin%,darwin,$(shell echo $(OSTYPE)))
-# we don't want to: export OSTYPE; make install
-os_type := $(patsubst darwin%,darwin,$(shell echo $$OSTYPE))
-
-# The location of the extension profile.
-ifeq ($(os_type), darwin)
-  profile_location := \
-    ~/Library/Application\ Support/Firefox/Profiles/$(profile_dir)/extensions
-else
-  ifeq ($(os_type), linux-gnu)
-    profile_location := \
-      ~/.mozilla/firefox/$(profile_dir)/extensions
-  else
-    profile_location := \
-      "$(subst \,\\,$(APPDATA))\\Mozilla\\Firefox\\Profiles\\$(profile_dir)\\extensions"
-  endif
-endif
+# The location of the extension profile. (this extension is intended for Linux only)
+profile_locations := \
+  ~/.mozilla/firefox/$(profile_id)/extensions \
+  ~/.thunderbird/$(profile_id)/extensions
 
 # The license file
 license := LICENSE
@@ -128,9 +116,11 @@ clean: clean_build clean_profile
 # This builds everything except for the actual XPI, and then it copies it to the
 # specified profile directory, allowing a quick update that requires no install.
 .PHONY: install
-install: $(xpi_built) $(profile_location)
-	@echo "Installing in profile folder: $(profile_location)"
-	@cp -f $(xpi_built) $(profile_location)/$(xpi_deployed)
+install: $(xpi_built) $(profile_locations)
+	@echo "Installing in profile folder: $(profile_locations)"
+	@for p in $(profile_locations) ; do \
+  cp -f $(xpi_built) $$p/$(xpi_deployed); \
+  done
 	@echo "Installing in profile folder. Done!"
 	@echo
 
@@ -151,7 +141,7 @@ $(build_dir)/$(chrome_source_root)/%.js: $(chrome_source_root)/%.js
     cp -f $< $@; \
   else \
     echo "Stripping comments from JS file $<"; \
-    sed '/moztray\.Debug\.dump/d' $< > $@; \
+    sed '/mozt\.Debug\.dump/d' $< > $@; \
   fi
 
 $(build_dir)/$(modules_dir)/commons.js: $(modules_dir)/commons.js
@@ -170,17 +160,21 @@ $(build_dir):
     mkdir -p $(build_dir); \
   fi
 
-$(profile_location):
-	@echo "Creating extension folder: $(profile_location)"
-	@if [ ! -x $(profile_location) ]; \
+$(profile_locations):
+	@echo "Creating extension folder: $(profile_locations)"
+	@for p in $(profile_locations) ; do \
+  if [ ! -x "$$p" ]; \
   then \
-    mkdir -p $(profile_location); \
-  fi
+    mkdir -p $$p; \
+  fi; \
+  done
 
 clean_build:
 	@echo "Removing build dir: $(build_dir)"
 	@rm -rf $(build_dir)
 
 clean_profile:
-	@echo "Removing extension from extension folder: $(profile_location)"
-	@rm -f $(profile_location)/$(xpi_deployed)
+	@echo "Removing extension from extension folders: $(profile_locations)"
+	@for p in $(profile_locations) ; do \
+  rm -f $$p/$(xpi_deployed); \
+  done
diff --git a/src/chrome.manifest b/src/chrome.manifest
index 873846d..2a32496 100644
--- a/src/chrome.manifest
+++ b/src/chrome.manifest
@@ -3,4 +3,9 @@ skin		moztray	classic/1.0	chrome/skin/
 locale		moztray	en-US		chrome/locale/en-US/
 resource	moztray			modules/
 
-overlay		chrome://browser/content/browser.xul	chrome://moztray/content/overlay.xul
+overlay	chrome://browser/content/browser.xul	chrome://moztray/content/overlay.xul
+overlay	chrome://messenger/content/messenger.xul	chrome://moztray/content/overlay.xul
+overlay	chrome://songbird/content/xul/mainScriptsOverlay.xul	chrome://moztray/content/songOverlay.xul
+overlay	chrome://sunbird/content/calendar.xul	chrome://moztray/content/mailOverlay.xul
+overlay	chrome://navigator/content/navigator.xul	chrome://moztray/content/navigatorOverlay.xul
+overlay	chrome://chatzilla/content/chatzilla.xul	chrome://moztray/content/ircOverlay.xul
diff --git a/src/chrome/content/overlay.js b/src/chrome/content/overlay.js
index 2bbffb3..404d3a5 100644
--- a/src/chrome/content/overlay.js
+++ b/src/chrome/content/overlay.js
@@ -4,13 +4,11 @@ Components.utils.import("resource://moztray/commons.js");
 Components.utils.import("resource://moztray/LibGtkStatusIcon.js");
 
 const MOZT_ICON_DIR = "chrome/skin/";
-const MOZT_ICON_FIREFOX = "firefox32.png";
+const MOZT_ICON_SUFFIX = "32.png";
 
 mozt.Main = {
 
   onLoad: function() {
-    mozt.Debug.dump('Moztray GO !');
-
     // initialization code
     this.initialized = null;
     this.strings = document.getElementById("moztray-strings");
@@ -27,7 +25,8 @@ mozt.Main = {
 
     LibGtkStatusIcon.init();
     this.tray_icon  = LibGtkStatusIcon.gtk_status_icon_new();
-    var icon_filename = MOZT_ICON_DIR + MOZT_ICON_FIREFOX;
+    var mozApp = mozt.Utils.appInfoService.name.toLowerCase();
+    var icon_filename = MOZT_ICON_DIR + mozApp + MOZT_ICON_SUFFIX;
     LibGtkStatusIcon.gtk_status_icon_set_from_file(this.tray_icon,
                                                    icon_filename);
 
diff --git a/src/chrome/skin/thunderbird32.png b/src/chrome/skin/thunderbird32.png
new file mode 100644
index 0000000..0ea7046
Binary files /dev/null and b/src/chrome/skin/thunderbird32.png differ
diff --git a/src/install.rdf b/src/install.rdf
index 7156b6f..d026bba 100644
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -12,6 +12,7 @@
     <em:description>A system tray extension for linux.</em:description>
     <!-- <em:optionsURL>chrome://moztray/content/options.xul</em:optionsURL> -->
     <em:iconURL>chrome://moztray/skin/icon32.png</em:iconURL>
+
     <em:targetApplication>
       <Description>
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
@@ -19,5 +20,14 @@
         <em:maxVersion>6.*</em:maxVersion>
       </Description>
     </em:targetApplication>
+
+    <em:targetApplication>      <!-- Thunderbird -->
+      <Description>
+        <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+        <em:minVersion>3.0</em:minVersion>
+        <em:maxVersion>5.*</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
   </Description>
 </RDF>
diff --git a/src/modules/commons.js b/src/modules/commons.js
index 7e2339b..73d35cc 100644
--- a/src/modules/commons.js
+++ b/src/modules/commons.js
@@ -6,11 +6,18 @@
  * http://developer.mozilla.org/en/XUL_School/JavaScript_Object_Management.html
  */
 
-var EXPORTED_SYMBOLS = [ "mozt" ];
+var EXPORTED_SYMBOLS = [ "mozt", "Cc", "Ci" ];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
+const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
+const THUNDERBIRD_ID = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
+const SONGBIRD_ID = "songbird at songbirdnest.com";
+const SUNBIRD_ID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
+const SEAMONKEY_ID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
+const CHATZILLA_ID = "{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}";
+
 /**
  * mozt namespace.
  */
@@ -67,4 +74,6 @@ mozt.Utils = {
   prefService: Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService)
     .getBranch("extensions.moztray."),
 
+  appInfoService: Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo), // appInfoService.name.toLower
+
 };

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