From cdfeb58a3eba4f25d0ec1890d07345ef8e8cfd3a Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Wed, 25 Jun 2014 17:57:02 +0200 Subject: loaded list of ntp servers from TimeZone --- lib/AdminPanel/Module/Clock.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/AdminPanel') diff --git a/lib/AdminPanel/Module/Clock.pm b/lib/AdminPanel/Module/Clock.pm index de733575..673aacc7 100644 --- a/lib/AdminPanel/Module/Clock.pm +++ b/lib/AdminPanel/Module/Clock.pm @@ -168,8 +168,14 @@ sub start { }; +## returns ntp servers in the format +## Zone|Nation: server +sub _get_NTPservers { + my $self = shift; - + my $servs = $self->sh_tz->ntpServers(); + [ map { "$servs->{$_}: $_" } sort { $servs->{$a} cmp $servs->{$b} || $a cmp $b } keys %$servs ]; +} sub _adminClockPanel { my $self = shift; @@ -223,9 +229,9 @@ sub _adminClockPanel { my $hbox1 = $factory->createHBox($vbox); $factory->createLabel($hbox1,$self->loc->N("Server:")); my $ntpServers = $factory->createComboBox( $hbox1, "" ); - -# - + my $servers = $self->_get_NTPservers(); + my $itemCollection = $self->sh_gui->arrayListToYItemCollection({item_list => $servers,}); + $ntpServers->addItems($itemCollection); -- cgit v1.2.1