Mailinglist Archive: yast-devel (51 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] r40899 - /trunk/country/timezone/src/dialogs.ycp
  • From: Jiří Suchomel <jsuchome@xxxxxxx>
  • Date: Fri, 14 Sep 2007 07:33:57 +0200
  • Message-id: <200709140733.58105.jsuchome@xxxxxxx>
Cau,
proc chyby  v yast2-country nehlasis me?

Jirka


On Thursday 13 September 2007 18:25, kmachalkova@xxxxxxxxxxxxxxxx wrote:
> 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);
>    };

-- 
Jiri Suchomel

SUSE LINUX, s.r.o.                            e-mail: jsuchome@xxxxxxx
Lihovarská 1060/12                            tel: +420 284 028 960
190 00 Praha 9, Czech Republic                http://www.suse.cz
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages