Author: jsuchome
Date: Fri Apr 4 16:26:50 2008
New Revision: 46113
URL: http://svn.opensuse.org/viewcvs/yast?rev=46113&view=rev
Log:
- added support for Thai language (th_TH)
- changed names of language images loaded in the first stage: they
are rpm's now (bnc#376870)
- reworked NTP client usage for fate#302917: show current time
after ntpdate was called, check initial service status
- 2.16.14
Added:
trunk/country/language/data/language_th_TH.ycp (with props)
Modified:
trunk/country/VERSION
trunk/country/language/src/modules/Language.ycp
trunk/country/package/yast2-country.changes
trunk/country/timezone/src/dialogs.ycp
Modified: trunk/country/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/VERSION?rev=46113&r1=46112&r2=46113&view=diff
==============================================================================
--- trunk/country/VERSION (original)
+++ trunk/country/VERSION Fri Apr 4 16:26:50 2008
@@ -1 +1 @@
-2.16.13
+2.16.14
Added: trunk/country/language/data/language_th_TH.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/data/language_th_TH.ycp?rev=46113&view=auto
==============================================================================
--- trunk/country/language/data/language_th_TH.ycp (added)
+++ trunk/country/language/data/language_th_TH.ycp Fri Apr 4 16:26:50 2008
@@ -0,0 +1,43 @@
+/**
+ * This file contains the description of the language needed by yast2-country
+ * module.
+ *
+ * Translation of the 'language name' to actual YaST language be must applied
+ * each time this file is invoked.
+ *
+ * If you want to add new language to YaST using a file of this type provided
+ * by some module different from yast2-country (e.g. in some Add-On Product),
+ * consider using special textdomain, so it is possible to provide also
+ * translations of the 'language name' string to all installed languages.
+ *
+ * Author: JiÅÃ Suchomel
+ * $Id$
+ */
+{
+ textdomain "languages_db";
+
+ return
+ $[
+ // 1. information for language selection:
+ // Format is
+ // <LANG-Code> : [
+ // <Language-to-display-UTF8-coded>,
+ // <Language-to-display-ASCII-coded-if-needed>,
+ // <LANG modifier used when UTF-8 enconding is selected>
+ // <LANG modifier used when no UTF-8 enconding is selected>
+ // <translated Language-to-display-UTF8-coded> ]
+ //
+ "th_TH" : [
+ "ภาษาà¹à¸à¸¢",
+ "phasa thai",
+ ".UTF-8",
+ "",
+ // language name
+ _("Thai")
+ ],
+ // 2. what time zone propose for this language
+ "timezone" : "Asia/Bangkok",
+ // 3. which keyboard layout propose for this language
+ "keyboard" : "english-us",
+ ];
+}
Modified: trunk/country/language/src/modules/Language.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/modules/Language.ycp?rev=46113&r1=46112&r2=46113&view=diff
==============================================================================
--- trunk/country/language/src/modules/Language.ycp (original)
+++ trunk/country/language/src/modules/Language.ycp Fri Apr 4 16:26:50 2008
@@ -325,11 +325,11 @@
}
// Default fallback
- string filename = "root.en_US";
+ string filename = "yast2-trans-en_US.rpm";
foreach (string one_language, check_for_languages, {
if (contains (available_lang_filenames, one_language)) {
- filename = sformat ("root.%1", one_language);
+ filename = sformat ("yast2-trans-%1.rpm", one_language);
break;
}
});
Modified: trunk/country/package/yast2-country.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/package/yast2-country.changes?rev=46113&r1=46112&r2=46113&view=diff
==============================================================================
--- trunk/country/package/yast2-country.changes (original)
+++ trunk/country/package/yast2-country.changes Fri Apr 4 16:26:50 2008
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Fri Apr 4 16:13:27 CEST 2008 - jsuchome@suse.cz
+
+- added support for Thai language (th_TH)
+- changed names of language images loaded in the first stage: they
+ are rpm's now (bnc#376870)
+- reworked NTP client usage for fate#302917: show current time
+ after ntpdate was called, check initial service status
+- 2.16.14
+
+-------------------------------------------------------------------
Fri Apr 4 15:59:00 CEST 2008 - jsrain@suse.cz
- avoid calling PackageCallbacksInit::InitPackageCallbacks () to
Modified: trunk/country/timezone/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/timezone/src/dialogs.ycp?rev=46113&r1=46112&r2=46113&view=diff
==============================================================================
--- trunk/country/timezone/src/dialogs.ycp (original)
+++ trunk/country/timezone/src/dialogs.ycp Fri Apr 4 16:26:50 2008
@@ -66,14 +66,44 @@
// help text, cont.
_("<p>Press <b>Accept</b> to save your changes. Synchronization with the NTP server can be done only when the network is configured.</p>");
- map val = Timezone::GetDateTimeMap();
+ boolean dt_widgets = false;
- string hour = val["hour"]:"";
- string minute = val["minute"]:"";
- string second = val["second"]:"";
- string day = val["day"]:"";
- string month = val["month"]:"";
- string year = val["year"]:"";
+ string hour = "";
+ string minute = "";
+ string second = "";
+ string day = "";
+ string month = "";
+ string year = "";
+
+ // check current time and show it in the time widgets
+ void show_current_time () {
+
+ map val = Timezone::GetDateTimeMap();
+ hour = val["hour"]:"";
+ minute = val["minute"]:"";
+ second = val["second"]:"";
+ day = val["day"]:"";
+ month = val["month"]:"";
+ year = val["year"]:"";
+
+ if (dt_widgets)
+ {
+ UI::ChangeWidget (`id (`date), `Value,
+ sformat ("%1-%2-%3", year, month, day));
+ UI::ChangeWidget (`id (`time), `Value,
+ sformat ("%1:%2:%3", hour, minute, second)
+ );
+ }
+ else
+ {
+ UI::ChangeWidget (`id(`hour), `Value, hour);
+ UI::ChangeWidget (`id(`minute), `Value, minute);
+ UI::ChangeWidget (`id(`second), `Value, second);
+ UI::ChangeWidget (`id(`day), `Value, day);
+ UI::ChangeWidget (`id(`month), `Value, month);
+ UI::ChangeWidget (`id(`year), `Value, year);
+ }
+ }
term dateterm = `VBox (
`HBox (
@@ -83,11 +113,11 @@
),
`HBox (
`HSpacing(10),
- `TextEntry( `id(`day), `opt(`shrinkable), "", day),
+ `TextEntry( `id(`day), `opt(`shrinkable), ""),
`HSpacing (),
- `TextEntry( `id(`month), `opt(`shrinkable), "", month),
+ `TextEntry( `id(`month), `opt(`shrinkable), ""),
`HSpacing (),
- `TextEntry( `id(`year), `opt(`shrinkable), "", year),
+ `TextEntry( `id(`year), `opt(`shrinkable), ""),
`HSpacing(30)
)
);
@@ -99,33 +129,32 @@
),
`HBox (
`HSpacing(10),
- `TextEntry (`id(`hour), `opt(`shrinkable), "", hour),
+ `TextEntry (`id(`hour), `opt(`shrinkable), ""),
`HSpacing (),
- `TextEntry (`id(`minute), `opt(`shrinkable), "", minute),
+ `TextEntry (`id(`minute), `opt(`shrinkable), ""),
`HSpacing (),
- `TextEntry (`id(`second), `opt(`shrinkable), "", second),
+ `TextEntry (`id(`second), `opt(`shrinkable), ""),
`HSpacing(30)
)
);
- boolean dt_widgets = false;
if (UI::HasSpecialWidget (`Date) && UI::HasSpecialWidget (`Time))
{
dateterm = `HBox (
// label text
- `Date (`id(`date), _("Current Date"),
- sformat ("%1-%2-%3", year, month, day)
- )
+ `Date (`id(`date), _("Current Date"), "")
);
timeterm = `HBox (
// label text
- `Time (`id(`time), _("Current Time"),
- sformat ("%1:%2:%3", hour, minute, second)
- )
+ `Time (`id(`time), _("Current Time"), "")
);
dt_widgets = true;
}
- void enable_disable_widgets ( boolean ntp_used) {
+ boolean ntp_used = false;
+ boolean ntp_was_used = false;
+
+ void enable_disable_widgets () {
+ /*
if (!dt_widgets)
{
foreach (symbol widget, [`hour, `minute, `second, `day, `month, `year],{
@@ -137,62 +166,73 @@
UI::ChangeWidget (`id (`date), `Enabled, !ntp_used);
UI::ChangeWidget (`id (`time), `Enabled, !ntp_used);
}
+ */
UI::ChangeWidget (`id (`ntp_address), `Enabled, ntp_used);
UI::ChangeWidget (`id (`ntp_configure), `Enabled, ntp_used);
+ UI::ChangeWidget (`id (`ntp_now), `Enabled, ntp_used);
+ UI::ChangeWidget (`id (`ntp_save), `Enabled, ntp_used);
}
void handle_invalid_hostname( string server ) {
Popup::Error( sformat("Invalid NTP server hostname %1", server) );
}
- boolean ntp_used = false;
-
- void CreateUI() {
+ // param: when asking for first time, we check if service is running
+ void CreateUI (boolean first_time) {
WFM::CallFunction("ntp-client_proposal", ["CreateUI"]);
- ntp_used = (boolean) WFM::CallFunction("ntp-client_proposal", ["GetUseNTP"]);
+ if (first_time && !Stage::initial ())
+ ntp_used = (boolean)
+ WFM::CallFunction("ntp-client_proposal", ["GetNTPEnabled"]);
+ else
+ 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);
+ enable_disable_widgets ();
+ if (first_time)
+ // ntp_used with first_time means that ntp service is enabled
+ UI::ChangeWidget (`id(`ntp_save), `Value, 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"))),
- `VSpacing (0.5),
- `HBox (
- `HSpacing (3),
- `VBox (
- `Left (timeterm),
- `VSpacing(),
- `Left (dateterm)
- )
- ),
- `VSpacing (1),
- `Left (`VBox ( `id(`ntp_content),
- `Left (`RadioButton (`id (`ntp), `opt (`notify),
- // radio button label
- _("Synchronize with NTP Server"), false)),
- `ReplacePoint(`id(`rp), `Empty())
- )
+ `HWeight (1, `VBox ()),
+ `HWeight (4, `RadioButtonGroup (`id (`rb), `VBox (
+ // radio button label (= how to setup time)
+ `Left (`RadioButton (`id (`manual), `opt (`notify), _("Manually"))),
+ `VSpacing (0.5),
+ `HBox (
+ `HSpacing (3),
+ `VBox (
+ `Left (timeterm),
+ `VSpacing(),
+ `Left (dateterm)
)
- ))
- ))));
-
+ ),
+ `VSpacing (1),
+ `VBox (`id(`ntp_content),
+ `Left (`RadioButton (`id (`ntp), `opt (`notify),
+ // radio button label
+ _("Synchronize with NTP Server"), false)
+ ),
+ `ReplacePoint(`id(`rp), `Empty())
+ )
+ ))),
+ `HWeight (1, `VBox ())
+ );
Wizard::OpenAcceptDialog ();
Wizard::SetContents (_("Change Date and Time"), cont, htext, true, true);
Wizard::SetDesktopIcon("timezone");
+ show_current_time ();
boolean ntp_installed = (Stage::initial() || Package::Installed ("yast2-ntp-client"));
-
if (ntp_installed) {
- CreateUI();
+ CreateUI (true);
+ ntp_was_used = ntp_used;
if (ntp_used)
WFM::CallFunction ("ntp-client_proposal", [ "MakeProposal",
$[ "country" : Language::GetLanguageCountry() ] ]);
@@ -226,19 +266,18 @@
UI::ChangeWidget (`id (`ntp), `Value, false);
}
else
- CreateUI();
+ CreateUI (false);
}
if (ntp_used )
{
WFM::CallFunction("ntp-client_proposal", [ "MakeProposal",
$[ "country" : Language::GetLanguageCountry() ] ]);
}
- enable_disable_widgets (ntp_used);
+ enable_disable_widgets ();
}
if (ret == `ntp_configure)
{
symbol rv = (symbol) WFM::CallFunction ("ntp-client_proposal", ["AskUser"]);
-
if( rv == `invalid_hostname)
{
handle_invalid_hostname( (string) UI::QueryWidget(`id(`ntp_server), `Value) );
@@ -247,6 +286,31 @@
}
if (rv != `next)
continue;
+ else if (!Stage::initial ())
+ {
+ // show the 'save' status after configuration
+ boolean enabled = (boolean)
+ WFM::CallFunction("ntp-client_proposal", ["GetNTPEnabled"]);
+ UI::ChangeWidget (`id(`ntp_save), `Value, enabled);
+ }
+ }
+ if (ret == `ntp_now)
+ {
+ map argmap = $[
+ "ntpdate_only" : true
+ ];
+ symbol rv = (symbol) WFM::CallFunction ("ntp-client_proposal",
+ ["Write", argmap]);
+ if( rv == `invalid_hostname)
+ {
+ handle_invalid_hostname( (string) UI::QueryWidget(`id(`ntp_server), `Value) );
+ ret = `retry;
+ continue;
+ }
+ if (rv == `success)
+ {
+ show_current_time ();
+ }
}
if (ret == `accept && !ntp_used)
{
@@ -296,14 +360,19 @@
{
Timezone::SetTime( year, month, day, hour, minute, second );
}
+// if (ntp_was_used) FIXME remove NTP config now?
}
if (ret == `accept && ntp_used)
{
- symbol rv = (symbol) WFM::CallFunction("ntp-client_proposal", ["Write"]);
+ map argmap = $[];
+ if (UI::QueryWidget (`id (`ntp_save), `Value) == false)
+ argmap["ntpdate_only"] = true;
+ symbol rv = (symbol) WFM::CallFunction ("ntp-client_proposal",
+ ["Write", argmap]);
string server = (string) UI::QueryWidget(`id(`ntp_address), `Value);
- if (rv == `invalid_hostname)
+ if (rv == `invalid_hostname)
{
handle_invalid_hostname( server );
ret = `retry;
@@ -410,6 +479,7 @@
"America/Winnipeg",
"America/Argentina/Buenos_Aires",
"America/Sao_Paulo",
+ "America/Mexico_City",
"America/La_Paz",
"Asia/Novosibirsk",
"Asia/Calcutta",
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org