X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ria%2Fsrc%2Fargeo-ria-lib%2Fsecurity%2Fclass%2Forg%2Fargeo%2Fsecurity%2Fria%2FUsersApplet.js;h=f4765628f9f7e6c573d92363713bf887443a7074;hb=f0037ce21f65a9ae5fb87cb706398a83f5b42880;hp=4522746ac10cdcefc24c781304820623193a86db;hpb=81579a12a1b3fa8a21e1ad7944e5dccaa8beeadf;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js index 4522746ac..f4765628f 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js @@ -3,7 +3,7 @@ * The only associated command is the "Close" command. */ /* ************************************************* -#asset(resource/org.argeo.ria.sample/window-close.png) +#asset(resource/org.argeo.security.ria/*) ****************************************************/ qx.Class.define("org.argeo.security.ria.UsersApplet", { @@ -29,12 +29,12 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", commands : { init : { "new_user" : { - label : "Create User", - icon : "ria/window-close.png", + label : "New User", + icon : "org.argeo.security.ria/list-add.png", shortcut : "Control+n", enabled : true, menu : "Users", - toolbar : "user", + toolbar : "userslist", callback : function(e){ // Call service to delete var classObj = org.argeo.security.ria.UserEditorApplet; @@ -42,47 +42,47 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", iView.load(); }, command : null - }, - "edit_user" : { - label : "Edit User", - icon : "ria/window-close.png", - shortcut : "Control+u", + }, + "delete_user" : { + label : "Delete User", + icon : "org.argeo.security.ria/list-remove.png", + shortcut : "Control+s", enabled : true, menu : "Users", - toolbar : "user", + toolbar : "userslist", callback : function(e){ // Call service to delete - var crtUser = this.getViewSelection().getNodes()[0]; - var classObj = org.argeo.security.ria.UserEditorApplet; - var iView = org.argeo.ria.components.ViewsManager.getInstance().initIViewClass(classObj, "editor", crtUser); - iView.load(crtUser); + var crtUsers = this.getViewSelection().getNodes(); + for(var i=0;i 1)); + this.setEnabled(!(data == null || !data.length)); }, command : null - }, - "delete_user" : { - label : "Delete User", - icon : "ria/window-close.png", - shortcut : "Control+s", + }, + "edit_user" : { + label : "Edit User", + icon : "org.argeo.security.ria/document-properties.png", + shortcut : "Control+u", enabled : true, menu : "Users", - toolbar : "user", + toolbar : "userslist", callback : function(e){ // Call service to delete - var crtUsers = this.getViewSelection().getNodes(); - for(var i=0;i 1)); }, command : null - } + } } }, @@ -123,6 +123,9 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", this.table.getSelectionModel().addListener("changeSelection", function(){ this._selectionToValues(this.table.getSelectionModel(), this.getViewSelection()); }, this); + this.table.addListener("cellDblclick", function(cellEvent){ + this.getCommands()["edit_user"].command.execute(); + }, this); this.setGuiMode("chooser"); },