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
=== modified file 'debian/messagingmenu/modules/MessagingMenu.jsm'
--- debian/messagingmenu/modules/MessagingMenu.jsm 2012-02-16 17:38:02 +0000
+++ debian/messagingmenu/modules/MessagingMenu.jsm 2012-08-23 20:00:25 +0000
@@ -52,8 +52,7 @@
52Cu.import("resource:///modules/iteratorUtils.jsm");52Cu.import("resource:///modules/iteratorUtils.jsm");
53Cu.import("resource://messagingmenu/glib.jsm");53Cu.import("resource://messagingmenu/glib.jsm");
54Cu.import("resource://messagingmenu/gobject.jsm");54Cu.import("resource://messagingmenu/gobject.jsm");
55Cu.import("resource://messagingmenu/dbusmenu.jsm");55Cu.import("resource://messagingmenu/messagingmenu.jsm");
56Cu.import("resource://messagingmenu/indicate.jsm");
57Cu.import("resource://messagingmenu/unity.jsm");56Cu.import("resource://messagingmenu/unity.jsm");
58Cu.import("resource://messagingmenu/msgHdrUtils.jsm");57Cu.import("resource://messagingmenu/msgHdrUtils.jsm");
5958
@@ -80,8 +79,6 @@
80const FOLDER_URL_KEY = "url";79const FOLDER_URL_KEY = "url";
81const USER_SHARE_APPLICATIONS = "/usr/share/applications/";80const USER_SHARE_APPLICATIONS = "/usr/share/applications/";
82const SYSTEM_LAUNCHER_ENTRIES = "/usr/share/indicators/messages/applications/";81const SYSTEM_LAUNCHER_ENTRIES = "/usr/share/indicators/messages/applications/";
83const USER_LAUNCHER_ENTRIES = ".config/indicators/messages/applications/";
84const USER_BLACKLIST_ENTRIES = ".config/indicators/messages/applications-blacklist/";
85const MAX_INDICATORS = 6;82const MAX_INDICATORS = 6;
86const ADDON_ID = "messagingmenu@mozilla.com";83const ADDON_ID = "messagingmenu@mozilla.com";
87const PREF_ROOT = "extensions.messagingmenu.";84const PREF_ROOT = "extensions.messagingmenu.";
@@ -95,10 +92,7 @@
95const PREF_ACCOUNTS = "mail.accountmanager.accounts";92const PREF_ACCOUNTS = "mail.accountmanager.accounts";
96const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";93const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
9794
98var open3PaneCallback;95var sourceActivatedCallback;
99var contactsCallback;
100var composerCallback;
101var clickIndicatorCallback;
10296
103function injectTimestamp(aTimestamp) {97function injectTimestamp(aTimestamp) {
104 let atts = new gdk.GdkWindowAttributes;98 let atts = new gdk.GdkWindowAttributes;
@@ -138,34 +132,8 @@
138 }132 }
139}133}
140134
141function openAndFocus3Pane(aInstance, aTimestamp, aUserData) {135function onSourceActivated(aInstance, aSourceId, aUserData) {
142 LOG("Opening 3pane");136 let folderURL = aSourceId.readString();
143 openWindowByType("mail:3pane",
144 "chrome://messenger/content/messenger.xul",
145 aTimestamp);
146}
147
148function openAndFocusAddressBook(aInstance, aTimestamp, aUserData) {
149 LOG("Opening addressbook");
150 openWindowByType("mail:addressbook",
151 "chrome://messenger/content/addressbook/addressbook.xul",
152 aTimestamp);
153}
154
155function openAndFocusComposer(aInstance, aTimestamp, aUserData) {
156 LOG("Opening composer");
157 injectTimestamp(aTimestamp);
158 let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]
159 .getService(Ci.nsIWindowWatcher);
160 if (ww) {
161 ww.openWindow(null, "chrome://messenger/content/messengercompose/messengercompose.xul",
162 "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", null);
163 }
164}
165
166function onClickIndicator(aInstance, aTimestamp, aUserData) {
167 let indicator = ctypes.cast(aInstance, indicate.Indicator.ptr);
168 let folderURL = indicate.indicate_indicator_get_property(indicator, FOLDER_URL_KEY).readString();
169 LOG("Received click event on indicator for folder " + folderURL);137 LOG("Received click event on indicator for folder " + folderURL);
170138
171 let indicatorEntry = MessagingMenuEngine.mIndicators[folderURL];139 let indicatorEntry = MessagingMenuEngine.mIndicators[folderURL];
@@ -174,9 +142,6 @@
174 return;142 return;
175 }143 }
176144
177 // Hide the indicator
178 MessagingMenuEngine.hideIndicator(indicatorEntry);
179
180 var msg = MessagingMenuEngine.messenger.msgHdrFromURI(indicatorEntry.messageURL);145 var msg = MessagingMenuEngine.messenger.msgHdrFromURI(indicatorEntry.messageURL);
181 if(!msg) {146 if(!msg) {
182 WARN("Invalid message URI " + indicatorEntry.messageURL);147 WARN("Invalid message URI " + indicatorEntry.messageURL);
@@ -184,7 +149,9 @@
184 }149 }
185150
186 // Focus 3pane151 // Focus 3pane
187 openAndFocus3Pane(aInstance, aTimestamp, aUserData);152 LOG("Opening 3pane");
153 openWindowByType("mail:3pane",
154 "chrome://messenger/content/messenger.xul")
188 let win = null;155 let win = null;
189 let wm = Cc["@mozilla.org/appshell/window-mediator;1"]156 let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
190 .getService(Ci.nsIWindowMediator);157 .getService(Ci.nsIWindowMediator);
@@ -490,37 +457,17 @@
490function MMIndicatorEntry (aFolder) {457function MMIndicatorEntry (aFolder) {
491 LOG("Creating indicator for folder " + aFolder.folderURL);458 LOG("Creating indicator for folder " + aFolder.folderURL);
492 this.folder = aFolder;459 this.folder = aFolder;
493 this.indicator = indicate.indicate_indicator_new();
494 this.refreshLabel();460 this.refreshLabel();
495 this.newCount = 0;461 this.newCount = 0;
496 this.dateInSeconds = 0;462 this.dateInSeconds = 0;
497 this.cancelAttention();463 this.cancelAttention();
498 this.hide();464 this.hide();
499465
500 gobject.g_signal_connect(this.indicator, "user-display",
501 clickIndicatorCallback, null);
502
503 indicate.indicate_indicator_set_property(this.indicator,
504 FOLDER_URL_KEY,
505 aFolder.folderURL);
506
507 Services.prefs.addObserver(PREF_ACCOUNTS, this, false);466 Services.prefs.addObserver(PREF_ACCOUNTS, this, false);
508 MessagingMenuEngine.prefs.addObserver("", this, false);467 MessagingMenuEngine.prefs.addObserver("", this, false);
509}468}
510469
511MMIndicatorEntry.prototype = {470MMIndicatorEntry.prototype = {
512 get indicator() {
513 if (this._indicator) {
514 return this._indicator;
515 }
516
517 throw "No IndicateIndicator. Have we been destroyed?";
518 },
519
520 set indicator(aIndicator) {
521 this._indicator = aIndicator;
522 },
523
524 requestAttention: function MMIE_requestAttention() {471 requestAttention: function MMIE_requestAttention() {
525 if (!this.active) {472 if (!this.active) {
526 WARN("Attempting to request attention for an inactive indicator");473 WARN("Attempting to request attention for an inactive indicator");
@@ -539,9 +486,7 @@
539486
540 _requestAttention: function MMIE__requestAttention() {487 _requestAttention: function MMIE__requestAttention() {
541 LOG("Requesting attention for folder " + this.label);488 LOG("Requesting attention for folder " + this.label);
542 indicate.indicate_indicator_set_property(this.indicator,489 messagingmenu.messaging_menu_app_draw_attention(MessagingMenuEngine.mmapp, this.folder.folderURL);
543 indicate.INDICATOR_MESSAGES_PROP_ATTENTION,
544 "true");
545 },490 },
546491
547 cancelAttention: function MMIE_cancelAttention() {492 cancelAttention: function MMIE_cancelAttention() {
@@ -551,16 +496,11 @@
551 },496 },
552497
553 _cancelAttention: function MMIE__cancelAttention() {498 _cancelAttention: function MMIE__cancelAttention() {
554 indicate.indicate_indicator_set_property(this.indicator,499 messagingmenu.messaging_menu_app_remove_attention(MessagingMenuEngine.mmapp, this.folder.folderURL);
555 indicate.INDICATOR_MESSAGES_PROP_ATTENTION,
556 "false");
557 },500 },
558501
559 set label(aName) {502 set label(aName) {
560 LOG("Setting label for folder " + this.folder.folderURL + " to " + aName);503 LOG("Setting label for folder " + this.folder.folderURL + " to " + aName);
561 indicate.indicate_indicator_set_property(this.indicator,
562 indicate.INDICATOR_MESSAGES_PROP_NAME,
563 aName);
564 this._label = aName;504 this._label = aName;
565 },505 },
566506
@@ -571,10 +511,17 @@
571 set newCount(aCount) {511 set newCount(aCount) {
572 LOG("Setting unread count for folder " + this.label +512 LOG("Setting unread count for folder " + this.label +
573 " to " + aCount.toString());513 " to " + aCount.toString());
574 indicate.indicate_indicator_set_property(this.indicator,
575 indicate.INDICATOR_MESSAGES_PROP_COUNT,
576 aCount.toString());
577 this._newCount = aCount;514 this._newCount = aCount;
515 if (aCount == 0) {
516 this.hide();
517 }
518 else if (this.visible) {
519 messagingmenu.messaging_menu_app_set_source_count(MessagingMenuEngine.mmapp, this.folder.folderURL, aCount);
520 }
521 else {
522 messagingmenu.messaging_menu_app_append_source_with_count(
523 MessagingMenuEngine.mmapp, this.folder.folderURL, null, this.label, aCount);
524 }
578 },525 },
579526
580 get newCount() {527 get newCount() {
@@ -592,7 +539,10 @@
592 }539 }
593540
594 LOG("Showing indicator for folder " + this.label);541 LOG("Showing indicator for folder " + this.label);
595 indicate.indicate_indicator_show(this.indicator);542 if (!this.visible) {
543 messagingmenu.messaging_menu_app_append_source_with_count(
544 MessagingMenuEngine.mmapp, this.folder.folderURL, null, this.label, this.newCount);
545 }
596546
597 // Ensure we really request attention now we are being made visible547 // Ensure we really request attention now we are being made visible
598 if (this._attention)548 if (this._attention)
@@ -601,14 +551,11 @@
601551
602 hide: function MMIE_hide() {552 hide: function MMIE_hide() {
603 LOG("Hiding indicator for folder " + this.label);553 LOG("Hiding indicator for folder " + this.label);
604 indicate.indicate_indicator_hide(this.indicator);554 messagingmenu.messaging_menu_app_remove_source(MessagingMenuEngine.mmapp, this.folder.folderURL);
605
606 // Cancel our request for attention whilst we are hidden
607 this._cancelAttention();
608 },555 },
609556
610 get visible() {557 get visible() {
611 return indicate.indicate_indicator_is_visible(this.indicator) != 0;558 return messagingmenu.messaging_menu_app_has_source(MessagingMenuEngine.mmapp, this.folder.folderURL) != 0;
612 },559 },
613560
614 get priority() {561 get priority() {
@@ -760,85 +707,29 @@
760 return this._prefs;707 return this._prefs;
761 },708 },
762709
763 get indicateServer() {710 get mmapp() {
764 if (this._indicateServer)711 if (this._mmapp)
765 return this._indicateServer;712 return this._mmapp;
766713
767 let indicateServer = indicate.indicate_server_ref_default();714 let mmapp = messagingmenu.messaging_menu_app_new(Services.appinfo.name.toLowerCase() + '.desktop');
768 indicate.indicate_server_set_type(indicateServer, "message.email");715
769 indicate.indicate_server_set_desktop_file(indicateServer, 716 let sourceActivatedCB = ctypes.FunctionType(ctypes.default_abi,
770 this.desktopFile);717 ctypes.void_t,
771718 [glib.gpointer,
772 let serverDisplayCB = ctypes.FunctionType(ctypes.default_abi,719 glib.gchar.ptr,
773 ctypes.void_t,720 glib.gpointer]).ptr;
774 [glib.gpointer,721 sourceActivatedCallback = sourceActivatedCB(onSourceActivated);
775 glib.guint,722
776 glib.gpointer]).ptr;723 gobject.g_signal_connect(mmapp, 'activate-source', sourceActivatedCallback, null);
777 open3PaneCallback = serverDisplayCB(openAndFocus3Pane);724
778725 this._mmapp = mmapp;
779 gobject.g_signal_connect(indicateServer, "server-display",726 return this._mmapp;
780 open3PaneCallback, null);
781
782 let bundle = Services.strings.createBundle(
783 "chrome://messagingmenu/locale/messagingmenu.properties");
784
785 let server = dbusmenu.dbusmenu_server_new("/messaging/commands");
786 let root = dbusmenu.dbusmenu_menuitem_new();
787
788 let composeMi = dbusmenu.dbusmenu_menuitem_new();
789 dbusmenu.dbusmenu_menuitem_property_set(composeMi, "label",
790 bundle.GetStringFromName("composeNewMessage"));
791 dbusmenu.dbusmenu_menuitem_property_set_bool(composeMi, "visible", true);
792
793 let menuItemActivatedCB = ctypes.FunctionType(ctypes.default_abi,
794 ctypes.void_t,
795 [glib.gpointer,
796 glib.guint,
797 glib.gpointer]).ptr;
798 composerCallback = menuItemActivatedCB(openAndFocusComposer);
799
800 gobject.g_signal_connect(composeMi,
801 dbusmenu.MENUITEM_SIGNAL_ITEM_ACTIVATED,
802 composerCallback, null);
803 dbusmenu.dbusmenu_menuitem_child_append(root, composeMi);
804 // I can't believe that this doesn't inherit from GInitiallyUnowned.
805 // It really, really sucks that we need to do this....
806 gobject.g_object_unref(composeMi);
807
808 let contactsMi = dbusmenu.dbusmenu_menuitem_new();
809 dbusmenu.dbusmenu_menuitem_property_set(contactsMi, "label",
810 bundle.GetStringFromName("contacts"));
811 dbusmenu.dbusmenu_menuitem_property_set_bool(contactsMi, "visible", true);
812 contactsCallback = menuItemActivatedCB(openAndFocusAddressBook);
813
814 gobject.g_signal_connect(contactsMi,
815 dbusmenu.MENUITEM_SIGNAL_ITEM_ACTIVATED,
816 contactsCallback, null);
817 dbusmenu.dbusmenu_menuitem_child_append(root, contactsMi);
818 gobject.g_object_unref(contactsMi); // This too
819
820 dbusmenu.dbusmenu_server_set_root(server, root);
821 gobject.g_object_unref(root); // And this...
822
823 indicate.indicate_server_set_menu(indicateServer, server);
824 gobject.g_object_unref(server);
825
826 let displayCB = ctypes.FunctionType(ctypes.default_abi,
827 ctypes.void_t,
828 [glib.gpointer,
829 glib.guint,
830 glib.gpointer]).ptr;
831 clickIndicatorCallback = displayCB(onClickIndicator);
832
833 this._indicateServer = indicateServer;
834 return this._indicateServer;
835 },727 },
836728
837 get available() {729 get available() {
838 return (gobject.available() &&730 return (gobject.available() &&
839 gdk.available() &&731 gdk.available() &&
840 dbusmenu.available() &&732 messagingmenu.available());
841 indicate.available());
842 },733 },
843734
844 get badgeCount() {735 get badgeCount() {
@@ -868,28 +759,6 @@
868 }759 }
869 },760 },
870761
871 createLauncherEntry: function MME_createLauncherEntry(aDir) {
872 if (!aDir.exists()) {
873 aDir.create(Ci.nsILocalFile.DIRECTORY_TYPE, 0755);
874 }
875 let entry = aDir;
876 entry.append(Services.appinfo.name.toLowerCase());
877 let ostream = FileUtils.openSafeFileOutputStream(entry,
878 FileUtils.MODE_WRONLY |
879 FileUtils.MODE_CREATE |
880 FileUtils.MODE_TRUNCATE);
881 let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
882 .createInstance(Ci.nsIScriptableUnicodeConverter);
883 converter.charset = "UTF-8";
884 let istream = converter.convertToInputStream(this.desktopFile);
885 var self = this;
886 NetUtil.asyncCopy(istream, ostream, function() {
887 self.prefs.setCharPref(PREF_USER_LAUNCHER_PATH, entry.path);
888 self.prefs.setIntPrefAsChar(PREF_USER_LAUNCHER_MTIME,
889 entry.lastModifiedTime);
890 });
891 },
892
893 init: function MME_init() {762 init: function MME_init() {
894 if (this.initialized)763 if (this.initialized)
895 return;764 return;
@@ -902,31 +771,6 @@
902 return;771 return;
903 }772 }
904773
905 // Check if we have a static launcher entry in the messaging menu. If we
906 // don't, then we should add one and also display "Contacts" and "Compose"
907 // menu items. If there is one, then it was probably added by the Thunderbird
908 // package. We don't need to create one or show the extra menu items in that case
909 let sysLauncherEntriesDir = Cc["@mozilla.org/file/local;1"]
910 .createInstance(Ci.nsILocalFile);
911 sysLauncherEntriesDir.initWithPath(SYSTEM_LAUNCHER_ENTRIES);
912 LauncherEntryFind(sysLauncherEntriesDir, this.desktopFile,
913 function(aFile) {
914 if(!aFile) {
915 // There is no system-provided static launcher entry for us in the
916 // messaging menu
917 var userLauncherEntriesDir = Services.dirsvc.get("Home",
918 Ci.nsILocalFile);
919 userLauncherEntriesDir.appendRelativePath(USER_LAUNCHER_ENTRIES);
920 LauncherEntryFind(userLauncherEntriesDir,
921 this.desktopFile,
922 function(aFile) {
923 if (!aFile) {
924 MessagingMenuEngine.createLauncherEntry(userLauncherEntriesDir);
925 }
926 });
927 }
928 });
929
930 AddonManager.addAddonListener(this);774 AddonManager.addAddonListener(this);
931 this.prefs.addObserver("", this, false);775 this.prefs.addObserver("", this, false);
932 Services.obs.addObserver(this, "xpcom-will-shutdown", false);776 Services.obs.addObserver(this, "xpcom-will-shutdown", false);
@@ -950,22 +794,12 @@
950794
951 LOG("Enabling messaging indicator");795 LOG("Enabling messaging indicator");
952796
953 if (!this.indicateServer) {797 if (!this.mmapp) {
954 Cu.reportError("Could not construct the Messaging Menu server.");798 Cu.reportError("Could not connect to the Messaging Menu.");
955 return;799 return;
956 }800 }
957801
958 indicate.indicate_server_show(this.indicateServer);802 messagingmenu.messaging_menu_app_register(this.mmapp);
959
960 let userBlacklistDir = Services.dirsvc.get("Home", Ci.nsILocalFile);
961 userBlacklistDir.appendRelativePath(USER_BLACKLIST_ENTRIES);
962 LauncherEntryFind(userBlacklistDir, this.desktopFile,
963 function(aFile) {
964 if (aFile) {
965 LOG("Removing launcher entry " + aFile.path);
966 aFile.remove(false);
967 }
968 });
969803
970 let notificationFlags = Ci.nsIFolderListener.added |804 let notificationFlags = Ci.nsIFolderListener.added |
971 Ci.nsIFolderListener.boolPropertyChanged805 Ci.nsIFolderListener.boolPropertyChanged
@@ -976,30 +810,8 @@
976810
977 disableAndHide: function MME_disableAndHide() {811 disableAndHide: function MME_disableAndHide() {
978 LOG("Hiding messaging indicator");812 LOG("Hiding messaging indicator");
979 var userBlacklistDir = Services.dirsvc.get("Home", Ci.nsILocalFile);813
980 userBlacklistDir.appendRelativePath(USER_BLACKLIST_ENTRIES);814 messagingmenu.messaging_menu_app_unregister(this.mmapp);
981 LauncherEntryFind(userBlacklistDir, this.desktopFile,
982 function(aFile) {
983 if (aFile)
984 return;
985
986 if (!userBlacklistDir.exists()) {
987 userBlacklistDir.create(Ci.nsILocalFile.DIRECTORY_TYPE, 0755);
988 }
989
990 let entry = userBlacklistDir.clone();
991 entry.append(Services.appinfo.name.toLowerCase());
992 let ostream = FileUtils.openSafeFileOutputStream(entry,
993 FileUtils.MODE_WRONLY |
994 FileUtils.MODE_CREATE |
995 FileUtils.MODE_TRUNCATE);
996 let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
997 .createInstance(Ci.nsIScriptableUnicodeConverter);
998 converter.charset = "UTF-8";
999 let istream = converter.convertToInputStream(this.desktopFile);
1000 var self = this;
1001 NetUtil.asyncCopy(istream, ostream, null);
1002 });
1003815
1004 this.disable();816 this.disable();
1005 },817 },
@@ -1040,9 +852,6 @@
1040 this.mIndicators = {};852 this.mIndicators = {};
1041 this.visibleIndicators = 0;853 this.visibleIndicators = 0;
1042854
1043 if (this._indicateServer)
1044 indicate.indicate_server_hide(this._indicateServer);
1045
1046 this.badgeCount = 0;855 this.badgeCount = 0;
1047856
1048 this.enabled = false;857 this.enabled = false;
@@ -1058,9 +867,9 @@
1058867
1059 this.disable();868 this.disable();
1060869
1061 if (this._indicateServer)870 if (this._mmapp)
1062 gobject.g_object_unref(this._indicateServer);871 gobject.g_object_unref(this._mmapp);
1063 this._indicateServer = null;872 this._mmapp = null;
1064873
1065 AddonManager.removeAddonListener(this);874 AddonManager.removeAddonListener(this);
1066 Services.obs.removeObserver(this, "xpcom-will-shutdown");875 Services.obs.removeObserver(this, "xpcom-will-shutdown");
1067876
=== removed file 'debian/messagingmenu/modules/dbusmenu.jsm'
--- debian/messagingmenu/modules/dbusmenu.jsm 2012-01-13 09:28:15 +0000
+++ debian/messagingmenu/modules/dbusmenu.jsm 1970-01-01 00:00:00 +0000
@@ -1,68 +0,0 @@
1/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is messagingmenu-extension
16 *
17 * The Initial Developer of the Original Code is
18 * Mozilla Messaging, Ltd.
19 * Portions created by the Initial Developer are Copyright (C) 2010
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Mike Conley <mconley@mozillamessaging.com>
24 * Chris Coulson <chris.coulson@canonical.com>
25 *
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
37 *
38 * ***** END LICENSE BLOCK ***** */
39
40var EXPORTED_SYMBOLS = [ "dbusmenu" ];
41
42const Cu = Components.utils;
43const Cc = Components.classes;
44const Ci = Components.interfaces;
45
46Cu.import("resource://gre/modules/ctypes.jsm");
47Cu.import("resource://messagingmenu/ctypes-utils.jsm");
48Cu.import("resource://messagingmenu/gobject.jsm");
49Cu.import("resource://messagingmenu/glib.jsm");
50
51const DBUSMENU_ABIS = [ 4, 3 ];
52const DBUSMENU_LIBNAME = "dbusmenu-glib";
53
54function dbusmenu_defines(lib) {
55 this.MENUITEM_SIGNAL_ITEM_ACTIVATED = "item-activated";
56
57 this.DbusmenuMenuitem = ctypes.StructType("DbusmenuMenuitem");
58 this.DbusmenuServer = ctypes.StructType("DbusmenuServer");
59
60 lib.lazy_bind("dbusmenu_menuitem_new", this.DbusmenuMenuitem.ptr);
61 lib.lazy_bind("dbusmenu_menuitem_property_set", glib.gboolean, this.DbusmenuMenuitem.ptr, glib.gchar.ptr, glib.gchar.ptr);
62 lib.lazy_bind("dbusmenu_menuitem_property_set_bool", glib.gboolean, this.DbusmenuMenuitem.ptr, glib.gchar.ptr, glib.gboolean);
63 lib.lazy_bind("dbusmenu_menuitem_child_append", glib.gboolean, this.DbusmenuMenuitem.ptr, this.DbusmenuMenuitem.ptr);
64 lib.lazy_bind("dbusmenu_server_new", this.DbusmenuServer.ptr, glib.gchar.ptr);
65 lib.lazy_bind("dbusmenu_server_set_root", ctypes.void_t, this.DbusmenuServer.ptr, this.DbusmenuMenuitem.ptr);
66}
67
68new ctypes_library(DBUSMENU_LIBNAME, DBUSMENU_ABIS, dbusmenu_defines, this);
690
=== removed file 'debian/messagingmenu/modules/indicate.jsm'
--- debian/messagingmenu/modules/indicate.jsm 2012-01-13 09:28:15 +0000
+++ debian/messagingmenu/modules/indicate.jsm 1970-01-01 00:00:00 +0000
@@ -1,80 +0,0 @@
1/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is messagingmenu-extension
16 *
17 * The Initial Developer of the Original Code is
18 * Mozilla Messaging, Ltd.
19 * Portions created by the Initial Developer are Copyright (C) 2010
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Mike Conley <mconley@mozillamessaging.com>
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39var EXPORTED_SYMBOLS = [ "indicate" ];
40
41const Cu = Components.utils;
42const Cc = Components.classes;
43const Ci = Components.interfaces;
44
45Cu.import("resource://gre/modules/ctypes.jsm");
46Cu.import("resource://messagingmenu/ctypes-utils.jsm");
47Cu.import("resource://messagingmenu/gobject.jsm");
48Cu.import("resource://messagingmenu/dbusmenu.jsm");
49Cu.import("resource://messagingmenu/glib.jsm");
50
51const IMPORTS = ["resource://messagingmenu/glib.jsm"];
52const INDICATE_LIBNAME = "indicate";
53const INDICATE_ABIS = [ 5 ];
54
55function indicate_defines(lib) {
56 this.INDICATOR_MESSAGES_SERVER_TYPE = "message";
57 this.INDICATOR_MESSAGES_PROP_NAME = "name";
58 this.INDICATOR_MESSAGES_PROP_ICON = "icon";
59 this.INDICATOR_MESSAGES_PROP_COUNT = "count";
60 this.INDICATOR_MESSAGES_PROP_TIME = "time";
61 this.INDICATOR_MESSAGES_PROP_ATTENTION = "draw-attention";
62
63 this.IndicateServer = ctypes.StructType("IndicateServer");
64 this.Indicator = ctypes.StructType("Indicator");
65
66 lib.lazy_bind("indicate_server_ref_default", this.IndicateServer.ptr);
67 lib.lazy_bind("indicate_server_set_type", ctypes.void_t, this.IndicateServer.ptr, glib.gchar.ptr);
68 lib.lazy_bind("indicate_server_set_desktop_file", ctypes.void_t, this.IndicateServer.ptr, glib.gchar.ptr);
69 lib.lazy_bind("indicate_server_show", ctypes.void_t, this.IndicateServer.ptr);
70 lib.lazy_bind("indicate_server_hide", ctypes.void_t, this.IndicateServer.ptr);
71 lib.lazy_bind("indicate_server_set_menu", ctypes.void_t, this.IndicateServer.ptr, dbusmenu.DbusmenuServer.ptr);
72 lib.lazy_bind("indicate_indicator_new", this.Indicator.ptr);
73 lib.lazy_bind("indicate_indicator_set_property", ctypes.void_t, this.Indicator.ptr, glib.gchar.ptr, glib.gchar.ptr);
74 lib.lazy_bind("indicate_indicator_get_property", glib.gchar.ptr, this.Indicator.ptr, glib.gchar.ptr);
75 lib.lazy_bind("indicate_indicator_show", ctypes.void_t, this.Indicator.ptr);
76 lib.lazy_bind("indicate_indicator_hide", ctypes.void_t, this.Indicator.ptr);
77 lib.lazy_bind("indicate_indicator_is_visible", glib.gboolean, this.Indicator.ptr);
78}
79
80new ctypes_library(INDICATE_LIBNAME, INDICATE_ABIS, indicate_defines, this);
810
=== added file 'debian/messagingmenu/modules/messagingmenu.jsm'
--- debian/messagingmenu/modules/messagingmenu.jsm 1970-01-01 00:00:00 +0000
+++ debian/messagingmenu/modules/messagingmenu.jsm 2012-08-23 20:00:25 +0000
@@ -0,0 +1,74 @@
1/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is messagingmenu-extension
16 *
17 * The Initial Developer of the Original Code is
18 * Mozilla Messaging, Ltd.
19 * Portions created by the Initial Developer are Copyright (C) 2010
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Mike Conley <mconley@mozillamessaging.com>
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39var EXPORTED_SYMBOLS = [ "messagingmenu" ];
40
41const Cu = Components.utils;
42const Cc = Components.classes;
43const Ci = Components.interfaces;
44
45Cu.import("resource://gre/modules/ctypes.jsm");
46Cu.import("resource://messagingmenu/ctypes-utils.jsm");
47Cu.import("resource://messagingmenu/gobject.jsm");
48Cu.import("resource://messagingmenu/glib.jsm");
49
50const IMPORTS = ["resource://messagingmenu/glib.jsm"];
51const MESSAGING_MENU_LIBNAME = "messaging-menu";
52const MESSAGING_MENU_ABIS = [ 0 ];
53
54function messaging_menu_defines(lib) {
55 this.MessagingMenuApp = ctypes.StructType("MessagingMenuApp");
56
57 lib.lazy_bind("messaging_menu_app_new", this.MessagingMenuApp.ptr, glib.gchar.ptr);
58 lib.lazy_bind("messaging_menu_app_register", ctypes.void_t, this.MessagingMenuApp.ptr);
59 lib.lazy_bind("messaging_menu_app_unregister", ctypes.void_t, this.MessagingMenuApp.ptr);
60
61 lib.lazy_bind("messaging_menu_app_append_source",
62 ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.gpointer, glib.gchar.ptr);
63 lib.lazy_bind("messaging_menu_app_append_source_with_count",
64 ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.gpointer, glib.gchar.ptr, glib.guint);
65
66 lib.lazy_bind("messaging_menu_app_remove_source", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr);
67 lib.lazy_bind("messaging_menu_app_has_source", glib.gboolean, this.MessagingMenuApp.ptr, glib.gchar.ptr);
68 lib.lazy_bind("messaging_menu_app_set_source_count", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr, glib.guint);
69 lib.lazy_bind("messaging_menu_app_draw_attention", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr);
70 lib.lazy_bind("messaging_menu_app_remove_attention", ctypes.void_t, this.MessagingMenuApp.ptr, glib.gchar.ptr);
71}
72
73new ctypes_library(MESSAGING_MENU_LIBNAME, MESSAGING_MENU_ABIS, messaging_menu_defines, this);
74
075
=== modified file 'debian/thunderbird.desktop.in'
--- debian/thunderbird.desktop.in 2012-06-13 00:34:08 +0000
+++ debian/thunderbird.desktop.in 2012-08-23 20:00:25 +0000
@@ -176,7 +176,7 @@
176%%ifdef MOZ_ENABLE_UNITY_INTEGRATION176%%ifdef MOZ_ENABLE_UNITY_INTEGRATION
177%%if DISTRIB_VERSION >= 1204177%%if DISTRIB_VERSION >= 1204
178Actions=Compose;Contacts178Actions=Compose;Contacts
179%%define TARGET_ENV OnlyShowIn=Unity;179%%define TARGET_ENV OnlyShowIn=Messaging Menu;Unity;
180%%define COMPOSE_SECTION [Desktop Action Compose]180%%define COMPOSE_SECTION [Desktop Action Compose]
181%%define CONTACTS_SECTION [Desktop Action Contacts]181%%define CONTACTS_SECTION [Desktop Action Contacts]
182%%else182%%else

Subscribers

People subscribed via source and target branches