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
This commit is contained in:
foudfou 2012-03-30 14:39:16 +02:00
parent 746ab759f7
commit 13f9b31ed9
2 changed files with 44 additions and 0 deletions

View File

@ -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

View File

@ -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]);