aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-03-26 09:56:25 +0100
committerAngelo Naselli <anaselli@linux.it>2015-03-26 09:56:25 +0100
commit60e6aab6daad6f62417eebcd905499080246edce (patch)
tree21cab4bf99ffcf35ae5a7dc17f9570afb1bb04cf /lib/ManaTools
parent039adb66977dc7b3b9beace1680c602bf7ad67bb (diff)
downloadcolin-keep-60e6aab6daad6f62417eebcd905499080246edce.tar
colin-keep-60e6aab6daad6f62417eebcd905499080246edce.tar.gz
colin-keep-60e6aab6daad6f62417eebcd905499080246edce.tar.bz2
colin-keep-60e6aab6daad6f62417eebcd905499080246edce.tar.xz
colin-keep-60e6aab6daad6f62417eebcd905499080246edce.zip
Managed the case in which no NTP is installed, as a warning by now
Diffstat (limited to 'lib/ManaTools')
-rw-r--r--lib/ManaTools/Module/Clock.pm21
-rw-r--r--lib/ManaTools/Shared/TimeZone.pm2
2 files changed, 16 insertions, 7 deletions
diff --git a/lib/ManaTools/Module/Clock.pm b/lib/ManaTools/Module/Clock.pm
index 548a397..e727298 100644
--- a/lib/ManaTools/Module/Clock.pm
+++ b/lib/ManaTools/Module/Clock.pm
@@ -273,10 +273,10 @@ sub _adminClockPanel {
my $itemColl = new yui::YItemCollection;
my $sel_serv = $self->sh_tz->currentNTPService();
foreach my $serv (@{$self->sh_tz->ntpServiceList()}) {
- my $item = new yui::YItem ($serv, 0);
- $item->setSelected(1) if ($sel_serv && $sel_serv eq $serv);
- $itemColl->push($item);
- $item->DISOWN();
+ my $item = new yui::YItem ($serv, 0);
+ $item->setSelected(1) if ($sel_serv && $sel_serv eq $serv);
+ $itemColl->push($item);
+ $item->DISOWN();
}
$ntpService->addItems($itemColl);
$ntpService->setNotify(1);
@@ -361,7 +361,18 @@ sub _adminClockPanel {
last;
}
elsif ($widget == $ntpFrame) {
- $dateTimeFrame->setEnabled(!$ntpFrame->value());
+ if (scalar @{$self->sh_tz->ntpServiceList()} == 0) {
+ $self->sh_gui->warningMsgBox({
+ title => $self->loc->N("manaclock: NTP service missed"),
+ text => $self->loc->N("Please install a NTP service such as chrony or ntp to manage"),
+ richtext => 1,
+ });
+ $ntpFrame->setValue(0);
+ $dateTimeFrame->setEnabled(1);
+ }
+ else {
+ $dateTimeFrame->setEnabled(!$ntpFrame->value());
+ }
}
elsif ($widget == $ntpService) {
my $selection = $ntpService->selectedItem();
diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm
index 9aa7ef2..685a87b 100644
--- a/lib/ManaTools/Shared/TimeZone.pm
+++ b/lib/ManaTools/Shared/TimeZone.pm
@@ -152,8 +152,6 @@ has 'ntp_program' => (
sub _ntp_program_init {
my $self = shift;
- $DB::single = 1;
-
# looks for a running service from the configured ones,
# if none is running chooses the first of the list
my $list = $self->ntpServiceList();