Merge lp:~larsu/thunderbird/libmessaging-menu-port into lp:thunderbird/3.3

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
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+121075@code.launchpad.net
To post a comment you must log in.
690. By Lars Karlitski

Make "Contacts" and "Compose" actions show up in the messaging menu

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

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!

review: Approve

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 Cu.import("resource:///modules/iteratorUtils.jsm");
6 Cu.import("resource://messagingmenu/glib.jsm");
7 Cu.import("resource://messagingmenu/gobject.jsm");
8-Cu.import("resource://messagingmenu/dbusmenu.jsm");
9-Cu.import("resource://messagingmenu/indicate.jsm");
10+Cu.import("resource://messagingmenu/messagingmenu.jsm");
11 Cu.import("resource://messagingmenu/unity.jsm");
12 Cu.import("resource://messagingmenu/msgHdrUtils.jsm");
13
14@@ -80,8 +79,6 @@
15 const FOLDER_URL_KEY = "url";
16 const USER_SHARE_APPLICATIONS = "/usr/share/applications/";
17 const SYSTEM_LAUNCHER_ENTRIES = "/usr/share/indicators/messages/applications/";
18-const USER_LAUNCHER_ENTRIES = ".config/indicators/messages/applications/";
19-const USER_BLACKLIST_ENTRIES = ".config/indicators/messages/applications-blacklist/";
20 const MAX_INDICATORS = 6;
21 const ADDON_ID = "messagingmenu@mozilla.com";
22 const PREF_ROOT = "extensions.messagingmenu.";
23@@ -95,10 +92,7 @@
24 const PREF_ACCOUNTS = "mail.accountmanager.accounts";
25 const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
26
27-var open3PaneCallback;
28-var contactsCallback;
29-var composerCallback;
30-var clickIndicatorCallback;
31+var sourceActivatedCallback;
32
33 function injectTimestamp(aTimestamp) {
34 let atts = new gdk.GdkWindowAttributes;
35@@ -138,34 +132,8 @@
36 }
37 }
38
39-function openAndFocus3Pane(aInstance, aTimestamp, aUserData) {
40- LOG("Opening 3pane");
41- openWindowByType("mail:3pane",
42- "chrome://messenger/content/messenger.xul",
43- aTimestamp);
44-}
45-
46-function openAndFocusAddressBook(aInstance, aTimestamp, aUserData) {
47- LOG("Opening addressbook");
48- openWindowByType("mail:addressbook",
49- "chrome://messenger/content/addressbook/addressbook.xul",
50- aTimestamp);
51-}
52-
53-function openAndFocusComposer(aInstance, aTimestamp, aUserData) {
54- LOG("Opening composer");
55- injectTimestamp(aTimestamp);
56- let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]
57- .getService(Ci.nsIWindowWatcher);
58- if (ww) {
59- ww.openWindow(null, "chrome://messenger/content/messengercompose/messengercompose.xul",
60- "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", null);
61- }
62-}
63-
64-function onClickIndicator(aInstance, aTimestamp, aUserData) {
65- let indicator = ctypes.cast(aInstance, indicate.Indicator.ptr);
66- let folderURL = indicate.indicate_indicator_get_property(indicator, FOLDER_URL_KEY).readString();
67+function onSourceActivated(aInstance, aSourceId, aUserData) {
68+ let folderURL = aSourceId.readString();
69 LOG("Received click event on indicator for folder " + folderURL);
70
71 let indicatorEntry = MessagingMenuEngine.mIndicators[folderURL];
72@@ -174,9 +142,6 @@
73 return;
74 }
75
76- // Hide the indicator
77- MessagingMenuEngine.hideIndicator(indicatorEntry);
78-
79 var msg = MessagingMenuEngine.messenger.msgHdrFromURI(indicatorEntry.messageURL);
80 if(!msg) {
81 WARN("Invalid message URI " + indicatorEntry.messageURL);
82@@ -184,7 +149,9 @@
83 }
84
85 // Focus 3pane
86- openAndFocus3Pane(aInstance, aTimestamp, aUserData);
87+ LOG("Opening 3pane");
88+ openWindowByType("mail:3pane",
89+ "chrome://messenger/content/messenger.xul")
90 let win = null;
91 let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
92 .getService(Ci.nsIWindowMediator);
93@@ -490,37 +457,17 @@
94 function MMIndicatorEntry (aFolder) {
95 LOG("Creating indicator for folder " + aFolder.folderURL);
96 this.folder = aFolder;
97- this.indicator = indicate.indicate_indicator_new();
98 this.refreshLabel();
99 this.newCount = 0;
100 this.dateInSeconds = 0;
101 this.cancelAttention();
102 this.hide();
103
104- gobject.g_signal_connect(this.indicator, "user-display",
105- clickIndicatorCallback, null);
106-
107- indicate.indicate_indicator_set_property(this.indicator,
108- FOLDER_URL_KEY,
109- aFolder.folderURL);
110-
111 Services.prefs.addObserver(PREF_ACCOUNTS, this, false);
112 MessagingMenuEngine.prefs.addObserver("", this, false);
113 }
114
115 MMIndicatorEntry.prototype = {
116- get indicator() {
117- if (this._indicator) {
118- return this._indicator;
119- }
120-
121- throw "No IndicateIndicator. Have we been destroyed?";
122- },
123-
124- set indicator(aIndicator) {
125- this._indicator = aIndicator;
126- },
127-
128 requestAttention: function MMIE_requestAttention() {
129 if (!this.active) {
130 WARN("Attempting to request attention for an inactive indicator");
131@@ -539,9 +486,7 @@
132
133 _requestAttention: function MMIE__requestAttention() {
134 LOG("Requesting attention for folder " + this.label);
135- indicate.indicate_indicator_set_property(this.indicator,
136- indicate.INDICATOR_MESSAGES_PROP_ATTENTION,
137- "true");
138+ messagingmenu.messaging_menu_app_draw_attention(MessagingMenuEngine.mmapp, this.folder.folderURL);
139 },
140
141 cancelAttention: function MMIE_cancelAttention() {
142@@ -551,16 +496,11 @@
143 },
144
145 _cancelAttention: function MMIE__cancelAttention() {
146- indicate.indicate_indicator_set_property(this.indicator,
147- indicate.INDICATOR_MESSAGES_PROP_ATTENTION,
148- "false");
149+ messagingmenu.messaging_menu_app_remove_attention(MessagingMenuEngine.mmapp, this.folder.folderURL);
150 },
151
152 set label(aName) {
153 LOG("Setting label for folder " + this.folder.folderURL + " to " + aName);
154- indicate.indicate_indicator_set_property(this.indicator,
155- indicate.INDICATOR_MESSAGES_PROP_NAME,
156- aName);
157 this._label = aName;
158 },
159
160@@ -571,10 +511,17 @@
161 set newCount(aCount) {
162 LOG("Setting unread count for folder " + this.label +
163 " to " + aCount.toString());
164- indicate.indicate_indicator_set_property(this.indicator,
165- indicate.INDICATOR_MESSAGES_PROP_COUNT,
166- aCount.toString());
167 this._newCount = aCount;
168+ if (aCount == 0) {
169+ this.hide();
170+ }
171+ else if (this.visible) {
172+ messagingmenu.messaging_menu_app_set_source_count(MessagingMenuEngine.mmapp, this.folder.folderURL, aCount);
173+ }
174+ else {
175+ messagingmenu.messaging_menu_app_append_source_with_count(
176+ MessagingMenuEngine.mmapp, this.folder.folderURL, null, this.label, aCount);
177+ }
178 },
179
180 get newCount() {
181@@ -592,7 +539,10 @@
182 }
183
184 LOG("Showing indicator for folder " + this.label);
185- indicate.indicate_indicator_show(this.indicator);
186+ if (!this.visible) {
187+ messagingmenu.messaging_menu_app_append_source_with_count(
188+ MessagingMenuEngine.mmapp, this.folder.folderURL, null, this.label, this.newCount);
189+ }
190
191 // Ensure we really request attention now we are being made visible
192 if (this._attention)
193@@ -601,14 +551,11 @@
194
195 hide: function MMIE_hide() {
196 LOG("Hiding indicator for folder " + this.label);
197- indicate.indicate_indicator_hide(this.indicator);
198-
199- // Cancel our request for attention whilst we are hidden
200- this._cancelAttention();
201+ messagingmenu.messaging_menu_app_remove_source(MessagingMenuEngine.mmapp, this.folder.folderURL);
202 },
203
204 get visible() {
205- return indicate.indicate_indicator_is_visible(this.indicator) != 0;
206+ return messagingmenu.messaging_menu_app_has_source(MessagingMenuEngine.mmapp, this.folder.folderURL) != 0;
207 },
208
209 get priority() {
210@@ -760,85 +707,29 @@
211 return this._prefs;
212 },
213
214- get indicateServer() {
215- if (this._indicateServer)
216- return this._indicateServer;
217-
218- let indicateServer = indicate.indicate_server_ref_default();
219- indicate.indicate_server_set_type(indicateServer, "message.email");
220- indicate.indicate_server_set_desktop_file(indicateServer,
221- this.desktopFile);
222-
223- let serverDisplayCB = ctypes.FunctionType(ctypes.default_abi,
224- ctypes.void_t,
225- [glib.gpointer,
226- glib.guint,
227- glib.gpointer]).ptr;
228- open3PaneCallback = serverDisplayCB(openAndFocus3Pane);
229-
230- gobject.g_signal_connect(indicateServer, "server-display",
231- open3PaneCallback, null);
232-
233- let bundle = Services.strings.createBundle(
234- "chrome://messagingmenu/locale/messagingmenu.properties");
235-
236- let server = dbusmenu.dbusmenu_server_new("/messaging/commands");
237- let root = dbusmenu.dbusmenu_menuitem_new();
238-
239- let composeMi = dbusmenu.dbusmenu_menuitem_new();
240- dbusmenu.dbusmenu_menuitem_property_set(composeMi, "label",
241- bundle.GetStringFromName("composeNewMessage"));
242- dbusmenu.dbusmenu_menuitem_property_set_bool(composeMi, "visible", true);
243-
244- let menuItemActivatedCB = ctypes.FunctionType(ctypes.default_abi,
245- ctypes.void_t,
246- [glib.gpointer,
247- glib.guint,
248- glib.gpointer]).ptr;
249- composerCallback = menuItemActivatedCB(openAndFocusComposer);
250-
251- gobject.g_signal_connect(composeMi,
252- dbusmenu.MENUITEM_SIGNAL_ITEM_ACTIVATED,
253- composerCallback, null);
254- dbusmenu.dbusmenu_menuitem_child_append(root, composeMi);
255- // I can't believe that this doesn't inherit from GInitiallyUnowned.
256- // It really, really sucks that we need to do this....
257- gobject.g_object_unref(composeMi);
258-
259- let contactsMi = dbusmenu.dbusmenu_menuitem_new();
260- dbusmenu.dbusmenu_menuitem_property_set(contactsMi, "label",
261- bundle.GetStringFromName("contacts"));
262- dbusmenu.dbusmenu_menuitem_property_set_bool(contactsMi, "visible", true);
263- contactsCallback = menuItemActivatedCB(openAndFocusAddressBook);
264-
265- gobject.g_signal_connect(contactsMi,
266- dbusmenu.MENUITEM_SIGNAL_ITEM_ACTIVATED,
267- contactsCallback, null);
268- dbusmenu.dbusmenu_menuitem_child_append(root, contactsMi);
269- gobject.g_object_unref(contactsMi); // This too
270-
271- dbusmenu.dbusmenu_server_set_root(server, root);
272- gobject.g_object_unref(root); // And this...
273-
274- indicate.indicate_server_set_menu(indicateServer, server);
275- gobject.g_object_unref(server);
276-
277- let displayCB = ctypes.FunctionType(ctypes.default_abi,
278- ctypes.void_t,
279- [glib.gpointer,
280- glib.guint,
281- glib.gpointer]).ptr;
282- clickIndicatorCallback = displayCB(onClickIndicator);
283-
284- this._indicateServer = indicateServer;
285- return this._indicateServer;
286+ get mmapp() {
287+ if (this._mmapp)
288+ return this._mmapp;
289+
290+ let mmapp = messagingmenu.messaging_menu_app_new(Services.appinfo.name.toLowerCase() + '.desktop');
291+
292+ let sourceActivatedCB = ctypes.FunctionType(ctypes.default_abi,
293+ ctypes.void_t,
294+ [glib.gpointer,
295+ glib.gchar.ptr,
296+ glib.gpointer]).ptr;
297+ sourceActivatedCallback = sourceActivatedCB(onSourceActivated);
298+
299+ gobject.g_signal_connect(mmapp, 'activate-source', sourceActivatedCallback, null);
300+
301+ this._mmapp = mmapp;
302+ return this._mmapp;
303 },
304
305 get available() {
306 return (gobject.available() &&
307 gdk.available() &&
308- dbusmenu.available() &&
309- indicate.available());
310+ messagingmenu.available());
311 },
312
313 get badgeCount() {
314@@ -868,28 +759,6 @@
315 }
316 },
317
318- createLauncherEntry: function MME_createLauncherEntry(aDir) {
319- if (!aDir.exists()) {
320- aDir.create(Ci.nsILocalFile.DIRECTORY_TYPE, 0755);
321- }
322- let entry = aDir;
323- entry.append(Services.appinfo.name.toLowerCase());
324- let ostream = FileUtils.openSafeFileOutputStream(entry,
325- FileUtils.MODE_WRONLY |
326- FileUtils.MODE_CREATE |
327- FileUtils.MODE_TRUNCATE);
328- let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
329- .createInstance(Ci.nsIScriptableUnicodeConverter);
330- converter.charset = "UTF-8";
331- let istream = converter.convertToInputStream(this.desktopFile);
332- var self = this;
333- NetUtil.asyncCopy(istream, ostream, function() {
334- self.prefs.setCharPref(PREF_USER_LAUNCHER_PATH, entry.path);
335- self.prefs.setIntPrefAsChar(PREF_USER_LAUNCHER_MTIME,
336- entry.lastModifiedTime);
337- });
338- },
339-
340 init: function MME_init() {
341 if (this.initialized)
342 return;
343@@ -902,31 +771,6 @@
344 return;
345 }
346
347- // Check if we have a static launcher entry in the messaging menu. If we
348- // don't, then we should add one and also display "Contacts" and "Compose"
349- // menu items. If there is one, then it was probably added by the Thunderbird
350- // package. We don't need to create one or show the extra menu items in that case
351- let sysLauncherEntriesDir = Cc["@mozilla.org/file/local;1"]
352- .createInstance(Ci.nsILocalFile);
353- sysLauncherEntriesDir.initWithPath(SYSTEM_LAUNCHER_ENTRIES);
354- LauncherEntryFind(sysLauncherEntriesDir, this.desktopFile,
355- function(aFile) {
356- if(!aFile) {
357- // There is no system-provided static launcher entry for us in the
358- // messaging menu
359- var userLauncherEntriesDir = Services.dirsvc.get("Home",
360- Ci.nsILocalFile);
361- userLauncherEntriesDir.appendRelativePath(USER_LAUNCHER_ENTRIES);
362- LauncherEntryFind(userLauncherEntriesDir,
363- this.desktopFile,
364- function(aFile) {
365- if (!aFile) {
366- MessagingMenuEngine.createLauncherEntry(userLauncherEntriesDir);
367- }
368- });
369- }
370- });
371-
372 AddonManager.addAddonListener(this);
373 this.prefs.addObserver("", this, false);
374 Services.obs.addObserver(this, "xpcom-will-shutdown", false);
375@@ -950,22 +794,12 @@
376
377 LOG("Enabling messaging indicator");
378
379- if (!this.indicateServer) {
380- Cu.reportError("Could not construct the Messaging Menu server.");
381+ if (!this.mmapp) {
382+ Cu.reportError("Could not connect to the Messaging Menu.");
383 return;
384 }
385
386- indicate.indicate_server_show(this.indicateServer);
387-
388- let userBlacklistDir = Services.dirsvc.get("Home", Ci.nsILocalFile);
389- userBlacklistDir.appendRelativePath(USER_BLACKLIST_ENTRIES);
390- LauncherEntryFind(userBlacklistDir, this.desktopFile,
391- function(aFile) {
392- if (aFile) {
393- LOG("Removing launcher entry " + aFile.path);
394- aFile.remove(false);
395- }
396- });
397+ messagingmenu.messaging_menu_app_register(this.mmapp);
398
399 let notificationFlags = Ci.nsIFolderListener.added |
400 Ci.nsIFolderListener.boolPropertyChanged
401@@ -976,30 +810,8 @@
402
403 disableAndHide: function MME_disableAndHide() {
404 LOG("Hiding messaging indicator");
405- var userBlacklistDir = Services.dirsvc.get("Home", Ci.nsILocalFile);
406- userBlacklistDir.appendRelativePath(USER_BLACKLIST_ENTRIES);
407- LauncherEntryFind(userBlacklistDir, this.desktopFile,
408- function(aFile) {
409- if (aFile)
410- return;
411-
412- if (!userBlacklistDir.exists()) {
413- userBlacklistDir.create(Ci.nsILocalFile.DIRECTORY_TYPE, 0755);
414- }
415-
416- let entry = userBlacklistDir.clone();
417- entry.append(Services.appinfo.name.toLowerCase());
418- let ostream = FileUtils.openSafeFileOutputStream(entry,
419- FileUtils.MODE_WRONLY |
420- FileUtils.MODE_CREATE |
421- FileUtils.MODE_TRUNCATE);
422- let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
423- .createInstance(Ci.nsIScriptableUnicodeConverter);
424- converter.charset = "UTF-8";
425- let istream = converter.convertToInputStream(this.desktopFile);
426- var self = this;
427- NetUtil.asyncCopy(istream, ostream, null);
428- });
429+
430+ messagingmenu.messaging_menu_app_unregister(this.mmapp);
431
432 this.disable();
433 },
434@@ -1040,9 +852,6 @@
435 this.mIndicators = {};
436 this.visibleIndicators = 0;
437
438- if (this._indicateServer)
439- indicate.indicate_server_hide(this._indicateServer);
440-
441 this.badgeCount = 0;
442
443 this.enabled = false;
444@@ -1058,9 +867,9 @@
445
446 this.disable();
447
448- if (this._indicateServer)
449- gobject.g_object_unref(this._indicateServer);
450- this._indicateServer = null;
451+ if (this._mmapp)
452+ gobject.g_object_unref(this._mmapp);
453+ this._mmapp = null;
454
455 AddonManager.removeAddonListener(this);
456 Services.obs.removeObserver(this, "xpcom-will-shutdown");
457
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-/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
463-/* ***** BEGIN LICENSE BLOCK *****
464- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
465- *
466- * The contents of this file are subject to the Mozilla Public License Version
467- * 1.1 (the "License"); you may not use this file except in compliance with
468- * the License. You may obtain a copy of the License at
469- * http://www.mozilla.org/MPL/
470- *
471- * Software distributed under the License is distributed on an "AS IS" basis,
472- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
473- * for the specific language governing rights and limitations under the
474- * License.
475- *
476- * The Original Code is messagingmenu-extension
477- *
478- * The Initial Developer of the Original Code is
479- * Mozilla Messaging, Ltd.
480- * Portions created by the Initial Developer are Copyright (C) 2010
481- * the Initial Developer. All Rights Reserved.
482- *
483- * Contributor(s):
484- * Mike Conley <mconley@mozillamessaging.com>
485- * Chris Coulson <chris.coulson@canonical.com>
486- *
487- * Alternatively, the contents of this file may be used under the terms of
488- * either the GNU General Public License Version 2 or later (the "GPL"), or
489- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
490- * in which case the provisions of the GPL or the LGPL are applicable instead
491- * of those above. If you wish to allow use of your version of this file only
492- * under the terms of either the GPL or the LGPL, and not to allow others to
493- * use your version of this file under the terms of the MPL, indicate your
494- * decision by deleting the provisions above and replace them with the notice
495- * and other provisions required by the GPL or the LGPL. If you do not delete
496- * the provisions above, a recipient may use your version of this file under
497- * the terms of any one of the MPL, the GPL or the LGPL.
498- *
499- * ***** END LICENSE BLOCK ***** */
500-
501-var EXPORTED_SYMBOLS = [ "dbusmenu" ];
502-
503-const Cu = Components.utils;
504-const Cc = Components.classes;
505-const Ci = Components.interfaces;
506-
507-Cu.import("resource://gre/modules/ctypes.jsm");
508-Cu.import("resource://messagingmenu/ctypes-utils.jsm");
509-Cu.import("resource://messagingmenu/gobject.jsm");
510-Cu.import("resource://messagingmenu/glib.jsm");
511-
512-const DBUSMENU_ABIS = [ 4, 3 ];
513-const DBUSMENU_LIBNAME = "dbusmenu-glib";
514-
515-function dbusmenu_defines(lib) {
516- this.MENUITEM_SIGNAL_ITEM_ACTIVATED = "item-activated";
517-
518- this.DbusmenuMenuitem = ctypes.StructType("DbusmenuMenuitem");
519- this.DbusmenuServer = ctypes.StructType("DbusmenuServer");
520-
521- lib.lazy_bind("dbusmenu_menuitem_new", this.DbusmenuMenuitem.ptr);
522- lib.lazy_bind("dbusmenu_menuitem_property_set", glib.gboolean, this.DbusmenuMenuitem.ptr, glib.gchar.ptr, glib.gchar.ptr);
523- lib.lazy_bind("dbusmenu_menuitem_property_set_bool", glib.gboolean, this.DbusmenuMenuitem.ptr, glib.gchar.ptr, glib.gboolean);
524- lib.lazy_bind("dbusmenu_menuitem_child_append", glib.gboolean, this.DbusmenuMenuitem.ptr, this.DbusmenuMenuitem.ptr);
525- lib.lazy_bind("dbusmenu_server_new", this.DbusmenuServer.ptr, glib.gchar.ptr);
526- lib.lazy_bind("dbusmenu_server_set_root", ctypes.void_t, this.DbusmenuServer.ptr, this.DbusmenuMenuitem.ptr);
527-}
528-
529-new ctypes_library(DBUSMENU_LIBNAME, DBUSMENU_ABIS, dbusmenu_defines, this);
530
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-/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
536-/* ***** BEGIN LICENSE BLOCK *****
537- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
538- *
539- * The contents of this file are subject to the Mozilla Public License Version
540- * 1.1 (the "License"); you may not use this file except in compliance with
541- * the License. You may obtain a copy of the License at
542- * http://www.mozilla.org/MPL/
543- *
544- * Software distributed under the License is distributed on an "AS IS" basis,
545- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
546- * for the specific language governing rights and limitations under the
547- * License.
548- *
549- * The Original Code is messagingmenu-extension
550- *
551- * The Initial Developer of the Original Code is
552- * Mozilla Messaging, Ltd.
553- * Portions created by the Initial Developer are Copyright (C) 2010
554- * the Initial Developer. All Rights Reserved.
555- *
556- * Contributor(s):
557- * Mike Conley <mconley@mozillamessaging.com>
558- *
559- * Alternatively, the contents of this file may be used under the terms of
560- * either the GNU General Public License Version 2 or later (the "GPL"), or
561- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
562- * in which case the provisions of the GPL or the LGPL are applicable instead
563- * of those above. If you wish to allow use of your version of this file only
564- * under the terms of either the GPL or the LGPL, and not to allow others to
565- * use your version of this file under the terms of the MPL, indicate your
566- * decision by deleting the provisions above and replace them with the notice
567- * and other provisions required by the GPL or the LGPL. If you do not delete
568- * the provisions above, a recipient may use your version of this file under
569- * the terms of any one of the MPL, the GPL or the LGPL.
570- *
571- * ***** END LICENSE BLOCK ***** */
572-
573-var EXPORTED_SYMBOLS = [ "indicate" ];
574-
575-const Cu = Components.utils;
576-const Cc = Components.classes;
577-const Ci = Components.interfaces;
578-
579-Cu.import("resource://gre/modules/ctypes.jsm");
580-Cu.import("resource://messagingmenu/ctypes-utils.jsm");
581-Cu.import("resource://messagingmenu/gobject.jsm");
582-Cu.import("resource://messagingmenu/dbusmenu.jsm");
583-Cu.import("resource://messagingmenu/glib.jsm");
584-
585-const IMPORTS = ["resource://messagingmenu/glib.jsm"];
586-const INDICATE_LIBNAME = "indicate";
587-const INDICATE_ABIS = [ 5 ];
588-
589-function indicate_defines(lib) {
590- this.INDICATOR_MESSAGES_SERVER_TYPE = "message";
591- this.INDICATOR_MESSAGES_PROP_NAME = "name";
592- this.INDICATOR_MESSAGES_PROP_ICON = "icon";
593- this.INDICATOR_MESSAGES_PROP_COUNT = "count";
594- this.INDICATOR_MESSAGES_PROP_TIME = "time";
595- this.INDICATOR_MESSAGES_PROP_ATTENTION = "draw-attention";
596-
597- this.IndicateServer = ctypes.StructType("IndicateServer");
598- this.Indicator = ctypes.StructType("Indicator");
599-
600- lib.lazy_bind("indicate_server_ref_default", this.IndicateServer.ptr);
601- lib.lazy_bind("indicate_server_set_type", ctypes.void_t, this.IndicateServer.ptr, glib.gchar.ptr);
602- lib.lazy_bind("indicate_server_set_desktop_file", ctypes.void_t, this.IndicateServer.ptr, glib.gchar.ptr);
603- lib.lazy_bind("indicate_server_show", ctypes.void_t, this.IndicateServer.ptr);
604- lib.lazy_bind("indicate_server_hide", ctypes.void_t, this.IndicateServer.ptr);
605- lib.lazy_bind("indicate_server_set_menu", ctypes.void_t, this.IndicateServer.ptr, dbusmenu.DbusmenuServer.ptr);
606- lib.lazy_bind("indicate_indicator_new", this.Indicator.ptr);
607- lib.lazy_bind("indicate_indicator_set_property", ctypes.void_t, this.Indicator.ptr, glib.gchar.ptr, glib.gchar.ptr);
608- lib.lazy_bind("indicate_indicator_get_property", glib.gchar.ptr, this.Indicator.ptr, glib.gchar.ptr);
609- lib.lazy_bind("indicate_indicator_show", ctypes.void_t, this.Indicator.ptr);
610- lib.lazy_bind("indicate_indicator_hide", ctypes.void_t, this.Indicator.ptr);
611- lib.lazy_bind("indicate_indicator_is_visible", glib.gboolean, this.Indicator.ptr);
612-}
613-
614-new ctypes_library(INDICATE_LIBNAME, INDICATE_ABIS, indicate_defines, this);
615
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+/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
621+/* ***** BEGIN LICENSE BLOCK *****
622+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
623+ *
624+ * The contents of this file are subject to the Mozilla Public License Version
625+ * 1.1 (the "License"); you may not use this file except in compliance with
626+ * the License. You may obtain a copy of the License at
627+ * http://www.mozilla.org/MPL/
628+ *
629+ * Software distributed under the License is distributed on an "AS IS" basis,
630+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
631+ * for the specific language governing rights and limitations under the
632+ * License.
633+ *
634+ * The Original Code is messagingmenu-extension
635+ *
636+ * The Initial Developer of the Original Code is
637+ * Mozilla Messaging, Ltd.
638+ * Portions created by the Initial Developer are Copyright (C) 2010
639+ * the Initial Developer. All Rights Reserved.
640+ *
641+ * Contributor(s):
642+ * Mike Conley <mconley@mozillamessaging.com>
643+ *
644+ * Alternatively, the contents of this file may be used under the terms of
645+ * either the GNU General Public License Version 2 or later (the "GPL"), or
646+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
647+ * in which case the provisions of the GPL or the LGPL are applicable instead
648+ * of those above. If you wish to allow use of your version of this file only
649+ * under the terms of either the GPL or the LGPL, and not to allow others to
650+ * use your version of this file under the terms of the MPL, indicate your
651+ * decision by deleting the provisions above and replace them with the notice
652+ * and other provisions required by the GPL or the LGPL. If you do not delete
653+ * the provisions above, a recipient may use your version of this file under
654+ * the terms of any one of the MPL, the GPL or the LGPL.
655+ *
656+ * ***** END LICENSE BLOCK ***** */
657+
658+var EXPORTED_SYMBOLS = [ "messagingmenu" ];
659+
660+const Cu = Components.utils;
661+const Cc = Components.classes;
662+const Ci = Components.interfaces;
663+
664+Cu.import("resource://gre/modules/ctypes.jsm");
665+Cu.import("resource://messagingmenu/ctypes-utils.jsm");
666+Cu.import("resource://messagingmenu/gobject.jsm");
667+Cu.import("resource://messagingmenu/glib.jsm");
668+
669+const IMPORTS = ["resource://messagingmenu/glib.jsm"];
670+const MESSAGING_MENU_LIBNAME = "messaging-menu";
671+const MESSAGING_MENU_ABIS = [ 0 ];
672+
673+function messaging_menu_defines(lib) {
674+ this.MessagingMenuApp = ctypes.StructType("MessagingMenuApp");
675+
676+ lib.lazy_bind("messaging_menu_app_new", this.MessagingMenuApp.ptr, glib.gchar.ptr);
677+ lib.lazy_bind("messaging_menu_app_register", ctypes.void_t, this.MessagingMenuApp.ptr);
678+ lib.lazy_bind("messaging_menu_app_unregister", ctypes.void_t, this.MessagingMenuApp.ptr);
679+
680+ lib.lazy_bind("messaging_menu_app_append_source",
681+ ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.gpointer, glib.gchar.ptr);
682+ lib.lazy_bind("messaging_menu_app_append_source_with_count",
683+ ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.gpointer, glib.gchar.ptr, glib.guint);
684+
685+ lib.lazy_bind("messaging_menu_app_remove_source", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr);
686+ lib.lazy_bind("messaging_menu_app_has_source", glib.gboolean, this.MessagingMenuApp.ptr, glib.gchar.ptr);
687+ lib.lazy_bind("messaging_menu_app_set_source_count", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.guint);
688+ lib.lazy_bind("messaging_menu_app_draw_attention", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr);
689+ lib.lazy_bind("messaging_menu_app_remove_attention", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr);
690+}
691+
692+new ctypes_library(MESSAGING_MENU_LIBNAME, MESSAGING_MENU_ABIS, messaging_menu_defines, this);
693+
694
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 %%ifdef MOZ_ENABLE_UNITY_INTEGRATION
700 %%if DISTRIB_VERSION >= 1204
701 Actions=Compose;Contacts
702-%%define TARGET_ENV OnlyShowIn=Unity;
703+%%define TARGET_ENV OnlyShowIn=Messaging Menu;Unity;
704 %%define COMPOSE_SECTION [Desktop Action Compose]
705 %%define CONTACTS_SECTION [Desktop Action Contacts]
706 %%else

Subscribers

People subscribed via source and target branches