[Pkg-mozext-commits] [firetray] 218/399: experimental command-line handling
David Prévot
taffit at alioth.debian.org
Tue Oct 29 18:23:46 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch dfsg-clean
in repository firetray.
commit 13f9b31ed933785ea54ef497e25f5f394483827c
Author: foudfou <foudil.newbie+git at gmail.com>
Date: Fri Mar 30 14:39:16 2012 +0200
experimental command-line handling
will be useful to have a command for toggling windows that can be linked to the
wm keyboard shortcut mapping.
TODO: find out why helpInfo not working
---
src/chrome.manifest | 4 ++++
src/components/firetray-clhandler.js | 40 ++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/src/chrome.manifest b/src/chrome.manifest
index b1d609a..3b29a66 100644
--- a/src/chrome.manifest
+++ b/src/chrome.manifest
@@ -9,3 +9,7 @@ overlay chrome://songbird/content/xul/mainScriptsOverlay.xul chrome://firetray/c
overlay chrome://sunbird/content/calendar.xul chrome://firetray/content/overlay.xul
overlay chrome://navigator/content/navigator.xul chrome://firetray/content/overlay.xul
overlay chrome://chatzilla/content/chatzilla.xul chrome://firetray/content/overlay.xul
+
+component {a9c9cc52-4d6c-45c2-a73f-0be1bd60aaa6} components/firetray-clhandler.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=firetray {a9c9cc52-4d6c-45c2-a73f-0be1bd60aaa6}
+category command-line-handler m-firetray @mozilla.org/commandlinehandler/general-startup;1?type=firetray
diff --git a/src/components/firetray-clhandler.js b/src/components/firetray-clhandler.js
new file mode 100644
index 0000000..13dd41f
--- /dev/null
+++ b/src/components/firetray-clhandler.js
@@ -0,0 +1,40 @@
+// https://developer.mozilla.org/en/Chrome/Command_Line
+
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://firetray/logging.jsm");
+
+function firetayCommandLineHandler() {}
+firetayCommandLineHandler.prototype = {
+ classDescription: "firetayCommandLineHandler",
+ classID: Components.ID('{a9c9cc52-4d6c-45c2-a73f-0be1bd60aaa6}'),
+ contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=firetray",
+ _xpcom_categories: [{
+ category: "command-line-handler",
+ entry: "m-firetray"
+ }],
+
+ QueryInterface: XPCOMUtils.generateQI([
+ Ci.nsICommandLineHandler
+ ]),
+
+ /* nsICommandLineHandler */
+ handle: function clh_handle(cmdLine)
+ {
+ if (cmdLine.handleFlag("firetray", false)) {
+ firetray.WARN("*** CALL ***");
+ cmdLine.preventDefault = true;
+ }
+ },
+
+ // NOTE: change the help info as appropriate, but follow the guidelines in
+ // nsICommandLineHandler.idl specifically, flag descriptions should start at
+ // character 24, and lines should be wrapped at 72 characters with embedded
+ // newlines, and finally, the string should end with a newline
+ helpInfo: " -firetray FOUDIL WAS HERE\n"
+};
+
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([firetayCommandLineHandler]);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git
More information about the Pkg-mozext-commits
mailing list