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

Proposed by Kartoch on 2011-09-23
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 2011-09-23 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.
Kartoch (kartoch) wrote :

Also solve bug #802982

60. By Kartoch on 2011-10-10

Moving version to 7.*

Unmerged revisions

60. By Kartoch on 2011-10-10

Moving version to 7.*

59. By Kartoch on 2011-09-23

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

58. By Kartoch on 2011-09-23

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
1=== modified file 'content/overlay.js'
2--- content/overlay.js 2011-02-18 22:37:38 +0000
3+++ content/overlay.js 2011-10-10 06:51:35 +0000
4@@ -86,7 +86,8 @@
5 if(!this.prefs.prefHasUserValue("onlyInbox")) {
6 this.prefs.setBoolPref("onlyInbox", false);
7 }
8-
9+
10+ this.pythonpath = ""
11 this.initIndicators();
12 },
13
14@@ -222,15 +223,29 @@
15 }
16
17 },
18+
19+ addonCallback: function(addon) {
20+ tbindicator.pythonpath = addon.getResourceURI("python/indicator.py").QueryInterface(Components.interfaces.nsIFileURL).file.path;
21+ tbindicator.initIndicators();
22+ },
23
24 initIndicators: function initIndicators() {
25
26 this.logger("init indicators");
27- var em = Components.classes["@mozilla.org/extensions/manager;1"]
28- .getService(Components.interfaces.nsIExtensionManager);
29-
30- var pythonpath = em.getInstallLocation(ADDON_ID).getItemFile(ADDON_ID, "python/indicator.py").path;
31- this.logger("pythonpath: " + pythonpath);
32+ if(this.pythonpath == "") {
33+ // Thunderbird 5 and later
34+ try {
35+ Components.utils.import("resource://gre/modules/AddonManager.jsm");
36+ AddonManager.getAddonByID(ADDON_ID, this.addonCallback);
37+ return;
38+ } catch (ex) {
39+ // Thunderbird 3.x and earlier
40+ var em = Components.classes["@mozilla.org/extensions/manager;1"]
41+ .getService(Components.interfaces.nsIExtensionManager);
42+ this.pythonpath = em.getInstallLocation(ADDON_ID).getItemFile(ADDON_ID, "python/indicator.py").path;
43+ }
44+ }
45+ this.logger("pythonpath: " + this.pythonpath);
46 // Make fifo in /tmp, otherwise it won't work for a shared extension for all users (#611183)
47 var pm = Components.classes["@mozilla.org/toolkit/profile-service;1"]
48 .getService(Components.interfaces.nsIToolkitProfileService);
49@@ -242,7 +257,7 @@
50 // run python server
51 var file = Components.classes["@mozilla.org/file/local;1"]
52 .createInstance(Components.interfaces.nsILocalFile);
53- file.initWithPath(pythonpath);
54+ file.initWithPath(this.pythonpath);
55 if(file.permissions != 0755){
56 file.permissions = 0755;
57 }
58
59=== modified file 'install.rdf'
60--- install.rdf 2010-10-16 13:21:04 +0000
61+++ install.rdf 2011-10-10 06:51:35 +0000
62@@ -19,11 +19,13 @@
63 <em:creator>Ruben Verweij</em:creator>
64 <em:contributor>Patrik Dufresne</em:contributor>
65 <em:contributor>Brian Mattern</em:contributor>
66+ <em:contributor>Svilen Kanev</em:contributor>
67+ <em:unpack>true</em:unpack>
68 <em:targetApplication>
69 <Description>
70 <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->
71 <em:minVersion>2.0</em:minVersion>
72- <em:maxVersion>3.3a1pre</em:maxVersion>
73+ <em:maxVersion>7.*</em:maxVersion>
74 </Description>
75 </em:targetApplication>
76 <em:optionsURL>chrome://tbindicator/content/options.xul</em:optionsURL>

Subscribers

People subscribed via source and target branches