Hello community,

here is the log from the commit of package yast2-ntp-client for 
openSUSE:Leap:15.2 checked in at 2020-03-26 05:41:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/yast2-ntp-client (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.yast2-ntp-client.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-ntp-client"

Thu Mar 26 05:41:03 2020 rev:71 rq:787747 version:4.2.11

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/yast2-ntp-client/yast2-ntp-client.changes      
2020-03-13 10:55:44.172364564 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.yast2-ntp-client.new.3160/yast2-ntp-client.changes
    2020-03-26 05:41:04.879269527 +0100
@@ -1,0 +2,15 @@
+Mon Mar 23 14:19:10 CET 2020 - sch...@suse.de
+
+- Do not write ntp-servers if they have been shown only (more than
+  one ntp-server) (follow up of bsc#1164547).
+- 4.2.11
+
+-------------------------------------------------------------------
+Wed Mar 18 15:44:25 CET 2020 - sch...@suse.de
+
+- NTP-server-configuration/Time-setting-module in a running
+  system: Do not show check-boxes for saving configuration and
+  starting the deamon (follow up of bsc#1164547).
+- 4.2.10
+
+-------------------------------------------------------------------

Old:
----
  yast2-ntp-client-4.2.9.tar.bz2

New:
----
  yast2-ntp-client-4.2.11.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-ntp-client.spec ++++++
--- /var/tmp/diff_new_pack.OK0YCc/_old  2020-03-26 05:41:05.227269708 +0100
+++ /var/tmp/diff_new_pack.OK0YCc/_new  2020-03-26 05:41:05.231269710 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ntp-client
-Version:        4.2.9
+Version:        4.2.11
 Release:        0
 Summary:        YaST2 - NTP Client Configuration
 License:        GPL-2.0-or-later

++++++ yast2-ntp-client-4.2.9.tar.bz2 -> yast2-ntp-client-4.2.11.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ntp-client-4.2.9/package/yast2-ntp-client.changes 
new/yast2-ntp-client-4.2.11/package/yast2-ntp-client.changes
--- old/yast2-ntp-client-4.2.9/package/yast2-ntp-client.changes 2020-03-09 
17:00:02.000000000 +0100
+++ new/yast2-ntp-client-4.2.11/package/yast2-ntp-client.changes        
2020-03-23 15:06:32.000000000 +0100
@@ -1,4 +1,19 @@
 -------------------------------------------------------------------
+Mon Mar 23 14:19:10 CET 2020 - sch...@suse.de
+
+- Do not write ntp-servers if they have been shown only (more than
+  one ntp-server) (follow up of bsc#1164547).
+- 4.2.11
+
+-------------------------------------------------------------------
+Wed Mar 18 15:44:25 CET 2020 - sch...@suse.de
+
+- NTP-server-configuration/Time-setting-module in a running
+  system: Do not show check-boxes for saving configuration and
+  starting the deamon (follow up of bsc#1164547).
+- 4.2.10
+
+-------------------------------------------------------------------
 Tue Mar  3 16:38:54 CET 2020 - sch...@suse.de
 
 - Supporting more than one ntp server in the time setting module.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ntp-client-4.2.9/package/yast2-ntp-client.spec 
new/yast2-ntp-client-4.2.11/package/yast2-ntp-client.spec
--- old/yast2-ntp-client-4.2.9/package/yast2-ntp-client.spec    2020-03-09 
17:00:02.000000000 +0100
+++ new/yast2-ntp-client-4.2.11/package/yast2-ntp-client.spec   2020-03-23 
15:06:32.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ntp-client
-Version:        4.2.9
+Version:        4.2.11
 Release:        0
 Summary:        YaST2 - NTP Client Configuration
 License:        GPL-2.0-or-later
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ntp-client-4.2.9/src/clients/ntp-client_proposal.rb 
new/yast2-ntp-client-4.2.11/src/clients/ntp-client_proposal.rb
--- old/yast2-ntp-client-4.2.9/src/clients/ntp-client_proposal.rb       
2020-03-09 17:00:02.000000000 +0100
+++ new/yast2-ntp-client-4.2.11/src/clients/ntp-client_proposal.rb      
2020-03-23 15:06:32.000000000 +0100
@@ -87,58 +87,49 @@
     end
 
     def ui_help_text
-      # help text
-      tmp = _(
-        "<p>Press <b>Synchronize Now</b>, to get your system time set 
correctly " \
-        "using the selected NTP server. If you want to make use of NTP 
permanently, " \
-        "enable the <b>Save NTP Configuration</b> option</p>"
-      )
-
-      tmp = Ops.add(
-        tmp,
+      if Stage.initial
+        # help text
         _(
+          "<p>Press <b>Synchronize Now</b>, to get your system time set 
correctly " \
+          "using the selected NTP server. If you want to make use of NTP 
permanently, " \
+          "enable the <b>Save NTP Configuration</b> option</p>"
+        ) + _(
           "<p>Enabling <b>Run NTP as daemon</b> option, the NTP service will 
be " \
           "started as daemon. Otherwise the system time will be synchronized 
periodically. " \
           "The default interval is 15 min. You can change it after 
installation " \
           "with the <b>yast2 ntp-client module</b>.</p>"
-        )
-      )
-
-      # help text, cont.
-      if !Stage.initial
-        tmp = Ops.add(
-          tmp,
-          _(
-            "<p>Using the <b>Configure</b> button, open the advanced NTP 
configuration.</p>"
-          )
-        )
-      end
-
-      # help text, cont.
-      tmp = Ops.add(
-        tmp,
-        _(
+        ) + _(
           "<p>Synchronization with the NTP server can be done only when " \
           "the network is configured.</p>"
         )
-      )
-      tmp
+      else
+        # help text
+        _(
+          "<p>Using the <b>Configure</b> button, open the advanced NTP 
configuration.</p>"
+        )
+      end
     end
 
     def ui_enable_disable_widgets(enabled)
       UI.ChangeWidget(Id(:ntp_address), :Enabled, enabled) if select_ntp_server
-      UI.ChangeWidget(Id(:run_service), :Enabled, enabled)
-      # FIXME: With chronyd, we cannot synchronize if the service is already
-      # running, we could force a makestep in this case, but then the button
-      # should be reworded and maybe the user should confirm it (bsc#1087048)
-      if !NetworkService.isNetworkRunning || 
Service.Active(NtpClient.service_name)
-        UI.ChangeWidget(Id(:ntp_now), :Enabled, false)
-      else
-        UI.ChangeWidget(Id(:ntp_now), :Enabled, enabled)
+
+      if Stage.initial
+        UI.ChangeWidget(Id(:run_service), :Enabled, enabled)
+
+        # FIXME: With chronyd, we cannot synchronize if the service is already
+        # running, we could force a makestep in this case, but then the button
+        # should be reworded and maybe the user should confirm it (bsc#1087048)
+        if !NetworkService.isNetworkRunning || 
Service.Active(NtpClient.service_name)
+          UI.ChangeWidget(Id(:ntp_now), :Enabled, false)
+        else
+          UI.ChangeWidget(Id(:ntp_now), :Enabled, enabled)
+        end
+        UI.ChangeWidget(Id(:ntp_save), :Enabled, enabled)
+      end
+      if UI.WidgetExists(Id(:ntp_configure))
+        # bnc#483787
+        UI.ChangeWidget(Id(:ntp_configure), :Enabled, enabled)
       end
-      UI.ChangeWidget(Id(:ntp_save), :Enabled, enabled)
-      # bnc#483787
-      UI.ChangeWidget(Id(:ntp_configure), :Enabled, enabled) if 
UI.WidgetExists(Id(:ntp_configure))
 
       nil
     end
@@ -190,6 +181,10 @@
 
         log.info "ntp_items :#{ntp_items}"
         UI.ChangeWidget(Id(:ntp_address), :Items, ntp_items)
+        if !Stage.initial
+          UI.ChangeWidget(Id(:ntp_address), :Value,
+            NtpClient.GetUsedNtpServers.first)
+        end
       end
 
       nil
@@ -222,6 +217,36 @@
         ntp_server_widget = Label(text)
       end
 
+      if Stage.initial
+        # TRANSLATORS: push button label
+        ntp_server_action_widget = Left(PushButton(Id(:ntp_now), 
_("S&ynchronize now")))
+        save_run_widget = VBox(
+          HBox(
+            HSpacing(0.5),
+            # TRANSLATORS: check box label
+            Left(
+              CheckBox(
+                Id(:run_service),
+                _("&Run NTP as daemon"),
+                NtpClient.run_service
+              )
+            )
+          ),
+          HBox(
+            HSpacing(0.5),
+            # TRANSLATORS: check box label
+            Left(
+              CheckBox(Id(:ntp_save), _("&Save NTP Configuration"), true)
+            )
+          )
+        )
+      else
+        # TRANSLATORS: push button label
+        # bnc#449615: only simple config for inst-sys
+        ntp_server_action_widget = Left(PushButton(Id(:ntp_configure), 
_("&Configure...")))
+        save_run_widget = VBox()
+      end
+
       cont = VBox(
         VSpacing(0.5),
         HBox(
@@ -239,8 +264,7 @@
               # an explicit vertical space was added in order to move down the
               # push button being aligned with the combo box input.
               UI.TextMode ? VSpacing(1) : Label(""),
-              # TRANSLATORS: push button label
-              Left(PushButton(Id(:ntp_now), _("S&ynchronize now")))
+              ntp_server_action_widget
             )
           )
         ),
@@ -248,49 +272,23 @@
           HSpacing(3),
           HWeight(
             1,
-            VBox(
-              HBox(
-                HSpacing(0.5),
-                # TRANSLATORS: check box label
-                Left(
-                  CheckBox(
-                    Id(:run_service),
-                    _("&Run NTP as daemon"),
-                    NtpClient.run_service
-                  )
-                )
-              ),
-              HBox(
-                HSpacing(0.5),
-                # TRANSLATORS: check box label
-                Left(
-                  CheckBox(Id(:ntp_save), _("&Save NTP Configuration"), true)
-                )
-              )
-            )
-          ),
-          HWeight(
-            1,
-            VBox(
-              # TRANSLATORS: push button label
-              # bnc#449615: only simple config for inst-sys
-              Stage.initial ? Label("") : Left(PushButton(Id(:ntp_configure), 
_("&Configure..."))),
-              Label("")
-            )
+            save_run_widget
           )
         )
       )
 
       UI.ReplaceWidget(replace_point, cont)
 
-      UI.ChangeWidget(Id(:ntp_now), :Enabled, false) if 
!NetworkService.isNetworkRunning
+      if Stage.initial && !NetworkService.isNetworkRunning
+        UI.ChangeWidget(Id(:ntp_now), :Enabled, false)
+      end
 
       # ^ createui0
 
       # FIXME: is it correct? move out?
       ntp_used = (first_time && !Stage.initial) ? GetNTPEnabled() : 
NtpClient.ntp_selected
 
-      UI.ChangeWidget(Id(:ntp_save), :Value, ntp_used)
+      UI.ChangeWidget(Id(:ntp_save), :Value, ntp_used) if Stage.initial
 
       MakeProposal()
       ntp_used
@@ -323,10 +321,13 @@
     def WriteNtpSettings(ntp_servers, ntp_server, run_service)
       ntp_servers = deep_copy(ntp_servers)
       NtpClient.modified = true
-      NtpClient.ntp_conf.clear_pools
-      ntp_servers << ntp_server if ntp_servers.empty?
-      ntp_servers.each do |server|
-        NtpClient.ntp_conf.add_pool(server)
+      if select_ntp_server
+        # The user has changed the ntp-server(s). So we are writing them.
+        NtpClient.ntp_conf.clear_pools
+        ntp_servers << ntp_server if ntp_servers.empty?
+        ntp_servers.each do |server|
+          NtpClient.ntp_conf.add_pool(server)
+        end
       end
       if run_service
         NtpClient.run_service = true
@@ -422,8 +423,11 @@
         elsif rv == :next && !Stage.initial
           # Updating UI for the changed ntp servers
           ui_init(Id(:rp), false)
-          # show the 'save' status after configuration
-          UI.ChangeWidget(Id(:ntp_save), :Value, GetNTPEnabled())
+
+          if Stage.initial
+            # show the 'save' status after configuration
+            UI.ChangeWidget(Id(:ntp_save), :Value, GetNTPEnabled())
+          end
         end
       when :ntp_now
         rv = Write("ntpdate_only" => true)
@@ -454,9 +458,11 @@
     def ui_try_save
       argmap = {}
       Ops.set(argmap, "ntpdate_only", false)
-      Ops.set(argmap, "run_service", false)
-      Ops.set(argmap, "ntpdate_only", true) if UI.QueryWidget(Id(:ntp_save), 
:Value) == false
-      Ops.set(argmap, "run_service", true) if UI.QueryWidget(Id(:run_service), 
:Value) == true
+      Ops.set(argmap, "run_service", NtpClient.run_service)
+      if Stage.initial
+        Ops.set(argmap, "ntpdate_only", true) if UI.QueryWidget(Id(:ntp_save), 
:Value) == false
+        Ops.set(argmap, "run_service", true) if 
UI.QueryWidget(Id(:run_service), :Value)
+      end
 
       rv = Write(argmap)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ntp-client-4.2.9/test/ntp_client_proposal_test.rb 
new/yast2-ntp-client-4.2.11/test/ntp_client_proposal_test.rb
--- old/yast2-ntp-client-4.2.9/test/ntp_client_proposal_test.rb 2020-03-09 
17:00:02.000000000 +0100
+++ new/yast2-ntp-client-4.2.11/test/ntp_client_proposal_test.rb        
2020-03-23 15:06:32.000000000 +0100
@@ -32,6 +32,7 @@
       allow(Yast::NtpClient).to receive(:GetUsedNtpServers)
         .and_return(["de.pool.ntp.org"])
       allow(subject).to receive(:select_ntp_server).and_return(true)
+      allow(Yast::Stage).to receive(:initial).and_return(true)
     end
 
     context "when NTP servers were found via DHCP" do


Reply via email to