Merge lp:~kartoch/libnotify-mozilla/simple-support-tbird6 into lp:libnotify-mozilla/0.1

Proposed by Kartoch
Status: Needs review
Proposed branch: lp:~kartoch/libnotify-mozilla/simple-support-tbird6
Merge into: lp:libnotify-mozilla/0.1
Diff against target: 76 lines (+25/-8)
2 files modified
content/overlay.js (+22/-7)
install.rdf (+3/-1)
To merge this branch: bzr merge lp:~kartoch/libnotify-mozilla/simple-support-tbird6
Reviewer Review Type Date Requested Status
Mozilla libnotify team Pending
Review via email: mp+76797@code.launchpad.net

Description of the change

- changing maximal version of thunderbird to 6.*
- Use Thunderbird5's AddonManager to find python script (merge from ~svilen-kanev/libnotify-mozilla/tbird5)
- Explicitly unpack .xpi file (merge from ~svilen-kanev/libnotify-mozilla/tbird5)

To post a comment you must log in.
Revision history for this message
Kartoch (kartoch) wrote :

Also solve bug #802982

60. By Kartoch

Moving version to 7.*

Unmerged revisions

60. By Kartoch

Moving version to 7.*

59. By Kartoch

merging ~svilen-kanev/libnotify-mozilla/tbird5 (rev 58): Use Thunderbird5's AddonManager to find python script + Explicit unpack .xpi file

58. By Kartoch

Change maximal version to 6.* to make it working with latest thunderbird

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
86 if(!this.prefs.prefHasUserValue("onlyInbox")) {86 if(!this.prefs.prefHasUserValue("onlyInbox")) {
87 this.prefs.setBoolPref("onlyInbox", false);87 this.prefs.setBoolPref("onlyInbox", false);
88 }88 }
89 89
90 this.pythonpath = ""
90 this.initIndicators();91 this.initIndicators();
91 },92 },
92 93
@@ -222,15 +223,29 @@
222 }223 }
223 224
224 },225 },
226
227 addonCallback: function(addon) {
228 tbindicator.pythonpath = addon.getResourceURI("python/indicator.py").QueryInterface(Components.interfaces.nsIFileURL).file.path;
229 tbindicator.initIndicators();
230 },
225 231
226 initIndicators: function initIndicators() {232 initIndicators: function initIndicators() {
227 233
228 this.logger("init indicators");234 this.logger("init indicators");
229 var em = Components.classes["@mozilla.org/extensions/manager;1"]235 if(this.pythonpath == "") {
230 .getService(Components.interfaces.nsIExtensionManager);236 // Thunderbird 5 and later
231237 try {
232 var pythonpath = em.getInstallLocation(ADDON_ID).getItemFile(ADDON_ID, "python/indicator.py").path; 238 Components.utils.import("resource://gre/modules/AddonManager.jsm");
233 this.logger("pythonpath: " + pythonpath);239 AddonManager.getAddonByID(ADDON_ID, this.addonCallback);
240 return;
241 } catch (ex) {
242 // Thunderbird 3.x and earlier
243 var em = Components.classes["@mozilla.org/extensions/manager;1"]
244 .getService(Components.interfaces.nsIExtensionManager);
245 this.pythonpath = em.getInstallLocation(ADDON_ID).getItemFile(ADDON_ID, "python/indicator.py").path;
246 }
247 }
248 this.logger("pythonpath: " + this.pythonpath);
234 // Make fifo in /tmp, otherwise it won't work for a shared extension for all users (#611183)249 // Make fifo in /tmp, otherwise it won't work for a shared extension for all users (#611183)
235 var pm = Components.classes["@mozilla.org/toolkit/profile-service;1"]250 var pm = Components.classes["@mozilla.org/toolkit/profile-service;1"]
236 .getService(Components.interfaces.nsIToolkitProfileService);251 .getService(Components.interfaces.nsIToolkitProfileService);
@@ -242,7 +257,7 @@
242 // run python server257 // run python server
243 var file = Components.classes["@mozilla.org/file/local;1"]258 var file = Components.classes["@mozilla.org/file/local;1"]
244 .createInstance(Components.interfaces.nsILocalFile);259 .createInstance(Components.interfaces.nsILocalFile);
245 file.initWithPath(pythonpath);260 file.initWithPath(this.pythonpath);
246 if(file.permissions != 0755){261 if(file.permissions != 0755){
247 file.permissions = 0755;262 file.permissions = 0755;
248 }263 }
249264
=== 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 @@
19 <em:creator>Ruben Verweij</em:creator>19 <em:creator>Ruben Verweij</em:creator>
20 <em:contributor>Patrik Dufresne</em:contributor>20 <em:contributor>Patrik Dufresne</em:contributor>
21 <em:contributor>Brian Mattern</em:contributor>21 <em:contributor>Brian Mattern</em:contributor>
22 <em:contributor>Svilen Kanev</em:contributor>
23 <em:unpack>true</em:unpack>
22 <em:targetApplication>24 <em:targetApplication>
23 <Description>25 <Description>
24 <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->26 <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->
25 <em:minVersion>2.0</em:minVersion>27 <em:minVersion>2.0</em:minVersion>
26 <em:maxVersion>3.3a1pre</em:maxVersion>28 <em:maxVersion>7.*</em:maxVersion>
27 </Description>29 </Description>
28 </em:targetApplication>30 </em:targetApplication>
29<em:optionsURL>chrome://tbindicator/content/options.xul</em:optionsURL>31<em:optionsURL>chrome://tbindicator/content/options.xul</em:optionsURL>

Subscribers

People subscribed via source and target branches