From 85e46b421217457288e70bc3a3f252fef5302a25 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 4 Jan 2026 20:11:09 +0000 Subject: drakclock: ensure the NTP server combo box always displays a valid pool After installing chrony, we need to update the selection to match the initial setting in the chrony.conf file. If no ntp service is installed, display the default "pool.ntp.org". --- perl-install/standalone/drakclock | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock index 15ef0bafa..34a0e9fec 100755 --- a/perl-install/standalone/drakclock +++ b/perl-install/standalone/drakclock @@ -77,6 +77,7 @@ $my_win->{window}->add( $hb_ntp->set_sensitive($mode); if ($mode == 1 && !$in->do_pkgs->is_installed('ntpsec') && !$in->do_pkgs->is_installed('chrony')) { install_ntp(); + show_current_pool(); } }), 0, $hb_ntp = gtknew('HBox', border_width => 5, children => [ @@ -177,9 +178,15 @@ $time_box->set_direction('ltr'); my $servers = get_servers(); $combo_ntp_pool->set_popdown_strings(@$servers); +show_current_pool(); if (-e timezone::ntp_conf() && is_ntp_daemon_running()) { - $ntp = timezone::ntp_pool(); - $ntp and ntp_widget_state(1); + ntp_widget_state(1); +} else { + ntp_widget_state(0); +} + +sub show_current_pool() { + $ntp = timezone::ntp_pool() || 'pool.ntp.org'; my $fullntp = $ntp; my $short_ntp = $ntp; #- strip digits from \d+.foo.pool.ntp.org @@ -188,8 +195,8 @@ if (-e timezone::ntp_conf() && is_ntp_daemon_running()) { /^[^:]+: \Q$short_ntp\E$/ and $fullntp = $_, last; } $combo_ntp_pool->entry->set_text($fullntp); -} else { ntp_widget_state(0) } - +} + my $pressed; $drawing_area->set_events(${ Gtk3::Gdk::EventMask->new([ 'button_press_mask', 'button_release_mask', "pointer_motion_mask" ]) }); $drawing_area->signal_connect(draw => \&draw); -- cgit v1.2.1