Mailinglist Archive: yast-commit (503 mails)

< Previous Next >
[yast-commit] r40899 - /trunk/country/timezone/src/dialogs.ycp
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Thu, 13 Sep 2007 16:25:38 -0000
  • Message-id: <20070913162538.C615A35F8D@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Thu Sep 13 18:25:38 2007
New Revision: 40899

URL: http://svn.opensuse.org/viewcvs/yast?rev=40899&view=rev
Log:
- Remember whether synchronization with NTP server
has been selected (#308238)
- Do not call ntp-client functions before making
sure package yast2-ntp-client gets installed

Modified:
    trunk/country/timezone/src/dialogs.ycp

Modified: trunk/country/timezone/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/timezone/src/dialogs.ycp?rev=40899&r1=40898&r2=40899&view=diff
==============================================================================
--- trunk/country/timezone/src/dialogs.ycp (original)
+++ trunk/country/timezone/src/dialogs.ycp Thu Sep 13 18:25:38 2007
@@ -142,11 +142,25 @@
        Popup::Error( sformat("Invalid NTP server hostname %1", server) );
     }
 
+    boolean ntp_used = false;
+
+    void CreateUI() {
+        WFM::CallFunction("ntp-client_proposal", ["CreateUI"]);
+
+        ntp_used = (boolean) WFM::CallFunction("ntp-client_proposal", ["GetUseNTP"]);
+
+        if ( UI::WidgetExists(`id(`ntp_content)) )
+        {
+            UI::ChangeWidget(`id(`rb), `CurrentButton, (ntp_used ? `ntp : `manual));
+            enable_disable_widgets(ntp_used);
+        }
+    }
+
     term cont  = `HBox (
        `RadioButtonGroup (`id (`rb), `HCenter (`VBox (
            `Left (`VBox (
                // radio button label (= how to setup time)
-               `Left (`RadioButton (`id (`manual), `opt (`notify), _("Manually"), true)),
+               `Left (`RadioButton (`id (`manual), `opt (`notify), _("Manually"))),
                `VSpacing (0.5),
                `HBox (
                    `HSpacing (3),
@@ -157,15 +171,26 @@
                    )
                ),
                `VSpacing (1),
-               `ReplacePoint(`id(`rp), `Empty())
+                `Left (`VBox ( `id(`ntp_content),
+                    `Left (`RadioButton (`id (`ntp), `opt (`notify),
+                    // radio button label
+                    _("Synchronize with NTP Server"), false)),
+                  `ReplacePoint(`id(`rp), `Empty())
+                  )
+               )
            ))
-    ))));
+       ))));
+
 
     Wizard::OpenAcceptDialog ();
     Wizard::SetContents (_("Change Date and Time"), cont, htext, true, true);
     Wizard::SetDesktopIcon("timezone");
-    WFM::CallFunction("ntp-client_proposal", ["CreateUI"]);
-    enable_disable_widgets(false);
+
+    boolean ntp_installed = (Stage::initial() || Package::Installed ("yast2-ntp-client"));
+
+    if (ntp_installed) {
+       CreateUI();
+    }
 
     if (!dt_widgets)
     {
@@ -176,8 +201,6 @@
        });
     }
 
-    boolean ntp_installed = false;
-    boolean ntp_used = false;
 
     any ret = nil;
     repeat
@@ -192,10 +215,12 @@
                ntp_installed   = Package::Install ("yast2-ntp-client");
                if (!ntp_installed)
                {
-                   ntp_used    = false;
+                   ntp_used = false;
                    UI::ChangeWidget (`id (`manual), `Value, true);
                    UI::ChangeWidget (`id (`ntp), `Value, false);
                }
+               else
+                   CreateUI();
            }
            if (ntp_used )
            {
@@ -287,6 +312,7 @@
        }
     }
     until( ret==`accept || ret==`cancel );
+    WFM::CallFunction("ntp-client_proposal", [ "SetUseNTP", $["ntp_used" : ntp_used] ]);
     Wizard::CloseDialog ();
     return (ret == `accept);
   };

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages