From 622413fa7640e09c9346a9c70c84c6b81ed87895 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Thu, 26 Jun 2014 11:36:16 +0200 Subject: fixed NTP frame initialization --- lib/AdminPanel/Module/Clock.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/AdminPanel/Module') diff --git a/lib/AdminPanel/Module/Clock.pm b/lib/AdminPanel/Module/Clock.pm index 145447dd..0361c089 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"); -- cgit v1.2.1