diff --git a/package/yast2-ntp-client.changes b/package/yast2-ntp-client.changes index d4fc0e0e..4af6226f 100644 --- a/package/yast2-ntp-client.changes +++ b/package/yast2-ntp-client.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri May 6 16:09:50 UTC 2016 - lslezak@suse.cz + +- Fixed the default synchronization interval in the help text + (bsc#978453) +- Unify the default value in the code (the proposal client used + a different default) +- Set the initial state of the interval widget according to + the current synchronization mode +- Fixed firewall widget layout (double frame widget) +- 3.1.23 + ------------------------------------------------------------------- Thu Apr 14 09:16:37 CEST 2016 - kanderssen@suse.com diff --git a/package/yast2-ntp-client.spec b/package/yast2-ntp-client.spec index aa75d03c..5a5730bd 100644 --- a/package/yast2-ntp-client.spec +++ b/package/yast2-ntp-client.spec @@ -17,7 +17,7 @@ Name: yast2-ntp-client -Version: 3.1.22 +Version: 3.1.23 Release: 0 Summary: YaST2 - NTP Client Configuration License: GPL-2.0+ diff --git a/src/clients/ntp-client_proposal.rb b/src/clients/ntp-client_proposal.rb index fa316982..04f88b25 100644 --- a/src/clients/ntp-client_proposal.rb +++ b/src/clients/ntp-client_proposal.rb @@ -57,9 +57,7 @@ def main - if false - return - elsif @func == "GetNTPEnabled" + if @func == "GetNTPEnabled" @ret = GetNTPEnabled() elsif @func == "SetUseNTP" NtpClient.ntp_selected = Ops.get_boolean(@param, "ntp_used", false) @@ -326,7 +324,7 @@ def WriteNtpSettings(ntp_servers, ntp_server, run_service) NtpClient.run_service = run_service if !run_service NtpClient.synchronize_time = true - NtpClient.sync_interval = 15 + NtpClient.sync_interval = NtpClientClass::DEFAULT_SYNC_INTERVAL end #OK, so we stored the server address diff --git a/src/include/ntp-client/dialogs.rb b/src/include/ntp-client/dialogs.rb index 77f9ae4c..eb983d49 100644 --- a/src/include/ntp-client/dialogs.rb +++ b/src/include/ntp-client/dialogs.rb @@ -172,11 +172,7 @@ def MainDialog VSpacing(), Left("secure"), VSpacing(), - Frame( - # TRANSLATORS: UI frame label - _("Firewall Settings"), - "firewall" - ) + "firewall" ) ), VStretch() diff --git a/src/include/ntp-client/helps.rb b/src/include/ntp-client/helps.rb index 386841bc..6ffc3bce 100644 --- a/src/include/ntp-client/helps.rb +++ b/src/include/ntp-client/helps.rb @@ -8,6 +8,7 @@ # $Id$ module Yast module NtpClientHelpsInclude + Yast.import "NtpClient" def initialize_ntp_client_helps(include_target) textdomain "ntp-client" @@ -31,16 +32,14 @@ def initialize_ntp_client_helps(include_target) "Abort the save procedure by pressing Abort.\n" + "An additional dialog will inform you whether it is safe to do so.
" ), - # help text 1/5 + # help text 1/5, %d is a number of minutes "start" => _( "Start NTP Daemon
\n" +
"Select whether to start the NTP daemon now and on every system boot. \n" +
- "The NTP daemon resolves host names when initializing. Your\n" +
- "network connection must be started before the NTP daemon starts.
Chroot Jail
\n" +
diff --git a/src/include/ntp-client/widgets.rb b/src/include/ntp-client/widgets.rb
index 05e7bdac..78bff7f2 100644
--- a/src/include/ntp-client/widgets.rb
+++ b/src/include/ntp-client/widgets.rb
@@ -111,6 +111,9 @@ def timeSyncOrNo(id, event)
def intervalInit(id)
UI.ChangeWidget(Id("interval"), :Value, NtpClient.sync_interval)
+ enabled = UI.QueryWidget(Id("start"), :CurrentButton) == "sync"
+ UI.ChangeWidget(Id("interval"), :Enabled, enabled)
+
nil
end
diff --git a/src/modules/NtpClient.rb b/src/modules/NtpClient.rb
index fb2ca6f6..df8459b5 100644
--- a/src/modules/NtpClient.rb
+++ b/src/modules/NtpClient.rb
@@ -14,6 +14,12 @@
module Yast
class NtpClientClass < Module
+
+ # the default synchronization interval in minutes when running in the manual
+ # sync mode ("Synchronize without Daemon" option, ntp started from cron)
+ # Note: the UI field currently uses maximum of 60 minutes
+ DEFAULT_SYNC_INTERVAL = 5
+
def main
Yast.import "UI"
textdomain "ntp-client"
@@ -61,7 +67,7 @@ def main
@synchronize_time = false
# The interval of synchronization in minutes.
- @sync_interval = 5
+ @sync_interval = DEFAULT_SYNC_INTERVAL
# The cron file name for the synchronization.
@cron_file = "/etc/cron.d/novell.ntp-synchronize"
@@ -462,7 +468,7 @@ def ReadSynchronization
Builtins.y2milestone("CRONTAB %1", crontab)
tmp = Ops.get_string(crontab, [0, "events", 0, "active"], "0")
@synchronize_time = tmp == "1"
- tmp = Ops.get_string(crontab, [0, "events", 0, "minute"], "*/5")
+ tmp = Ops.get_string(crontab, [0, "events", 0, "minute"], "*/#{DEFAULT_SYNC_INTERVAL}")
Builtins.y2milestone("MINUTE %1", tmp)
pos = Builtins.regexppos(tmp, "[0-9]+")
tmp2 = Builtins.substring(
@@ -930,7 +936,7 @@ def Write
def Import(settings)
settings = deep_copy(settings)
@synchronize_time = Ops.get_boolean(settings, "synchronize_time", false)
- @sync_interval = Ops.get_integer(settings, "sync_interval", 5)
+ @sync_interval = Ops.get_integer(settings, "sync_interval", DEFAULT_SYNC_INTERVAL)
@run_service = Ops.get_boolean(settings, "start_at_boot", false)
@run_chroot = Ops.get_boolean(settings, "start_in_chroot", true)
# compatibility: configure_dhcp:true translates to ntp_policy:auto