Author: locilka
Date: Mon Jan 14 13:40:13 2008
New Revision: 43576
URL: http://svn.opensuse.org/viewcvs/yast?rev=43576&view=rev
Log:
- Added new Language/Keyboard/License dialog (FATE #302957).
- 2.16.9
Added:
trunk/installation/src/clients/inst_complex_welcome.ycp
Modified:
trunk/installation/VERSION
trunk/installation/package/yast2-installation.changes
trunk/installation/src/modules/InstData.ycp
Modified: trunk/installation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/VERSION?rev=43576&r1=43575&r2=43576&view=diff
==============================================================================
--- trunk/installation/VERSION (original)
+++ trunk/installation/VERSION Mon Jan 14 13:40:13 2008
@@ -1 +1 @@
-2.16.8
+2.16.9
Modified: trunk/installation/package/yast2-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=43576&r1=43575&r2=43576&view=diff
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Mon Jan 14 13:40:13 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jan 14 13:39:00 CET 2008 - locilka@suse.cz
+
+- Added new Language/Keyboard/License dialog (FATE #302957).
+- 2.16.9
+
+-------------------------------------------------------------------
Thu Jan 10 14:08:17 CET 2008 - locilka@suse.cz
- Extended system type and software selection dialog. Added base
Added: trunk/installation/src/clients/inst_complex_welcome.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_complex_welcome.ycp?rev=43576&view=auto
==============================================================================
--- trunk/installation/src/clients/inst_complex_welcome.ycp (added)
+++ trunk/installation/src/clients/inst_complex_welcome.ycp Mon Jan 14 13:40:13 2008
@@ -0,0 +1,445 @@
+/**
+ * File:
+ * inst_complex_welcome.ycp
+ *
+ * Module:
+ * Installation
+ *
+ * Authors:
+ * Klaus Kämpf
+ * Michael Hager
+ * Stefan Hundhammer
+ * Thomas Roelz
+ * Jiri Suchomel
+ * Lukas Ocilka
+ *
+ * Summary:
+ * This client shows main dialog for choosing the language,
+ * keyboard and accepting the license.
+ *
+ * Attention:
+ * This is still work in progress ...
+ *
+ * $Id:$
+ *
+ */
+{
+ textdomain "installation";
+
+ import "Console";
+ import "GetInstArgs";
+ import "Keyboard";
+ import "Label";
+ import "Language";
+ import "Mode";
+ import "Popup";
+ import "ProductFeatures";
+ import "Report";
+ import "Stage";
+ import "Timezone";
+ import "Wizard";
+ import "Icon";
+ import "InstData";
+
+ string language = Language::language;
+
+ /**
+ * check if selected language has support on media (F301238)
+ * show a warning when not
+ */
+ define void check_languages_support (string selected_language) {
+
+ string linguas = (string) SCR::Read (.content.LINGUAS);
+
+ if (linguas == nil) {
+ y2warning ("No LINGUAS tag defined in content file");
+ return;
+ }
+
+ y2milestone ("content LINGUAS %1", linguas);
+ list <string> all_linguas = splitstring (linguas, " ");
+ string language_short = substring (selected_language, 0, 2);
+
+ if (!contains (all_linguas, selected_language) && !contains (all_linguas, language_short)) {
+ y2milestone ("Language %1 is not fully supported", selected_language);
+ // popup message
+ Popup::Message (_("Only minimal support for the selected language is included on the media.
+Add the Language Add-On CD as an additional repository to get better support
+for this language."));
+ }
+ }
+
+
+/*
+ define void update_adapt_term () {
+
+ string kb = Keyboard::GetKeyboardForLanguage (language, "english-us");
+ string tz = Timezone::GetTimezoneForLanguage (language, "US/Mountain");
+
+ string kbd_name = Keyboard::Selection ()[kb]:"";
+ string tmz_name = Timezone::GetTimezoneCountry (tz);
+
+ UI::ReplaceWidget (`id(`rpadapt), `VBox (
+ `Left (`CheckBox (`id (`adapt_kbd),
+ // check box label (%1 is keyboard layout name)
+ sformat(_("Adapt &Keyboard Layout to %1"),kbd_name))),
+ `Left (`CheckBox (`id (`adapt_tmz),
+ // check box label (%1 is country name)
+ sformat (_("Adapt &Time Zone to %1"), tmz_name)))
+ ));
+
+ UI::ChangeWidget(`id(`adapt_kbd),`Enabled, kb != Keyboard::current_kbd);
+ UI::ChangeWidget(`id(`adapt_tmz),`Enabled, tz != Timezone::timezone);
+ }
+*/
+
+ // ------------------------------------- main part of the client -----------
+
+ map argmap = GetInstArgs::argmap();
+
+ // Check if the current call should be treated as the first run (3rd param).
+ // In this case if the user exits with next the the current setting
+ // will be made the default that is restored with "Reset to defaults".
+ //
+ boolean set_default = argmap["first_run"]:"no" == "yes";
+ y2milestone("set_default: %1", set_default );
+
+ string preselected = Language::preselected;
+
+ if (preselected != "en_US" && set_default)
+ {
+ if (ProductFeatures::GetBooleanFeature ("globals", "skip_language_dialog"))
+ {
+ y2milestone("Skipping language dialog, Language changed to %1",preselected);
+ check_languages_support (preselected);
+ Language::selection_skipped = true;
+ return `auto;
+ }
+ }
+
+ list<string>languages = splitstring (Language::languages, ",");
+
+ // filter the primary language from the list of secondary ones:
+ languages = filter (string l, languages, ``(l != language));
+
+
+ // Build the contents of the dialog.
+
+ // build up language selection box
+ // with the default selection according to Language::language
+
+ // set up selection list with default item
+
+ boolean use_ascii = Language::GetTextMode ();
+
+ /* ----------------------------------------------------------------------
+ * Build dialog
+ * ----------------------------------------------------------------------*/
+ // heading text
+ string heading_text = _("Languages");
+
+ // sort language by ASCII with help of a map
+ // $[ "ascii-name" : [ "user-readable-string", "code" ], ...]
+ // the "user-readable-string" is either ascii or utf8, depending
+ // on textmode probed above (workaround because there isn't any
+ // usable console font for all languages).
+
+ map languageselsort = mapmap (
+ string lang_code, list lang_info, Language::Selection(), {
+ string key = lang_info [1]:lang_code;
+ return $[
+ key : [
+ lang_info[use_ascii ? 1 : 0]:"",
+ lang_code,
+ lang_info[2]:key
+ ]
+ ];
+ }
+ );
+
+ // mapping of language name (translated) to language code
+ map lang2code = $[];
+ // list of language names (translated)
+ list<string> lang_list = [];
+ foreach (any name, list codelist, languageselsort, {
+ lang2code [codelist[2]:""] = codelist[1]:"";
+ lang_list = add (lang_list, codelist[2]:"");
+ });
+
+ term languagesel = `ComboBox (
+ `id (`language),
+ `opt (`notify),
+ _("&Language"),
+ maplist (any name, list codelist, languageselsort, {
+ return `item (
+ `id (codelist[1]:""),
+ codelist[0]:""//,
+ //(language == codelist[1]:"")
+ );
+ })
+ );
+
+ map keyb_selection = Keyboard::Selection();
+ string keyb = "";
+
+ list <term> keyb_items = maplist (any name, list codelist, languageselsort, {
+ keyb = Keyboard::GetKeyboardForLanguage (codelist[1]:"", "english-us");
+
+ return `item (
+ `id (keyb),
+ keyb_selection[keyb]:""
+ );
+ });
+ keyb_items = toset (keyb_items);
+
+
+ term keyboardsel = `ComboBox (
+ `id (`keyboard),
+ `opt (`notify),
+ _("&Keyboard Layout"),
+ keyb_items
+ );
+
+ if (Stage::firstboot ())
+ languagesel = `ComboBox (`id(`language), `opt(`notify), _("&Language"),
+ maplist (string trans_lang, lsort (lang_list), {
+ string code = lang2code [trans_lang]:"";
+ return `item (`id (code), trans_lang, language == code);
+ })
+ );
+
+ // this type of contents will be shown only for initial installation dialog
+ term contents = `VBox (
+ `VWeight (3, `VStretch()),
+ `HSquash (`VBox (
+ `HBox (
+ `HSquash (Icon::Simple ("yast-language")),
+ `HSpacing (2),
+ `Left (languagesel)
+ ),
+ `VSpacing (1),
+ `HBox (
+ `HSquash (Icon::Simple ("yast-keyboard")),
+ `HSpacing (2),
+ `Left (keyboardsel)
+ )
+ )),
+ `VWeight (1, `VStretch()),
+ `HSquash (
+ `VBox (
+ `Left (`Label (`opt(`boldFont), _("License Agreement"))),
+ `Left (`Label (_("License agreement is missing here.
+It will be added soon."))),
+ `Left (`CheckBox (`id (`license_agreement), `opt (`notify), _("I Do Agree to the License Terms."), InstData::product_license_accepted))
+ )
+ ),
+ `VWeight (3, `VStretch())
+ );
+
+ string help_text = "";
+ // help text (language dependent packages) - at the end of help
+ string packages_help = _("<p>
+Additional packages with support for the selected primary and secondary languages will be installed. Packages no longer needed will be removed.
+</p>");
+
+ if (Stage::initial ())
+ {
+ // help text for initial (first time) language screen
+ help_text = _("<p>
+Choose the <b>Language</b> to use during installation and for
+the installed system.
+</p>
+");
+
+ // help text, continued
+ help_text = help_text + _("<p>
+Click <b>Next</b> to proceed to the next dialog.
+</p>
+");
+
+ // help text, continued
+ help_text = help_text + _("<p>
+Nothing will happen to your computer until you confirm
+all your settings in the last installation dialog.
+</p>
+");
+ if (set_default)
+ {
+ // help text, continued
+ help_text = help_text + _("<p>
+You can select <b>Abort Installation</b> at any time to abort the
+installation process.
+</p>
+");
+ }
+ }
+ else
+ {
+ // different help text when called after installation
+ // in an installed system
+ help_text = _("<p>
+Choose the new <b>Language</b> for your system.
+</p>\n");
+ }
+
+ // Screen title for the first interactive dialog
+
+ Wizard::SetContents (heading_text, contents, help_text,
+ argmap["enable_back"]:true , argmap["enable_next"]:true);
+
+ UI::ChangeWidget (`id (`language), `Value, language);
+
+ if (Keyboard::user_decision == true) {
+ UI::ChangeWidget (`id (`keyboard), `Value, Keyboard::current_kbd);
+ } else {
+ string kbd = Keyboard::GetKeyboardForLanguage (language, "english-us");
+ UI::ChangeWidget (`id (`keyboard), `Value, kbd);
+ }
+
+ Wizard::SetTitleIcon ("yast-language");
+
+ // Get the user input.
+ //
+ any ret = nil;
+
+ UI::SetFocus(`id(`language));
+
+ // adapt keyboard for language?
+ boolean kbd_adapt = (set_default && !Mode::config ());
+ // adapt timezone for language?
+ boolean tmz_adapt = (set_default && !Mode::config ());
+
+ string keyboard = "";
+ boolean license_acc = nil;
+
+ while (true)
+ {
+ ret = UI::UserInput();
+ y2milestone ("UserInput() returned %1", ret);
+
+ if (ret == `abort && Popup::ConfirmAbort (`painless))
+ {
+ Wizard::RestoreNextButton();
+ return `abort;
+ }
+ else if (ret == `keyboard)
+ {
+ Keyboard::user_decision = true;
+ }
+ else if (ret == `license_agreement)
+ {
+ InstData::product_license_accepted = (boolean) UI::QueryWidget (`id (`license_agreement), `Value);
+ }
+ else if (ret == `next || (ret == `language && ! Mode::config ()))
+ {
+ language = (string) UI::QueryWidget (`id (`language), `Value);
+ keyboard = (string) UI::QueryWidget (`id (`keyboard), `Value);
+ license_acc = (boolean) UI::QueryWidget (`id (`license_agreement), `Value);
+
+ if (ret == `next && license_acc != true) {
+ UI::SetFocus (`id (`license_agreement));
+ Report::Message (_("License needs to be accepted"));
+ ret = `not_next;
+ continue;
+ }
+
+ if (ret == `next && Language::IncompleteTranslation (language))
+ {
+ // continue/cancel message
+ if (!Popup::ContinueCancel (_("Translation of the primary language is not complete.
+Some texts may be displayed in English.
+")))
+ {
+ ret = `not_next;
+ continue;
+ }
+ }
+
+ if (ret == `next && Stage::initial ())
+ {
+ check_languages_support (language);
+ }
+
+ if (language != Language::language)
+ {
+ y2milestone ("Language changed from %1 to %2", Language::language, language);
+
+ if (set_default)
+ {
+ Timezone::ResetZonemap ();
+ }
+
+ // Set it in the Language module.
+ //
+ Language::Set (language);
+ }
+
+ if (Stage::initial () || Stage::firstboot ())
+ {
+ if ((set_default && ret == `language ||
+ (!set_default && ret == `next)) &&
+ Language::CJKLanguage (language) &&
+ !Language::CJKLanguage (preselected) &&
+ Language::GetTextMode ())
+ {
+ // popup message (user selected CJK language in text mode)
+ Popup::Message (_("The selected language cannot be used in text mode. English is used for
+installation, but the selected language will be used for the new system."));
+
+ Language::WfmSetGivenLanguage ("en_US");
+ }
+ else if (ret == `next || (set_default && ret == `language))
+ {
+ Console::SelectFont (language);
+ Language::WfmSetLanguage ();
+ }
+ }
+
+ Keyboard::SetLanguage (keyboard);
+
+ if (ret == `language && set_default)
+ {
+ // Display newly translated dialog.
+ Wizard::SetFocusToNextButton();
+ return `again;
+ }
+
+ if (ret == `next)
+ {
+ // Language has been set already.
+ // On first run store users decision as default.
+ //
+ if (set_default)
+ {
+ y2milestone("Resetting to default language");
+ Language::SetDefault();
+ }
+
+ if (tmz_adapt)
+ {
+ Timezone::SetTimezoneForLanguage (language);
+ }
+ else
+ {
+ Timezone::user_decision = true;
+ }
+
+ if (!Stage::initial () && !Mode::update ())
+ {
+ // save settings (rest is saved in LanguageWrite)
+ if (kbd_adapt)
+ Keyboard::Save (true);
+ if (tmz_adapt)
+ Timezone::Save ();
+ }
+ y2milestone ("Language: '%1', system encoding '%2'", language,
+ WFM::GetEncoding());
+
+ }
+ }
+
+ if (ret == `next || ret == `back) break;
+ }
+
+ return (symbol) ret;
+}
Modified: trunk/installation/src/modules/InstData.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/modules/InstData.ycp?rev=43576&r1=43575&r2=43576&view=diff
==============================================================================
--- trunk/installation/src/modules/InstData.ycp (original)
+++ trunk/installation/src/modules/InstData.ycp Mon Jan 14 13:40:13 2008
@@ -33,5 +33,11 @@
// <-- software selection
+ // --> other
+
+ global boolean product_license_accepted = false;
+
+ // <-- other
+
/* EOF */
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org