Index: umc/js/services.js =================================================================== --- umc/js/services.js (Revision 44049) +++ umc/js/services.js (Arbeitskopie) @@ -70,9 +70,10 @@ callback: lang.hitch(this, function(data) { if (data.length) { var command = 'services/start'; + var action = _('Start services'); var confirmMessage = _('Please confirm to start the following services: '); var errorMessage = _('Starting the following services failed: '); - this._changeState(data, command, confirmMessage, errorMessage); + this._changeState(data, command, action, confirmMessage, errorMessage); } }), isStandardAction: false, @@ -83,9 +84,10 @@ callback: lang.hitch(this, function(data) { if (data.length) { var command = 'services/stop'; + var action = _('Stop services'); var confirmMessage = _('Please confirm to stop the following services: '); var errorMessage = _('Stopping the following services failed: '); - this._changeState(data, command, confirmMessage, errorMessage); + this._changeState(data, command, action, confirmMessage, errorMessage); } }), isStandardAction: false, @@ -96,9 +98,10 @@ callback: lang.hitch(this, function(data) { if (data.length) { var command = 'services/restart'; + var action = _('Restart services'); var confirmMessage = _('Please confirm to restart the following services: '); var errorMessage = _('Restarting the following services failed: '); - this._changeState(data, command, confirmMessage, errorMessage); + this._changeState(data, command, action, confirmMessage, errorMessage); } }), isStandardAction: false, @@ -108,9 +111,10 @@ label: _('Start automatically'), callback: lang.hitch(this, function(data) { var command = 'services/start_auto'; + var action = _('Start automatically'); var confirmMessage = _('Please confirm to automatically start the following services: '); var errorMessage = _('Could not change start type of the following services: '); - this._changeState(data, command, confirmMessage, errorMessage); + this._changeState(data, command, action, confirmMessage, errorMessage); }), isStandardAction: false, isMultiAction: true @@ -119,9 +123,10 @@ label: _('Start manually'), callback: lang.hitch(this, function(data) { var command = 'services/start_manual'; + var action = _('Start manually'); var confirmMessage = _('Please confirm to manually start the following services: '); var errorMessage = _('Could not change start type of the following services: '); - this._changeState(data, command, confirmMessage, errorMessage); + this._changeState(data, command, action, confirmMessage, errorMessage); }), isStandardAction: false, isMultiAction: true @@ -130,9 +135,10 @@ label: _('Start never'), callback: lang.hitch(this, function(data) { var command = 'services/start_never'; + var action = _('Start never'); var confirmMessage = _('Please confirm to never start the following services: '); var errorMessage = _('Could not change start type of the following services: '); - this._changeState(data, command, confirmMessage, errorMessage); + this._changeState(data, command, action, confirmMessage, errorMessage); }), isStandardAction: false, isMultiAction: true @@ -207,9 +213,9 @@ titlePane.addChild(this._searchWidget); this._page.startup(); - }, + }, - _changeState: function(data, command, confirmMessage, errorMessage) { + _changeState: function(data, command, action, confirmMessage, errorMessage) { confirmMessage += ''; dialog.confirm(confirmMessage, [{ - label: _('OK'), + label: _('Cancel'), + 'default': true + }, { + label: action, callback: lang.hitch(this, function() { - this.standby(true); - tools.umcpCommand(command, data).then( - lang.hitch(this, function(response) { - this.standby(false); - if (response.result.success === false) { - errorMessage += ''; - dialog.alert(errorMessage); - } - data = this._searchWidget.get('value'); - this._grid.filter(data); - }), lang.hitch(this, function() { - this.standby(false); - }) - ); + var operation = tools.umcpCommand(command, data).then(lang.hitch(this, function(response) { + if (response.result.success === false) { + errorMessage += ''; + dialog.alert(errorMessage); + } + data = this._searchWidget.gatherFormValues(); + this._grid.filter(data); + })); + this.standbyDuring(operation); }) - }, { - 'default': true, - label: _('Cancel') }]); } });