aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Module/Clock.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-06-26 11:36:16 +0200
committerAngelo Naselli <anaselli@linux.it>2014-06-26 11:36:16 +0200
commit622413fa7640e09c9346a9c70c84c6b81ed87895 (patch)
treef989dbadcbfadc361202ba33e42fea865fa03f42 /lib/AdminPanel/Module/Clock.pm
parent1437630bbfa67877cb359cc292df05c27d9fbec0 (diff)
downloadcolin-keep-622413fa7640e09c9346a9c70c84c6b81ed87895.tar
colin-keep-622413fa7640e09c9346a9c70c84c6b81ed87895.tar.gz
colin-keep-622413fa7640e09c9346a9c70c84c6b81ed87895.tar.bz2
colin-keep-622413fa7640e09c9346a9c70c84c6b81ed87895.tar.xz
colin-keep-622413fa7640e09c9346a9c70c84c6b81ed87895.zip
fixed NTP frame initialization
Diffstat (limited to 'lib/AdminPanel/Module/Clock.pm')
-rw-r--r--lib/AdminPanel/Module/Clock.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/AdminPanel/Module/Clock.pm b/lib/AdminPanel/Module/Clock.pm
index 145447d..0361c08 100644
--- a/lib/AdminPanel/Module/Clock.pm
+++ b/lib/AdminPanel/Module/Clock.pm
@@ -179,10 +179,11 @@ sub _get_NTPservers {
### _restoreValues
## restore NTP server and Time Zone from configuration files
## returns 'info', a HASH references containing:
-## time_zone => time zone hash reference to be restored
-## ntp_server => ntp server address
-## date => date string
-## time => time string
+## time_zone => time zone hash reference to be restored
+## ntp_server => ntp server address
+## date => date string
+## time => time string
+## ntp_running => is NTP running?
#
sub _restoreValues {
my ($self) = @_;
@@ -192,6 +193,7 @@ sub _restoreValues {
$info->{ntp_server} = $self->sh_tz->ntpCurrentServer();
#- strip digits from \d+.foo.pool.ntp.org
$info->{ntp_server} =~ s/^\d+\.// if $info->{ntp_server};
+ $info->{ntp_running} = $self->sh_tz->isNTPRunning();
my $t = localtime;
my $day = $t->strftime("%F");
my $time = $t->strftime("%H:%M:%S");
@@ -278,6 +280,8 @@ sub _adminClockPanel {
if ($info->{ntp_server}) {
$ntpLabel->setValue($info->{ntp_server});
}
+ $ntpFrame->setValue($info->{ntp_running});
+
# get only once
my $NTPservers = $self->_get_NTPservers();
@@ -366,6 +370,7 @@ sub _adminClockPanel {
else {
$ntpLabel->setValue($self->loc->N("not defined"));
}
+ $ntpFrame->setValue($info->{ntp_running});
}
elsif($widget == $aboutButton) {
my $translators = $self->loc->N("_: Translator(s) name(s) & email(s)\n");