aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo.pasotti@gmail.com>2015-01-13 19:24:35 +0100
committerMatteo Pasotti <matteo.pasotti@gmail.com>2015-01-13 19:24:35 +0100
commit8f55653586307c693d731c2e6fb27bcf6a8c0ac6 (patch)
tree13c24ccce4a4b5403ea769c84a4f51155ab5bc13
parent890e59c019e72359f8ff66f0e453daf878082fe7 (diff)
parente3ff92a394b3182f0e654a6a80a05c0102bb76e9 (diff)
downloadmanatools-8f55653586307c693d731c2e6fb27bcf6a8c0ac6.tar
manatools-8f55653586307c693d731c2e6fb27bcf6a8c0ac6.tar.gz
manatools-8f55653586307c693d731c2e6fb27bcf6a8c0ac6.tar.bz2
manatools-8f55653586307c693d731c2e6fb27bcf6a8c0ac6.tar.xz
manatools-8f55653586307c693d731c2e6fb27bcf6a8c0ac6.zip
Merge branch 'master' of ssh://git.mageia.org/software/adminpanel
-rw-r--r--lib/AdminPanel/Module/Services.pm56
1 files changed, 42 insertions, 14 deletions
diff --git a/lib/AdminPanel/Module/Services.pm b/lib/AdminPanel/Module/Services.pm
index 4d099c57..9a353974 100644
--- a/lib/AdminPanel/Module/Services.pm
+++ b/lib/AdminPanel/Module/Services.pm
@@ -504,37 +504,65 @@ sub _servicePanel {
$item = $serviceTbl->changedItem();
if ($item) {
yui::YUI::app()->busyCursor();
- $self->sh_services->set_service($item->label(), $item->checked());
- # we can push/pop service, but this (slower) should return real situation
+ eval {
+ $self->sh_services->set_service($item->label(), $item->checked());
+ };
+ my $errors = $@;
$self->loadServices();
yui::YUI::app()->normalCursor();
+
+ if ($errors) {
+ $self->sh_gui->warningMsgBox({
+ title => $self->loc->N($item->checked() ? "Enabling %s" : "Disabling %s", $item->label()),
+ text => "$errors",
+ richtext => 1,
+ });
+ $dialog->startMultipleChanges();
+ $self->_fillServiceTable($serviceTbl);
+ $dialog->recalcLayout();
+ $dialog->doneMultipleChanges();
+ }
}
}
}
elsif ($widget == $startButton) {
$item = $serviceTbl->selectedItem();
if ($item) {
- yui::YUI::app()->busyCursor();
my $serviceName = $item->label();
- $self->sh_services->restart_or_start($serviceName);
- # we can push/pop service, but this (slower) should return real situation
- $self->_waitUnitStatus($serviceName, 1);
-# $self->loadServices();
- $self->_serviceStatus($serviceTbl, $item);
+ yui::YUI::app()->busyCursor();
+ eval {
+ $self->sh_services->restart_or_start($serviceName);
+ $self->_waitUnitStatus($serviceName, 1);
+ };
+ my $errors = $@;
yui::YUI::app()->normalCursor();
+ $self->_serviceStatus($serviceTbl, $item);
+
+ $self->sh_gui->warningMsgBox({
+ title => $self->loc->N("Starting %s", $serviceName),
+ text => "$errors",
+ richtext => 1,
+ }) if $errors;
}
}
elsif ($widget == $stopButton) {
$item = $serviceTbl->selectedItem();
if ($item) {
- yui::YUI::app()->busyCursor();
my $serviceName = $item->label();
- $self->sh_services->stopService($serviceName);
- # we can push/pop service, but this (slower) should return real situation
- $self->_waitUnitStatus($serviceName, 0);
-# $self->loadServices();
- $self->_serviceStatus($serviceTbl, $item);
+ yui::YUI::app()->busyCursor();
+ eval {
+ $self->sh_services->stopService($serviceName);
+ $self->_waitUnitStatus($serviceName, 0);
+ };
+ my $errors = $@;
yui::YUI::app()->normalCursor();
+ $self->_serviceStatus($serviceTbl, $item);
+
+ $self->sh_gui->warningMsgBox({
+ title => $self->loc->N("Stopping %s", $serviceName),
+ text => "$errors",
+ richtext => 1,
+ }) if $errors;
}
}
elsif ($widget == $refreshButton) {