=== modified file 'content/overlay.js'
--- content/overlay.js 2011-02-18 22:37:38 +0000
+++ content/overlay.js 2011-10-10 06:51:35 +0000
@@ -86,7 +86,8 @@
if(!this.prefs.prefHasUserValue("onlyInbox")) {
this.prefs.setBoolPref("onlyInbox", false);
}
-
+
+ this.pythonpath = ""
this.initIndicators();
},
@@ -222,15 +223,29 @@
}
},
+
+ addonCallback: function(addon) {
+ tbindicator.pythonpath = addon.getResourceURI("python/indicator.py").QueryInterface(Components.interfaces.nsIFileURL).file.path;
+ tbindicator.initIndicators();
+ },
initIndicators: function initIndicators() {
this.logger("init indicators");
- var em = Components.classes["@mozilla.org/extensions/manager;1"]
- .getService(Components.interfaces.nsIExtensionManager);
-
- var pythonpath = em.getInstallLocation(ADDON_ID).getItemFile(ADDON_ID, "python/indicator.py").path;
- this.logger("pythonpath: " + pythonpath);
+ if(this.pythonpath == "") {
+ // Thunderbird 5 and later
+ try {
+ Components.utils.import("resource://gre/modules/AddonManager.jsm");
+ AddonManager.getAddonByID(ADDON_ID, this.addonCallback);
+ return;
+ } catch (ex) {
+ // Thunderbird 3.x and earlier
+ var em = Components.classes["@mozilla.org/extensions/manager;1"]
+ .getService(Components.interfaces.nsIExtensionManager);
+ this.pythonpath = em.getInstallLocation(ADDON_ID).getItemFile(ADDON_ID, "python/indicator.py").path;
+ }
+ }
+ this.logger("pythonpath: " + this.pythonpath);
// Make fifo in /tmp, otherwise it won't work for a shared extension for all users (#611183)
var pm = Components.classes["@mozilla.org/toolkit/profile-service;1"]
.getService(Components.interfaces.nsIToolkitProfileService);
@@ -242,7 +257,7 @@
// run python server
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath(pythonpath);
+ file.initWithPath(this.pythonpath);
if(file.permissions != 0755){
file.permissions = 0755;
}
=== modified file 'install.rdf'
--- install.rdf 2010-10-16 13:21:04 +0000
+++ install.rdf 2011-10-10 06:51:35 +0000
@@ -19,11 +19,13 @@
Ruben Verweij
Patrik Dufresne
Brian Mattern
+ Svilen Kanev
+ true
{3550f703-e582-4d05-9a08-453d09bdfdc6}
2.0
- 3.3a1pre
+ 7.*
chrome://tbindicator/content/options.xul