Merge lp:~larsu/thunderbird/libmessaging-menu-port into lp:thunderbird/3.3
- libmessaging-menu-port
- Merge into thunderbird-trunk.head
Proposed by
Lars Karlitski
Status: | Merged |
---|---|
Merge reported by: | Chris Coulson |
Merged at revision: | not available |
Proposed branch: | lp:~larsu/thunderbird/libmessaging-menu-port |
Merge into: | lp:thunderbird/3.3 |
Diff against target: |
706 lines (+126/-391) 5 files modified
debian/messagingmenu/modules/MessagingMenu.jsm (+51/-242) debian/messagingmenu/modules/dbusmenu.jsm (+0/-68) debian/messagingmenu/modules/indicate.jsm (+0/-80) debian/messagingmenu/modules/messagingmenu.jsm (+74/-0) debian/thunderbird.desktop.in (+1/-1) |
To merge this branch: | bzr merge lp:~larsu/thunderbird/libmessaging-menu-port |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Coulson | Approve | ||
Review via email: mp+121075@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 690. By Lars Karlitski
-
Make "Contacts" and "Compose" actions show up in the messaging menu
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/messagingmenu/modules/MessagingMenu.jsm' | |||
2 | --- debian/messagingmenu/modules/MessagingMenu.jsm 2012-02-16 17:38:02 +0000 | |||
3 | +++ debian/messagingmenu/modules/MessagingMenu.jsm 2012-08-23 20:00:25 +0000 | |||
4 | @@ -52,8 +52,7 @@ | |||
5 | 52 | Cu.import("resource:///modules/iteratorUtils.jsm"); | 52 | Cu.import("resource:///modules/iteratorUtils.jsm"); |
6 | 53 | Cu.import("resource://messagingmenu/glib.jsm"); | 53 | Cu.import("resource://messagingmenu/glib.jsm"); |
7 | 54 | Cu.import("resource://messagingmenu/gobject.jsm"); | 54 | Cu.import("resource://messagingmenu/gobject.jsm"); |
10 | 55 | Cu.import("resource://messagingmenu/dbusmenu.jsm"); | 55 | Cu.import("resource://messagingmenu/messagingmenu.jsm"); |
9 | 56 | Cu.import("resource://messagingmenu/indicate.jsm"); | ||
11 | 57 | Cu.import("resource://messagingmenu/unity.jsm"); | 56 | Cu.import("resource://messagingmenu/unity.jsm"); |
12 | 58 | Cu.import("resource://messagingmenu/msgHdrUtils.jsm"); | 57 | Cu.import("resource://messagingmenu/msgHdrUtils.jsm"); |
13 | 59 | 58 | ||
14 | @@ -80,8 +79,6 @@ | |||
15 | 80 | const FOLDER_URL_KEY = "url"; | 79 | const FOLDER_URL_KEY = "url"; |
16 | 81 | const USER_SHARE_APPLICATIONS = "/usr/share/applications/"; | 80 | const USER_SHARE_APPLICATIONS = "/usr/share/applications/"; |
17 | 82 | const SYSTEM_LAUNCHER_ENTRIES = "/usr/share/indicators/messages/applications/"; | 81 | const SYSTEM_LAUNCHER_ENTRIES = "/usr/share/indicators/messages/applications/"; |
18 | 83 | const USER_LAUNCHER_ENTRIES = ".config/indicators/messages/applications/"; | ||
19 | 84 | const USER_BLACKLIST_ENTRIES = ".config/indicators/messages/applications-blacklist/"; | ||
20 | 85 | const MAX_INDICATORS = 6; | 82 | const MAX_INDICATORS = 6; |
21 | 86 | const ADDON_ID = "messagingmenu@mozilla.com"; | 83 | const ADDON_ID = "messagingmenu@mozilla.com"; |
22 | 87 | const PREF_ROOT = "extensions.messagingmenu."; | 84 | const PREF_ROOT = "extensions.messagingmenu."; |
23 | @@ -95,10 +92,7 @@ | |||
24 | 95 | const PREF_ACCOUNTS = "mail.accountmanager.accounts"; | 92 | const PREF_ACCOUNTS = "mail.accountmanager.accounts"; |
25 | 96 | const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed"; | 93 | const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed"; |
26 | 97 | 94 | ||
31 | 98 | var open3PaneCallback; | 95 | var sourceActivatedCallback; |
28 | 99 | var contactsCallback; | ||
29 | 100 | var composerCallback; | ||
30 | 101 | var clickIndicatorCallback; | ||
32 | 102 | 96 | ||
33 | 103 | function injectTimestamp(aTimestamp) { | 97 | function injectTimestamp(aTimestamp) { |
34 | 104 | let atts = new gdk.GdkWindowAttributes; | 98 | let atts = new gdk.GdkWindowAttributes; |
35 | @@ -138,34 +132,8 @@ | |||
36 | 138 | } | 132 | } |
37 | 139 | } | 133 | } |
38 | 140 | 134 | ||
67 | 141 | function openAndFocus3Pane(aInstance, aTimestamp, aUserData) { | 135 | function onSourceActivated(aInstance, aSourceId, aUserData) { |
68 | 142 | LOG("Opening 3pane"); | 136 | let folderURL = aSourceId.readString(); |
41 | 143 | openWindowByType("mail:3pane", | ||
42 | 144 | "chrome://messenger/content/messenger.xul", | ||
43 | 145 | aTimestamp); | ||
44 | 146 | } | ||
45 | 147 | |||
46 | 148 | function openAndFocusAddressBook(aInstance, aTimestamp, aUserData) { | ||
47 | 149 | LOG("Opening addressbook"); | ||
48 | 150 | openWindowByType("mail:addressbook", | ||
49 | 151 | "chrome://messenger/content/addressbook/addressbook.xul", | ||
50 | 152 | aTimestamp); | ||
51 | 153 | } | ||
52 | 154 | |||
53 | 155 | function openAndFocusComposer(aInstance, aTimestamp, aUserData) { | ||
54 | 156 | LOG("Opening composer"); | ||
55 | 157 | injectTimestamp(aTimestamp); | ||
56 | 158 | let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"] | ||
57 | 159 | .getService(Ci.nsIWindowWatcher); | ||
58 | 160 | if (ww) { | ||
59 | 161 | ww.openWindow(null, "chrome://messenger/content/messengercompose/messengercompose.xul", | ||
60 | 162 | "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", null); | ||
61 | 163 | } | ||
62 | 164 | } | ||
63 | 165 | |||
64 | 166 | function onClickIndicator(aInstance, aTimestamp, aUserData) { | ||
65 | 167 | let indicator = ctypes.cast(aInstance, indicate.Indicator.ptr); | ||
66 | 168 | let folderURL = indicate.indicate_indicator_get_property(indicator, FOLDER_URL_KEY).readString(); | ||
69 | 169 | LOG("Received click event on indicator for folder " + folderURL); | 137 | LOG("Received click event on indicator for folder " + folderURL); |
70 | 170 | 138 | ||
71 | 171 | let indicatorEntry = MessagingMenuEngine.mIndicators[folderURL]; | 139 | let indicatorEntry = MessagingMenuEngine.mIndicators[folderURL]; |
72 | @@ -174,9 +142,6 @@ | |||
73 | 174 | return; | 142 | return; |
74 | 175 | } | 143 | } |
75 | 176 | 144 | ||
76 | 177 | // Hide the indicator | ||
77 | 178 | MessagingMenuEngine.hideIndicator(indicatorEntry); | ||
78 | 179 | |||
79 | 180 | var msg = MessagingMenuEngine.messenger.msgHdrFromURI(indicatorEntry.messageURL); | 145 | var msg = MessagingMenuEngine.messenger.msgHdrFromURI(indicatorEntry.messageURL); |
80 | 181 | if(!msg) { | 146 | if(!msg) { |
81 | 182 | WARN("Invalid message URI " + indicatorEntry.messageURL); | 147 | WARN("Invalid message URI " + indicatorEntry.messageURL); |
82 | @@ -184,7 +149,9 @@ | |||
83 | 184 | } | 149 | } |
84 | 185 | 150 | ||
85 | 186 | // Focus 3pane | 151 | // Focus 3pane |
87 | 187 | openAndFocus3Pane(aInstance, aTimestamp, aUserData); | 152 | LOG("Opening 3pane"); |
88 | 153 | openWindowByType("mail:3pane", | ||
89 | 154 | "chrome://messenger/content/messenger.xul") | ||
90 | 188 | let win = null; | 155 | let win = null; |
91 | 189 | let wm = Cc["@mozilla.org/appshell/window-mediator;1"] | 156 | let wm = Cc["@mozilla.org/appshell/window-mediator;1"] |
92 | 190 | .getService(Ci.nsIWindowMediator); | 157 | .getService(Ci.nsIWindowMediator); |
93 | @@ -490,37 +457,17 @@ | |||
94 | 490 | function MMIndicatorEntry (aFolder) { | 457 | function MMIndicatorEntry (aFolder) { |
95 | 491 | LOG("Creating indicator for folder " + aFolder.folderURL); | 458 | LOG("Creating indicator for folder " + aFolder.folderURL); |
96 | 492 | this.folder = aFolder; | 459 | this.folder = aFolder; |
97 | 493 | this.indicator = indicate.indicate_indicator_new(); | ||
98 | 494 | this.refreshLabel(); | 460 | this.refreshLabel(); |
99 | 495 | this.newCount = 0; | 461 | this.newCount = 0; |
100 | 496 | this.dateInSeconds = 0; | 462 | this.dateInSeconds = 0; |
101 | 497 | this.cancelAttention(); | 463 | this.cancelAttention(); |
102 | 498 | this.hide(); | 464 | this.hide(); |
103 | 499 | 465 | ||
104 | 500 | gobject.g_signal_connect(this.indicator, "user-display", | ||
105 | 501 | clickIndicatorCallback, null); | ||
106 | 502 | |||
107 | 503 | indicate.indicate_indicator_set_property(this.indicator, | ||
108 | 504 | FOLDER_URL_KEY, | ||
109 | 505 | aFolder.folderURL); | ||
110 | 506 | |||
111 | 507 | Services.prefs.addObserver(PREF_ACCOUNTS, this, false); | 466 | Services.prefs.addObserver(PREF_ACCOUNTS, this, false); |
112 | 508 | MessagingMenuEngine.prefs.addObserver("", this, false); | 467 | MessagingMenuEngine.prefs.addObserver("", this, false); |
113 | 509 | } | 468 | } |
114 | 510 | 469 | ||
115 | 511 | MMIndicatorEntry.prototype = { | 470 | MMIndicatorEntry.prototype = { |
116 | 512 | get indicator() { | ||
117 | 513 | if (this._indicator) { | ||
118 | 514 | return this._indicator; | ||
119 | 515 | } | ||
120 | 516 | |||
121 | 517 | throw "No IndicateIndicator. Have we been destroyed?"; | ||
122 | 518 | }, | ||
123 | 519 | |||
124 | 520 | set indicator(aIndicator) { | ||
125 | 521 | this._indicator = aIndicator; | ||
126 | 522 | }, | ||
127 | 523 | |||
128 | 524 | requestAttention: function MMIE_requestAttention() { | 471 | requestAttention: function MMIE_requestAttention() { |
129 | 525 | if (!this.active) { | 472 | if (!this.active) { |
130 | 526 | WARN("Attempting to request attention for an inactive indicator"); | 473 | WARN("Attempting to request attention for an inactive indicator"); |
131 | @@ -539,9 +486,7 @@ | |||
132 | 539 | 486 | ||
133 | 540 | _requestAttention: function MMIE__requestAttention() { | 487 | _requestAttention: function MMIE__requestAttention() { |
134 | 541 | LOG("Requesting attention for folder " + this.label); | 488 | LOG("Requesting attention for folder " + this.label); |
138 | 542 | indicate.indicate_indicator_set_property(this.indicator, | 489 | messagingmenu.messaging_menu_app_draw_attention(MessagingMenuEngine.mmapp, this.folder.folderURL); |
136 | 543 | indicate.INDICATOR_MESSAGES_PROP_ATTENTION, | ||
137 | 544 | "true"); | ||
139 | 545 | }, | 490 | }, |
140 | 546 | 491 | ||
141 | 547 | cancelAttention: function MMIE_cancelAttention() { | 492 | cancelAttention: function MMIE_cancelAttention() { |
142 | @@ -551,16 +496,11 @@ | |||
143 | 551 | }, | 496 | }, |
144 | 552 | 497 | ||
145 | 553 | _cancelAttention: function MMIE__cancelAttention() { | 498 | _cancelAttention: function MMIE__cancelAttention() { |
149 | 554 | indicate.indicate_indicator_set_property(this.indicator, | 499 | messagingmenu.messaging_menu_app_remove_attention(MessagingMenuEngine.mmapp, this.folder.folderURL); |
147 | 555 | indicate.INDICATOR_MESSAGES_PROP_ATTENTION, | ||
148 | 556 | "false"); | ||
150 | 557 | }, | 500 | }, |
151 | 558 | 501 | ||
152 | 559 | set label(aName) { | 502 | set label(aName) { |
153 | 560 | LOG("Setting label for folder " + this.folder.folderURL + " to " + aName); | 503 | LOG("Setting label for folder " + this.folder.folderURL + " to " + aName); |
154 | 561 | indicate.indicate_indicator_set_property(this.indicator, | ||
155 | 562 | indicate.INDICATOR_MESSAGES_PROP_NAME, | ||
156 | 563 | aName); | ||
157 | 564 | this._label = aName; | 504 | this._label = aName; |
158 | 565 | }, | 505 | }, |
159 | 566 | 506 | ||
160 | @@ -571,10 +511,17 @@ | |||
161 | 571 | set newCount(aCount) { | 511 | set newCount(aCount) { |
162 | 572 | LOG("Setting unread count for folder " + this.label + | 512 | LOG("Setting unread count for folder " + this.label + |
163 | 573 | " to " + aCount.toString()); | 513 | " to " + aCount.toString()); |
164 | 574 | indicate.indicate_indicator_set_property(this.indicator, | ||
165 | 575 | indicate.INDICATOR_MESSAGES_PROP_COUNT, | ||
166 | 576 | aCount.toString()); | ||
167 | 577 | this._newCount = aCount; | 514 | this._newCount = aCount; |
168 | 515 | if (aCount == 0) { | ||
169 | 516 | this.hide(); | ||
170 | 517 | } | ||
171 | 518 | else if (this.visible) { | ||
172 | 519 | messagingmenu.messaging_menu_app_set_source_count(MessagingMenuEngine.mmapp, this.folder.folderURL, aCount); | ||
173 | 520 | } | ||
174 | 521 | else { | ||
175 | 522 | messagingmenu.messaging_menu_app_append_source_with_count( | ||
176 | 523 | MessagingMenuEngine.mmapp, this.folder.folderURL, null, this.label, aCount); | ||
177 | 524 | } | ||
178 | 578 | }, | 525 | }, |
179 | 579 | 526 | ||
180 | 580 | get newCount() { | 527 | get newCount() { |
181 | @@ -592,7 +539,10 @@ | |||
182 | 592 | } | 539 | } |
183 | 593 | 540 | ||
184 | 594 | LOG("Showing indicator for folder " + this.label); | 541 | LOG("Showing indicator for folder " + this.label); |
186 | 595 | indicate.indicate_indicator_show(this.indicator); | 542 | if (!this.visible) { |
187 | 543 | messagingmenu.messaging_menu_app_append_source_with_count( | ||
188 | 544 | MessagingMenuEngine.mmapp, this.folder.folderURL, null, this.label, this.newCount); | ||
189 | 545 | } | ||
190 | 596 | 546 | ||
191 | 597 | // Ensure we really request attention now we are being made visible | 547 | // Ensure we really request attention now we are being made visible |
192 | 598 | if (this._attention) | 548 | if (this._attention) |
193 | @@ -601,14 +551,11 @@ | |||
194 | 601 | 551 | ||
195 | 602 | hide: function MMIE_hide() { | 552 | hide: function MMIE_hide() { |
196 | 603 | LOG("Hiding indicator for folder " + this.label); | 553 | LOG("Hiding indicator for folder " + this.label); |
201 | 604 | indicate.indicate_indicator_hide(this.indicator); | 554 | messagingmenu.messaging_menu_app_remove_source(MessagingMenuEngine.mmapp, this.folder.folderURL); |
198 | 605 | |||
199 | 606 | // Cancel our request for attention whilst we are hidden | ||
200 | 607 | this._cancelAttention(); | ||
202 | 608 | }, | 555 | }, |
203 | 609 | 556 | ||
204 | 610 | get visible() { | 557 | get visible() { |
206 | 611 | return indicate.indicate_indicator_is_visible(this.indicator) != 0; | 558 | return messagingmenu.messaging_menu_app_has_source(MessagingMenuEngine.mmapp, this.folder.folderURL) != 0; |
207 | 612 | }, | 559 | }, |
208 | 613 | 560 | ||
209 | 614 | get priority() { | 561 | get priority() { |
210 | @@ -760,85 +707,29 @@ | |||
211 | 760 | return this._prefs; | 707 | return this._prefs; |
212 | 761 | }, | 708 | }, |
213 | 762 | 709 | ||
286 | 763 | get indicateServer() { | 710 | get mmapp() { |
287 | 764 | if (this._indicateServer) | 711 | if (this._mmapp) |
288 | 765 | return this._indicateServer; | 712 | return this._mmapp; |
289 | 766 | 713 | ||
290 | 767 | let indicateServer = indicate.indicate_server_ref_default(); | 714 | let mmapp = messagingmenu.messaging_menu_app_new(Services.appinfo.name.toLowerCase() + '.desktop'); |
291 | 768 | indicate.indicate_server_set_type(indicateServer, "message.email"); | 715 | |
292 | 769 | indicate.indicate_server_set_desktop_file(indicateServer, | 716 | let sourceActivatedCB = ctypes.FunctionType(ctypes.default_abi, |
293 | 770 | this.desktopFile); | 717 | ctypes.void_t, |
294 | 771 | 718 | [glib.gpointer, | |
295 | 772 | let serverDisplayCB = ctypes.FunctionType(ctypes.default_abi, | 719 | glib.gchar.ptr, |
296 | 773 | ctypes.void_t, | 720 | glib.gpointer]).ptr; |
297 | 774 | [glib.gpointer, | 721 | sourceActivatedCallback = sourceActivatedCB(onSourceActivated); |
298 | 775 | glib.guint, | 722 | |
299 | 776 | glib.gpointer]).ptr; | 723 | gobject.g_signal_connect(mmapp, 'activate-source', sourceActivatedCallback, null); |
300 | 777 | open3PaneCallback = serverDisplayCB(openAndFocus3Pane); | 724 | |
301 | 778 | 725 | this._mmapp = mmapp; | |
302 | 779 | gobject.g_signal_connect(indicateServer, "server-display", | 726 | return this._mmapp; |
231 | 780 | open3PaneCallback, null); | ||
232 | 781 | |||
233 | 782 | let bundle = Services.strings.createBundle( | ||
234 | 783 | "chrome://messagingmenu/locale/messagingmenu.properties"); | ||
235 | 784 | |||
236 | 785 | let server = dbusmenu.dbusmenu_server_new("/messaging/commands"); | ||
237 | 786 | let root = dbusmenu.dbusmenu_menuitem_new(); | ||
238 | 787 | |||
239 | 788 | let composeMi = dbusmenu.dbusmenu_menuitem_new(); | ||
240 | 789 | dbusmenu.dbusmenu_menuitem_property_set(composeMi, "label", | ||
241 | 790 | bundle.GetStringFromName("composeNewMessage")); | ||
242 | 791 | dbusmenu.dbusmenu_menuitem_property_set_bool(composeMi, "visible", true); | ||
243 | 792 | |||
244 | 793 | let menuItemActivatedCB = ctypes.FunctionType(ctypes.default_abi, | ||
245 | 794 | ctypes.void_t, | ||
246 | 795 | [glib.gpointer, | ||
247 | 796 | glib.guint, | ||
248 | 797 | glib.gpointer]).ptr; | ||
249 | 798 | composerCallback = menuItemActivatedCB(openAndFocusComposer); | ||
250 | 799 | |||
251 | 800 | gobject.g_signal_connect(composeMi, | ||
252 | 801 | dbusmenu.MENUITEM_SIGNAL_ITEM_ACTIVATED, | ||
253 | 802 | composerCallback, null); | ||
254 | 803 | dbusmenu.dbusmenu_menuitem_child_append(root, composeMi); | ||
255 | 804 | // I can't believe that this doesn't inherit from GInitiallyUnowned. | ||
256 | 805 | // It really, really sucks that we need to do this.... | ||
257 | 806 | gobject.g_object_unref(composeMi); | ||
258 | 807 | |||
259 | 808 | let contactsMi = dbusmenu.dbusmenu_menuitem_new(); | ||
260 | 809 | dbusmenu.dbusmenu_menuitem_property_set(contactsMi, "label", | ||
261 | 810 | bundle.GetStringFromName("contacts")); | ||
262 | 811 | dbusmenu.dbusmenu_menuitem_property_set_bool(contactsMi, "visible", true); | ||
263 | 812 | contactsCallback = menuItemActivatedCB(openAndFocusAddressBook); | ||
264 | 813 | |||
265 | 814 | gobject.g_signal_connect(contactsMi, | ||
266 | 815 | dbusmenu.MENUITEM_SIGNAL_ITEM_ACTIVATED, | ||
267 | 816 | contactsCallback, null); | ||
268 | 817 | dbusmenu.dbusmenu_menuitem_child_append(root, contactsMi); | ||
269 | 818 | gobject.g_object_unref(contactsMi); // This too | ||
270 | 819 | |||
271 | 820 | dbusmenu.dbusmenu_server_set_root(server, root); | ||
272 | 821 | gobject.g_object_unref(root); // And this... | ||
273 | 822 | |||
274 | 823 | indicate.indicate_server_set_menu(indicateServer, server); | ||
275 | 824 | gobject.g_object_unref(server); | ||
276 | 825 | |||
277 | 826 | let displayCB = ctypes.FunctionType(ctypes.default_abi, | ||
278 | 827 | ctypes.void_t, | ||
279 | 828 | [glib.gpointer, | ||
280 | 829 | glib.guint, | ||
281 | 830 | glib.gpointer]).ptr; | ||
282 | 831 | clickIndicatorCallback = displayCB(onClickIndicator); | ||
283 | 832 | |||
284 | 833 | this._indicateServer = indicateServer; | ||
285 | 834 | return this._indicateServer; | ||
303 | 835 | }, | 727 | }, |
304 | 836 | 728 | ||
305 | 837 | get available() { | 729 | get available() { |
306 | 838 | return (gobject.available() && | 730 | return (gobject.available() && |
307 | 839 | gdk.available() && | 731 | gdk.available() && |
310 | 840 | dbusmenu.available() && | 732 | messagingmenu.available()); |
309 | 841 | indicate.available()); | ||
311 | 842 | }, | 733 | }, |
312 | 843 | 734 | ||
313 | 844 | get badgeCount() { | 735 | get badgeCount() { |
314 | @@ -868,28 +759,6 @@ | |||
315 | 868 | } | 759 | } |
316 | 869 | }, | 760 | }, |
317 | 870 | 761 | ||
318 | 871 | createLauncherEntry: function MME_createLauncherEntry(aDir) { | ||
319 | 872 | if (!aDir.exists()) { | ||
320 | 873 | aDir.create(Ci.nsILocalFile.DIRECTORY_TYPE, 0755); | ||
321 | 874 | } | ||
322 | 875 | let entry = aDir; | ||
323 | 876 | entry.append(Services.appinfo.name.toLowerCase()); | ||
324 | 877 | let ostream = FileUtils.openSafeFileOutputStream(entry, | ||
325 | 878 | FileUtils.MODE_WRONLY | | ||
326 | 879 | FileUtils.MODE_CREATE | | ||
327 | 880 | FileUtils.MODE_TRUNCATE); | ||
328 | 881 | let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] | ||
329 | 882 | .createInstance(Ci.nsIScriptableUnicodeConverter); | ||
330 | 883 | converter.charset = "UTF-8"; | ||
331 | 884 | let istream = converter.convertToInputStream(this.desktopFile); | ||
332 | 885 | var self = this; | ||
333 | 886 | NetUtil.asyncCopy(istream, ostream, function() { | ||
334 | 887 | self.prefs.setCharPref(PREF_USER_LAUNCHER_PATH, entry.path); | ||
335 | 888 | self.prefs.setIntPrefAsChar(PREF_USER_LAUNCHER_MTIME, | ||
336 | 889 | entry.lastModifiedTime); | ||
337 | 890 | }); | ||
338 | 891 | }, | ||
339 | 892 | |||
340 | 893 | init: function MME_init() { | 762 | init: function MME_init() { |
341 | 894 | if (this.initialized) | 763 | if (this.initialized) |
342 | 895 | return; | 764 | return; |
343 | @@ -902,31 +771,6 @@ | |||
344 | 902 | return; | 771 | return; |
345 | 903 | } | 772 | } |
346 | 904 | 773 | ||
347 | 905 | // Check if we have a static launcher entry in the messaging menu. If we | ||
348 | 906 | // don't, then we should add one and also display "Contacts" and "Compose" | ||
349 | 907 | // menu items. If there is one, then it was probably added by the Thunderbird | ||
350 | 908 | // package. We don't need to create one or show the extra menu items in that case | ||
351 | 909 | let sysLauncherEntriesDir = Cc["@mozilla.org/file/local;1"] | ||
352 | 910 | .createInstance(Ci.nsILocalFile); | ||
353 | 911 | sysLauncherEntriesDir.initWithPath(SYSTEM_LAUNCHER_ENTRIES); | ||
354 | 912 | LauncherEntryFind(sysLauncherEntriesDir, this.desktopFile, | ||
355 | 913 | function(aFile) { | ||
356 | 914 | if(!aFile) { | ||
357 | 915 | // There is no system-provided static launcher entry for us in the | ||
358 | 916 | // messaging menu | ||
359 | 917 | var userLauncherEntriesDir = Services.dirsvc.get("Home", | ||
360 | 918 | Ci.nsILocalFile); | ||
361 | 919 | userLauncherEntriesDir.appendRelativePath(USER_LAUNCHER_ENTRIES); | ||
362 | 920 | LauncherEntryFind(userLauncherEntriesDir, | ||
363 | 921 | this.desktopFile, | ||
364 | 922 | function(aFile) { | ||
365 | 923 | if (!aFile) { | ||
366 | 924 | MessagingMenuEngine.createLauncherEntry(userLauncherEntriesDir); | ||
367 | 925 | } | ||
368 | 926 | }); | ||
369 | 927 | } | ||
370 | 928 | }); | ||
371 | 929 | |||
372 | 930 | AddonManager.addAddonListener(this); | 774 | AddonManager.addAddonListener(this); |
373 | 931 | this.prefs.addObserver("", this, false); | 775 | this.prefs.addObserver("", this, false); |
374 | 932 | Services.obs.addObserver(this, "xpcom-will-shutdown", false); | 776 | Services.obs.addObserver(this, "xpcom-will-shutdown", false); |
375 | @@ -950,22 +794,12 @@ | |||
376 | 950 | 794 | ||
377 | 951 | LOG("Enabling messaging indicator"); | 795 | LOG("Enabling messaging indicator"); |
378 | 952 | 796 | ||
381 | 953 | if (!this.indicateServer) { | 797 | if (!this.mmapp) { |
382 | 954 | Cu.reportError("Could not construct the Messaging Menu server."); | 798 | Cu.reportError("Could not connect to the Messaging Menu."); |
383 | 955 | return; | 799 | return; |
384 | 956 | } | 800 | } |
385 | 957 | 801 | ||
397 | 958 | indicate.indicate_server_show(this.indicateServer); | 802 | messagingmenu.messaging_menu_app_register(this.mmapp); |
387 | 959 | |||
388 | 960 | let userBlacklistDir = Services.dirsvc.get("Home", Ci.nsILocalFile); | ||
389 | 961 | userBlacklistDir.appendRelativePath(USER_BLACKLIST_ENTRIES); | ||
390 | 962 | LauncherEntryFind(userBlacklistDir, this.desktopFile, | ||
391 | 963 | function(aFile) { | ||
392 | 964 | if (aFile) { | ||
393 | 965 | LOG("Removing launcher entry " + aFile.path); | ||
394 | 966 | aFile.remove(false); | ||
395 | 967 | } | ||
396 | 968 | }); | ||
398 | 969 | 803 | ||
399 | 970 | let notificationFlags = Ci.nsIFolderListener.added | | 804 | let notificationFlags = Ci.nsIFolderListener.added | |
400 | 971 | Ci.nsIFolderListener.boolPropertyChanged | 805 | Ci.nsIFolderListener.boolPropertyChanged |
401 | @@ -976,30 +810,8 @@ | |||
402 | 976 | 810 | ||
403 | 977 | disableAndHide: function MME_disableAndHide() { | 811 | disableAndHide: function MME_disableAndHide() { |
404 | 978 | LOG("Hiding messaging indicator"); | 812 | LOG("Hiding messaging indicator"); |
429 | 979 | var userBlacklistDir = Services.dirsvc.get("Home", Ci.nsILocalFile); | 813 | |
430 | 980 | userBlacklistDir.appendRelativePath(USER_BLACKLIST_ENTRIES); | 814 | messagingmenu.messaging_menu_app_unregister(this.mmapp); |
407 | 981 | LauncherEntryFind(userBlacklistDir, this.desktopFile, | ||
408 | 982 | function(aFile) { | ||
409 | 983 | if (aFile) | ||
410 | 984 | return; | ||
411 | 985 | |||
412 | 986 | if (!userBlacklistDir.exists()) { | ||
413 | 987 | userBlacklistDir.create(Ci.nsILocalFile.DIRECTORY_TYPE, 0755); | ||
414 | 988 | } | ||
415 | 989 | |||
416 | 990 | let entry = userBlacklistDir.clone(); | ||
417 | 991 | entry.append(Services.appinfo.name.toLowerCase()); | ||
418 | 992 | let ostream = FileUtils.openSafeFileOutputStream(entry, | ||
419 | 993 | FileUtils.MODE_WRONLY | | ||
420 | 994 | FileUtils.MODE_CREATE | | ||
421 | 995 | FileUtils.MODE_TRUNCATE); | ||
422 | 996 | let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] | ||
423 | 997 | .createInstance(Ci.nsIScriptableUnicodeConverter); | ||
424 | 998 | converter.charset = "UTF-8"; | ||
425 | 999 | let istream = converter.convertToInputStream(this.desktopFile); | ||
426 | 1000 | var self = this; | ||
427 | 1001 | NetUtil.asyncCopy(istream, ostream, null); | ||
428 | 1002 | }); | ||
431 | 1003 | 815 | ||
432 | 1004 | this.disable(); | 816 | this.disable(); |
433 | 1005 | }, | 817 | }, |
434 | @@ -1040,9 +852,6 @@ | |||
435 | 1040 | this.mIndicators = {}; | 852 | this.mIndicators = {}; |
436 | 1041 | this.visibleIndicators = 0; | 853 | this.visibleIndicators = 0; |
437 | 1042 | 854 | ||
438 | 1043 | if (this._indicateServer) | ||
439 | 1044 | indicate.indicate_server_hide(this._indicateServer); | ||
440 | 1045 | |||
441 | 1046 | this.badgeCount = 0; | 855 | this.badgeCount = 0; |
442 | 1047 | 856 | ||
443 | 1048 | this.enabled = false; | 857 | this.enabled = false; |
444 | @@ -1058,9 +867,9 @@ | |||
445 | 1058 | 867 | ||
446 | 1059 | this.disable(); | 868 | this.disable(); |
447 | 1060 | 869 | ||
451 | 1061 | if (this._indicateServer) | 870 | if (this._mmapp) |
452 | 1062 | gobject.g_object_unref(this._indicateServer); | 871 | gobject.g_object_unref(this._mmapp); |
453 | 1063 | this._indicateServer = null; | 872 | this._mmapp = null; |
454 | 1064 | 873 | ||
455 | 1065 | AddonManager.removeAddonListener(this); | 874 | AddonManager.removeAddonListener(this); |
456 | 1066 | Services.obs.removeObserver(this, "xpcom-will-shutdown"); | 875 | Services.obs.removeObserver(this, "xpcom-will-shutdown"); |
457 | 1067 | 876 | ||
458 | === removed file 'debian/messagingmenu/modules/dbusmenu.jsm' | |||
459 | --- debian/messagingmenu/modules/dbusmenu.jsm 2012-01-13 09:28:15 +0000 | |||
460 | +++ debian/messagingmenu/modules/dbusmenu.jsm 1970-01-01 00:00:00 +0000 | |||
461 | @@ -1,68 +0,0 @@ | |||
462 | 1 | /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
463 | 2 | /* ***** BEGIN LICENSE BLOCK ***** | ||
464 | 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
465 | 4 | * | ||
466 | 5 | * The contents of this file are subject to the Mozilla Public License Version | ||
467 | 6 | * 1.1 (the "License"); you may not use this file except in compliance with | ||
468 | 7 | * the License. You may obtain a copy of the License at | ||
469 | 8 | * http://www.mozilla.org/MPL/ | ||
470 | 9 | * | ||
471 | 10 | * Software distributed under the License is distributed on an "AS IS" basis, | ||
472 | 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
473 | 12 | * for the specific language governing rights and limitations under the | ||
474 | 13 | * License. | ||
475 | 14 | * | ||
476 | 15 | * The Original Code is messagingmenu-extension | ||
477 | 16 | * | ||
478 | 17 | * The Initial Developer of the Original Code is | ||
479 | 18 | * Mozilla Messaging, Ltd. | ||
480 | 19 | * Portions created by the Initial Developer are Copyright (C) 2010 | ||
481 | 20 | * the Initial Developer. All Rights Reserved. | ||
482 | 21 | * | ||
483 | 22 | * Contributor(s): | ||
484 | 23 | * Mike Conley <mconley@mozillamessaging.com> | ||
485 | 24 | * Chris Coulson <chris.coulson@canonical.com> | ||
486 | 25 | * | ||
487 | 26 | * Alternatively, the contents of this file may be used under the terms of | ||
488 | 27 | * either the GNU General Public License Version 2 or later (the "GPL"), or | ||
489 | 28 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
490 | 29 | * in which case the provisions of the GPL or the LGPL are applicable instead | ||
491 | 30 | * of those above. If you wish to allow use of your version of this file only | ||
492 | 31 | * under the terms of either the GPL or the LGPL, and not to allow others to | ||
493 | 32 | * use your version of this file under the terms of the MPL, indicate your | ||
494 | 33 | * decision by deleting the provisions above and replace them with the notice | ||
495 | 34 | * and other provisions required by the GPL or the LGPL. If you do not delete | ||
496 | 35 | * the provisions above, a recipient may use your version of this file under | ||
497 | 36 | * the terms of any one of the MPL, the GPL or the LGPL. | ||
498 | 37 | * | ||
499 | 38 | * ***** END LICENSE BLOCK ***** */ | ||
500 | 39 | |||
501 | 40 | var EXPORTED_SYMBOLS = [ "dbusmenu" ]; | ||
502 | 41 | |||
503 | 42 | const Cu = Components.utils; | ||
504 | 43 | const Cc = Components.classes; | ||
505 | 44 | const Ci = Components.interfaces; | ||
506 | 45 | |||
507 | 46 | Cu.import("resource://gre/modules/ctypes.jsm"); | ||
508 | 47 | Cu.import("resource://messagingmenu/ctypes-utils.jsm"); | ||
509 | 48 | Cu.import("resource://messagingmenu/gobject.jsm"); | ||
510 | 49 | Cu.import("resource://messagingmenu/glib.jsm"); | ||
511 | 50 | |||
512 | 51 | const DBUSMENU_ABIS = [ 4, 3 ]; | ||
513 | 52 | const DBUSMENU_LIBNAME = "dbusmenu-glib"; | ||
514 | 53 | |||
515 | 54 | function dbusmenu_defines(lib) { | ||
516 | 55 | this.MENUITEM_SIGNAL_ITEM_ACTIVATED = "item-activated"; | ||
517 | 56 | |||
518 | 57 | this.DbusmenuMenuitem = ctypes.StructType("DbusmenuMenuitem"); | ||
519 | 58 | this.DbusmenuServer = ctypes.StructType("DbusmenuServer"); | ||
520 | 59 | |||
521 | 60 | lib.lazy_bind("dbusmenu_menuitem_new", this.DbusmenuMenuitem.ptr); | ||
522 | 61 | lib.lazy_bind("dbusmenu_menuitem_property_set", glib.gboolean, this.DbusmenuMenuitem.ptr, glib.gchar.ptr, glib.gchar.ptr); | ||
523 | 62 | lib.lazy_bind("dbusmenu_menuitem_property_set_bool", glib.gboolean, this.DbusmenuMenuitem.ptr, glib.gchar.ptr, glib.gboolean); | ||
524 | 63 | lib.lazy_bind("dbusmenu_menuitem_child_append", glib.gboolean, this.DbusmenuMenuitem.ptr, this.DbusmenuMenuitem.ptr); | ||
525 | 64 | lib.lazy_bind("dbusmenu_server_new", this.DbusmenuServer.ptr, glib.gchar.ptr); | ||
526 | 65 | lib.lazy_bind("dbusmenu_server_set_root", ctypes.void_t, this.DbusmenuServer.ptr, this.DbusmenuMenuitem.ptr); | ||
527 | 66 | } | ||
528 | 67 | |||
529 | 68 | new ctypes_library(DBUSMENU_LIBNAME, DBUSMENU_ABIS, dbusmenu_defines, this); | ||
530 | 69 | 0 | ||
531 | === removed file 'debian/messagingmenu/modules/indicate.jsm' | |||
532 | --- debian/messagingmenu/modules/indicate.jsm 2012-01-13 09:28:15 +0000 | |||
533 | +++ debian/messagingmenu/modules/indicate.jsm 1970-01-01 00:00:00 +0000 | |||
534 | @@ -1,80 +0,0 @@ | |||
535 | 1 | /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
536 | 2 | /* ***** BEGIN LICENSE BLOCK ***** | ||
537 | 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
538 | 4 | * | ||
539 | 5 | * The contents of this file are subject to the Mozilla Public License Version | ||
540 | 6 | * 1.1 (the "License"); you may not use this file except in compliance with | ||
541 | 7 | * the License. You may obtain a copy of the License at | ||
542 | 8 | * http://www.mozilla.org/MPL/ | ||
543 | 9 | * | ||
544 | 10 | * Software distributed under the License is distributed on an "AS IS" basis, | ||
545 | 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
546 | 12 | * for the specific language governing rights and limitations under the | ||
547 | 13 | * License. | ||
548 | 14 | * | ||
549 | 15 | * The Original Code is messagingmenu-extension | ||
550 | 16 | * | ||
551 | 17 | * The Initial Developer of the Original Code is | ||
552 | 18 | * Mozilla Messaging, Ltd. | ||
553 | 19 | * Portions created by the Initial Developer are Copyright (C) 2010 | ||
554 | 20 | * the Initial Developer. All Rights Reserved. | ||
555 | 21 | * | ||
556 | 22 | * Contributor(s): | ||
557 | 23 | * Mike Conley <mconley@mozillamessaging.com> | ||
558 | 24 | * | ||
559 | 25 | * Alternatively, the contents of this file may be used under the terms of | ||
560 | 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or | ||
561 | 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
562 | 28 | * in which case the provisions of the GPL or the LGPL are applicable instead | ||
563 | 29 | * of those above. If you wish to allow use of your version of this file only | ||
564 | 30 | * under the terms of either the GPL or the LGPL, and not to allow others to | ||
565 | 31 | * use your version of this file under the terms of the MPL, indicate your | ||
566 | 32 | * decision by deleting the provisions above and replace them with the notice | ||
567 | 33 | * and other provisions required by the GPL or the LGPL. If you do not delete | ||
568 | 34 | * the provisions above, a recipient may use your version of this file under | ||
569 | 35 | * the terms of any one of the MPL, the GPL or the LGPL. | ||
570 | 36 | * | ||
571 | 37 | * ***** END LICENSE BLOCK ***** */ | ||
572 | 38 | |||
573 | 39 | var EXPORTED_SYMBOLS = [ "indicate" ]; | ||
574 | 40 | |||
575 | 41 | const Cu = Components.utils; | ||
576 | 42 | const Cc = Components.classes; | ||
577 | 43 | const Ci = Components.interfaces; | ||
578 | 44 | |||
579 | 45 | Cu.import("resource://gre/modules/ctypes.jsm"); | ||
580 | 46 | Cu.import("resource://messagingmenu/ctypes-utils.jsm"); | ||
581 | 47 | Cu.import("resource://messagingmenu/gobject.jsm"); | ||
582 | 48 | Cu.import("resource://messagingmenu/dbusmenu.jsm"); | ||
583 | 49 | Cu.import("resource://messagingmenu/glib.jsm"); | ||
584 | 50 | |||
585 | 51 | const IMPORTS = ["resource://messagingmenu/glib.jsm"]; | ||
586 | 52 | const INDICATE_LIBNAME = "indicate"; | ||
587 | 53 | const INDICATE_ABIS = [ 5 ]; | ||
588 | 54 | |||
589 | 55 | function indicate_defines(lib) { | ||
590 | 56 | this.INDICATOR_MESSAGES_SERVER_TYPE = "message"; | ||
591 | 57 | this.INDICATOR_MESSAGES_PROP_NAME = "name"; | ||
592 | 58 | this.INDICATOR_MESSAGES_PROP_ICON = "icon"; | ||
593 | 59 | this.INDICATOR_MESSAGES_PROP_COUNT = "count"; | ||
594 | 60 | this.INDICATOR_MESSAGES_PROP_TIME = "time"; | ||
595 | 61 | this.INDICATOR_MESSAGES_PROP_ATTENTION = "draw-attention"; | ||
596 | 62 | |||
597 | 63 | this.IndicateServer = ctypes.StructType("IndicateServer"); | ||
598 | 64 | this.Indicator = ctypes.StructType("Indicator"); | ||
599 | 65 | |||
600 | 66 | lib.lazy_bind("indicate_server_ref_default", this.IndicateServer.ptr); | ||
601 | 67 | lib.lazy_bind("indicate_server_set_type", ctypes.void_t, this.IndicateServer.ptr, glib.gchar.ptr); | ||
602 | 68 | lib.lazy_bind("indicate_server_set_desktop_file", ctypes.void_t, this.IndicateServer.ptr, glib.gchar.ptr); | ||
603 | 69 | lib.lazy_bind("indicate_server_show", ctypes.void_t, this.IndicateServer.ptr); | ||
604 | 70 | lib.lazy_bind("indicate_server_hide", ctypes.void_t, this.IndicateServer.ptr); | ||
605 | 71 | lib.lazy_bind("indicate_server_set_menu", ctypes.void_t, this.IndicateServer.ptr, dbusmenu.DbusmenuServer.ptr); | ||
606 | 72 | lib.lazy_bind("indicate_indicator_new", this.Indicator.ptr); | ||
607 | 73 | lib.lazy_bind("indicate_indicator_set_property", ctypes.void_t, this.Indicator.ptr, glib.gchar.ptr, glib.gchar.ptr); | ||
608 | 74 | lib.lazy_bind("indicate_indicator_get_property", glib.gchar.ptr, this.Indicator.ptr, glib.gchar.ptr); | ||
609 | 75 | lib.lazy_bind("indicate_indicator_show", ctypes.void_t, this.Indicator.ptr); | ||
610 | 76 | lib.lazy_bind("indicate_indicator_hide", ctypes.void_t, this.Indicator.ptr); | ||
611 | 77 | lib.lazy_bind("indicate_indicator_is_visible", glib.gboolean, this.Indicator.ptr); | ||
612 | 78 | } | ||
613 | 79 | |||
614 | 80 | new ctypes_library(INDICATE_LIBNAME, INDICATE_ABIS, indicate_defines, this); | ||
615 | 81 | 0 | ||
616 | === added file 'debian/messagingmenu/modules/messagingmenu.jsm' | |||
617 | --- debian/messagingmenu/modules/messagingmenu.jsm 1970-01-01 00:00:00 +0000 | |||
618 | +++ debian/messagingmenu/modules/messagingmenu.jsm 2012-08-23 20:00:25 +0000 | |||
619 | @@ -0,0 +1,74 @@ | |||
620 | 1 | /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
621 | 2 | /* ***** BEGIN LICENSE BLOCK ***** | ||
622 | 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
623 | 4 | * | ||
624 | 5 | * The contents of this file are subject to the Mozilla Public License Version | ||
625 | 6 | * 1.1 (the "License"); you may not use this file except in compliance with | ||
626 | 7 | * the License. You may obtain a copy of the License at | ||
627 | 8 | * http://www.mozilla.org/MPL/ | ||
628 | 9 | * | ||
629 | 10 | * Software distributed under the License is distributed on an "AS IS" basis, | ||
630 | 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
631 | 12 | * for the specific language governing rights and limitations under the | ||
632 | 13 | * License. | ||
633 | 14 | * | ||
634 | 15 | * The Original Code is messagingmenu-extension | ||
635 | 16 | * | ||
636 | 17 | * The Initial Developer of the Original Code is | ||
637 | 18 | * Mozilla Messaging, Ltd. | ||
638 | 19 | * Portions created by the Initial Developer are Copyright (C) 2010 | ||
639 | 20 | * the Initial Developer. All Rights Reserved. | ||
640 | 21 | * | ||
641 | 22 | * Contributor(s): | ||
642 | 23 | * Mike Conley <mconley@mozillamessaging.com> | ||
643 | 24 | * | ||
644 | 25 | * Alternatively, the contents of this file may be used under the terms of | ||
645 | 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or | ||
646 | 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
647 | 28 | * in which case the provisions of the GPL or the LGPL are applicable instead | ||
648 | 29 | * of those above. If you wish to allow use of your version of this file only | ||
649 | 30 | * under the terms of either the GPL or the LGPL, and not to allow others to | ||
650 | 31 | * use your version of this file under the terms of the MPL, indicate your | ||
651 | 32 | * decision by deleting the provisions above and replace them with the notice | ||
652 | 33 | * and other provisions required by the GPL or the LGPL. If you do not delete | ||
653 | 34 | * the provisions above, a recipient may use your version of this file under | ||
654 | 35 | * the terms of any one of the MPL, the GPL or the LGPL. | ||
655 | 36 | * | ||
656 | 37 | * ***** END LICENSE BLOCK ***** */ | ||
657 | 38 | |||
658 | 39 | var EXPORTED_SYMBOLS = [ "messagingmenu" ]; | ||
659 | 40 | |||
660 | 41 | const Cu = Components.utils; | ||
661 | 42 | const Cc = Components.classes; | ||
662 | 43 | const Ci = Components.interfaces; | ||
663 | 44 | |||
664 | 45 | Cu.import("resource://gre/modules/ctypes.jsm"); | ||
665 | 46 | Cu.import("resource://messagingmenu/ctypes-utils.jsm"); | ||
666 | 47 | Cu.import("resource://messagingmenu/gobject.jsm"); | ||
667 | 48 | Cu.import("resource://messagingmenu/glib.jsm"); | ||
668 | 49 | |||
669 | 50 | const IMPORTS = ["resource://messagingmenu/glib.jsm"]; | ||
670 | 51 | const MESSAGING_MENU_LIBNAME = "messaging-menu"; | ||
671 | 52 | const MESSAGING_MENU_ABIS = [ 0 ]; | ||
672 | 53 | |||
673 | 54 | function messaging_menu_defines(lib) { | ||
674 | 55 | this.MessagingMenuApp = ctypes.StructType("MessagingMenuApp"); | ||
675 | 56 | |||
676 | 57 | lib.lazy_bind("messaging_menu_app_new", this.MessagingMenuApp.ptr, glib.gchar.ptr); | ||
677 | 58 | lib.lazy_bind("messaging_menu_app_register", ctypes.void_t, this.MessagingMenuApp.ptr); | ||
678 | 59 | lib.lazy_bind("messaging_menu_app_unregister", ctypes.void_t, this.MessagingMenuApp.ptr); | ||
679 | 60 | |||
680 | 61 | lib.lazy_bind("messaging_menu_app_append_source", | ||
681 | 62 | ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.gpointer, glib.gchar.ptr); | ||
682 | 63 | lib.lazy_bind("messaging_menu_app_append_source_with_count", | ||
683 | 64 | ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.gpointer, glib.gchar.ptr, glib.guint); | ||
684 | 65 | |||
685 | 66 | lib.lazy_bind("messaging_menu_app_remove_source", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr); | ||
686 | 67 | lib.lazy_bind("messaging_menu_app_has_source", glib.gboolean, this.MessagingMenuApp.ptr, glib.gchar.ptr); | ||
687 | 68 | lib.lazy_bind("messaging_menu_app_set_source_count", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.guint); | ||
688 | 69 | lib.lazy_bind("messaging_menu_app_draw_attention", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr); | ||
689 | 70 | lib.lazy_bind("messaging_menu_app_remove_attention", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr); | ||
690 | 71 | } | ||
691 | 72 | |||
692 | 73 | new ctypes_library(MESSAGING_MENU_LIBNAME, MESSAGING_MENU_ABIS, messaging_menu_defines, this); | ||
693 | 74 | |||
694 | 0 | 75 | ||
695 | === modified file 'debian/thunderbird.desktop.in' | |||
696 | --- debian/thunderbird.desktop.in 2012-06-13 00:34:08 +0000 | |||
697 | +++ debian/thunderbird.desktop.in 2012-08-23 20:00:25 +0000 | |||
698 | @@ -176,7 +176,7 @@ | |||
699 | 176 | %%ifdef MOZ_ENABLE_UNITY_INTEGRATION | 176 | %%ifdef MOZ_ENABLE_UNITY_INTEGRATION |
700 | 177 | %%if DISTRIB_VERSION >= 1204 | 177 | %%if DISTRIB_VERSION >= 1204 |
701 | 178 | Actions=Compose;Contacts | 178 | Actions=Compose;Contacts |
703 | 179 | %%define TARGET_ENV OnlyShowIn=Unity; | 179 | %%define TARGET_ENV OnlyShowIn=Messaging Menu;Unity; |
704 | 180 | %%define COMPOSE_SECTION [Desktop Action Compose] | 180 | %%define COMPOSE_SECTION [Desktop Action Compose] |
705 | 181 | %%define CONTACTS_SECTION [Desktop Action Contacts] | 181 | %%define CONTACTS_SECTION [Desktop Action Contacts] |
706 | 182 | %%else | 182 | %%else |
Thanks for working on this. Note that the actual addon is maintained at lp:messagingmenu-extension, so I've merged that work there (and then in to the Thunderbird packaging).
I've merged the desktop file fix separately as well.
Thanks!