diff options
| author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2026-01-04 20:11:09 +0000 |
|---|---|---|
| committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2026-01-04 21:34:44 +0000 |
| commit | 85e46b421217457288e70bc3a3f252fef5302a25 (patch) | |
| tree | ebfeefea32167f66648596ab19e3d0bf0e6cfdc5 /perl-install | |
| parent | 94fe5964a4c89834c010ef6822129d1084e2ac06 (diff) | |
| download | drakx-85e46b421217457288e70bc3a3f252fef5302a25.tar drakx-85e46b421217457288e70bc3a3f252fef5302a25.tar.gz drakx-85e46b421217457288e70bc3a3f252fef5302a25.tar.bz2 drakx-85e46b421217457288e70bc3a3f252fef5302a25.tar.xz drakx-85e46b421217457288e70bc3a3f252fef5302a25.zip | |
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".
Diffstat (limited to 'perl-install')
| -rw-r--r-- | perl-install/NEWS | 1 | ||||
| -rwxr-xr-x | perl-install/standalone/drakclock | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 5d63ecdf8..85bb4ad4c 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,6 +1,7 @@ - drakclock: o fix config file read/write for chrony and ntpsec (mga#34664) * use "pool" directive instead of "service" + o ensure the NTP server combo box always displays a valid pool - improve Congratulations message in last installer screen (mga#28209) - make IceWM the last choice when automatically choosing the session for autologin - fix inconsistent use of any::sessions() 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); |
