Author: jsuchome
Date: Thu Jul 16 14:01:16 2009
New Revision: 58083
URL: http://svn.opensuse.org/viewcvs/yast?rev=58083&view=rev
Log:
- added step for both language and keyboard layout (fate#306296)
- 2.18.5
Added:
trunk/firstboot/src/firstboot_language_keyboard.ycp (with props)
Modified:
trunk/firstboot/VERSION
trunk/firstboot/package/yast2-firstboot.changes
trunk/firstboot/src/control/firstboot.xml
trunk/firstboot/yast2-firstboot.spec.in
Modified: trunk/firstboot/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/firstboot/VERSION?rev=58083&r1=58082&r2=58083&view=diff
==============================================================================
--- trunk/firstboot/VERSION (original)
+++ trunk/firstboot/VERSION Thu Jul 16 14:01:16 2009
@@ -1 +1 @@
-2.18.4
+2.18.5
Modified: trunk/firstboot/package/yast2-firstboot.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/firstboot/package/yast2-firstboot.changes?rev=58083&r1=58082&r2=58083&view=diff
==============================================================================
--- trunk/firstboot/package/yast2-firstboot.changes (original)
+++ trunk/firstboot/package/yast2-firstboot.changes Thu Jul 16 14:01:16 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Jul 16 13:58:34 CEST 2009 - jsuchome@suse.cz
+
+- added step for both language and keyboard layout (fate#306296)
+- 2.18.5
+
+-------------------------------------------------------------------
Tue Jul 7 10:06:25 CEST 2009 - jsuchome@suse.cz
- added option to do reboot at the end of firstboot (bnc#514745)
Modified: trunk/firstboot/src/control/firstboot.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/firstboot/src/control/firstboot.xml?rev=58083&r1=58082&r2=58083&view=diff
==============================================================================
--- trunk/firstboot/src/control/firstboot.xml (original)
+++ trunk/firstboot/src/control/firstboot.xml Thu Jul 16 14:01:16 2009
@@ -72,6 +72,12 @@
<mode>installation</mode>
<modules config:type="list">
<module>
+ <label>Language and Keyboard</label>
+ <enabled config:type="boolean">true</enabled>
+ <!-- step for configuration of both language and keyboard layout (fate#306296) -->
+ <name>firstboot_language</name>
+ </module>
+ <module>
<label>Language</label>
<enabled config:type="boolean">false</enabled>
<name>firstboot_language</name>
Added: trunk/firstboot/src/firstboot_language_keyboard.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/firstboot/src/firstboot_language_keyboard.ycp?rev=58083&view=auto
==============================================================================
--- trunk/firstboot/src/firstboot_language_keyboard.ycp (added)
+++ trunk/firstboot/src/firstboot_language_keyboard.ycp Thu Jul 16 14:01:16 2009
@@ -0,0 +1,253 @@
+/**
+ * File:
+ * firstboot_language_keyboard.ycp
+ *
+ * Module:
+ * Firsboot
+ *
+ * Authors:
+ * Jiri Suchomel
+ * Lukas Ocilka
+ *
+ * Summary:
+ * This client shows dialog for choosing the language and keyboard layout
+ *
+ * $Id$
+ *
+ */
+{
+ textdomain "firstboot";
+
+ import "Console";
+ import "Directory";
+ import "GetInstArgs";
+ import "Keyboard";
+ import "Label";
+ import "Language";
+ import "Popup";
+ import "Report";
+ import "Timezone";
+ import "Wizard";
+ import "Icon";
+
+ // ------------------------------------- main part of the client -----------
+
+ map argmap = GetInstArgs::argmap();
+
+ string language = Language::language;
+
+ // language preselected in /etc/install.inf
+ string preselected = Language::preselected;
+
+ boolean text_mode = Language::GetTextMode ();
+
+ /* ----------------------------------------------------------------------
+ * Build dialog
+ * ----------------------------------------------------------------------*/
+ // heading text
+ string heading_text = _("Language and Keyboard Layout");
+
+ term languagesel = `ComboBox (
+ `id (`language),
+ `opt (`notify, `hstretch),
+ // combo box label
+ _("&Language"), Language::GetLanguageItems (`first_screen)
+ );
+
+ term keyboardsel = `ComboBox (
+ `id (`keyboard),
+ `opt (`notify, `hstretch),
+ // combo box label
+ _("&Keyboard Layout"),
+ Keyboard::GetKeyboardItems ()
+ );
+
+ // 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()),
+ `VWeight (3, `VStretch())
+ );
+
+ // help text for firstboot language + keyboard screen
+ string help_text = _("<p>
+Choose the <b>Language</b> and the <b>Keyboard layout</b> to be used during
+configuration and for the installed system.
+</p>
+") +
+ // help text, continued
+ _("<p>
+Click <b>Next</b> to proceed to the next dialog.
+</p>
+") +
+ // help text, continued
+ _("<p>
+Select <b>Abort</b> to abort the
+installation process at any time.
+</p>
+");
+
+ // Screen title for the first interactive dialog
+
+ Wizard::SetContents (heading_text, contents, help_text,
+ argmap["enable_back"]:true , argmap["enable_next"]:true);
+ Wizard::EnableAbortButton ();
+
+ 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));
+
+ string keyboard = "";
+
+ // Returns true if the dialog needs redrawing
+ boolean SetLanguageIfChanged (any ret) {
+
+ if (language != Language::language)
+ {
+ y2milestone ("Language changed from %1 to %2", Language::language, language);
+ Timezone::ResetZonemap ();
+
+ // Set it in the Language module.
+ Language::Set (language);
+ }
+ // Check and set CJK languages
+ if (ret == `language && 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 == `language)
+ {
+ Console::SelectFont (language);
+ // no yast translation for nn_NO, use nb_NO as a backup
+ if (language == "nn_NO")
+ {
+ y2milestone ("Nynorsk not translated, using Bokmål");
+ Language::WfmSetGivenLanguage ("nb_NO");
+ }
+ else
+ Language::WfmSetLanguage ();
+ }
+
+ if (ret == `language) {
+ // Display newly translated dialog.
+ Wizard::SetFocusToNextButton();
+ return true;
+ }
+
+ if (ret == `next) {
+ Keyboard::Set (keyboard);
+
+ // Language has been set already.
+ // On first run store users decision as default.
+ y2milestone("Resetting to default language");
+ Language::SetDefault();
+
+ // only one is installed in firstboot
+ Language::languages = language;
+
+ Timezone::SetTimezoneForLanguage (language);
+
+ // Bugzilla #354133
+ y2milestone ("Adjusting package and text locale to %1", language);
+ Pkg::SetPackageLocale (language);
+ Pkg::SetTextLocale (language);
+
+ y2milestone ("Language: '%1', system encoding '%2'", language, WFM::GetEncoding());
+
+ // install language dependent packages now
+ // Language::PackagesModified () does not work here as _on_entry variables are not set
+ if (language != Language::ReadSysconfigLanguage ())
+ {
+ if (!Language::PackagesInit ([language]))
+ {
+ // error message
+ Report::Error (_("There is not enough space to install all additional packages."));
+ }
+ else
+ {
+ Language::PackagesCommit ();
+ }
+ }
+
+ Language::Save ();
+ Keyboard::Save (true);
+ Timezone::Save ();
+ Console::Save ();
+ }
+
+ return false;
+ }
+
+ while (true) {
+ ret = UI::UserInput();
+ y2milestone ("UserInput() returned %1", ret);
+
+ if (ret == `back) {
+ break;
+
+ } else if (ret == `abort && Popup::ConfirmAbort (`painless)) {
+ Wizard::RestoreNextButton();
+ ret = `abort;
+ break;
+
+ } else if (ret == `keyboard) {
+ Keyboard::user_decision = true;
+
+ }
+ else if (ret == `next || ret == `language)
+ {
+ language = (string) UI::QueryWidget (`id (`language), `Value);
+ keyboard = (string) UI::QueryWidget (`id (`keyboard), `Value);
+
+ if (ret == `next && !Language::CheckIncompleteTranslation (language))
+ {
+ continue;
+ }
+
+ if (SetLanguageIfChanged (ret))
+ {
+ ret = `again;
+ break;
+ }
+
+ // kbd must be restarted after YaST finishes (#303808)
+ SCR::Execute (.target.bash, sformat ("touch %1/firstboot_kbd_restart", Directory::vardir));
+ // save X11 keyboard layout at the end:
+ SCR::Execute (.target.bash, sformat ("touch %1/firstboot_x11_save", Directory::vardir));
+
+ if (ret == `next) break;
+ }
+ }
+
+ return (symbol) ret;
+}
Modified: trunk/firstboot/yast2-firstboot.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/firstboot/yast2-firstboot.spec.in?rev=58083&r1=58082&r2=58083&view=diff
==============================================================================
--- trunk/firstboot/yast2-firstboot.spec.in (original)
+++ trunk/firstboot/yast2-firstboot.spec.in Thu Jul 16 14:01:16 2009
@@ -12,7 +12,9 @@
# yast2/NeworkDevices -> yast2/NetworkInterfaces
Requires: yast2 >= 2.16.23
-Requires: yast2-bootloader yast2-country
+Requires: yast2-bootloader
+# Language::PackagesCommit
+Requires: yast2-country >= 2.18.11
# Installation startup scripts
Requires: yast2-installation
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org