X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fsource%2Fclass%2Forg%2Fargeo%2Fria%2Fevent%2FCommandsManager.js;h=0f6f1182a9817b3df28e04edc9b632222be533f6;hb=d71a4b12cc6f78a3fceeb620f539150e5835b511;hp=7bd0957dd7d430605674f4ad9c1cc7456b497f87;hpb=4ab05384ea181aff4e789094c332a658554c5abe;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/CommandsManager.js b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/CommandsManager.js index 7bd0957dd..0f6f1182a 100644 --- a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/CommandsManager.js +++ b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/CommandsManager.js @@ -35,6 +35,7 @@ qx.Class.define("org.argeo.ria.event.CommandsManager", callback : function(e){}, command : null }, + /* "quit" : { label : "Quit", icon : "resource/slc/system-shutdown.png", @@ -45,6 +46,7 @@ qx.Class.define("org.argeo.ria.event.CommandsManager", callback : function(e){}, command : null }, + */ "log" : { label : "Show Console", icon : "resource/slc/help-contents.png", @@ -109,15 +111,21 @@ qx.Class.define("org.argeo.ria.event.CommandsManager", if(!definition.command){ command = new org.argeo.ria.event.Command(key, definition.label, definition.icon, definition.shortcut); if(definition.submenu){ - var menu = new qx.ui.menu.Menu(); - command.setMenu(menu); + command.setMenu(definition.submenu); if(definition.submenuCallback){ command.setMenuCallback(definition.submenuCallback); command.setMenuContext((definition.callbackContext?definition.callbackContext:null)); } } command.setEnabled(definition.enabled); + if(definition.toggle){ + command.setToggle(true); + } command.addListener("execute", definition.callback, (definition.callbackContext?definition.callbackContext:this)); + if(definition.init){ + var binded = qx.lang.Function.bind(definition.init, command); + binded(); + } definition.command = command; }else{ command = definition.command; @@ -303,6 +311,7 @@ qx.Class.define("org.argeo.ria.event.CommandsManager", menu.add(icon); menu.add(text); menu.add(both); + mgr.setSelected(both); toolbar.setContextMenu(menu); mgr.addListener("changeValue", function(e){ this.setShow(e.getData());