[yast-commit] r63985 - in /trunk/product-creator: VERSION package/yast2-product-creator.changes src/Kiwi.ycp src/kiwi_dialogs.ycp yast2-product-creator.spec.in
Author: jsuchome Date: Fri May 13 10:00:55 2011 New Revision: 63985 URL: http://svn.opensuse.org/viewcvs/yast?rev=63985&view=rev Log: - better UI for locale related settings (fate#311734) - 2.21.2 Modified: trunk/product-creator/VERSION trunk/product-creator/package/yast2-product-creator.changes trunk/product-creator/src/Kiwi.ycp trunk/product-creator/src/kiwi_dialogs.ycp trunk/product-creator/yast2-product-creator.spec.in Modified: trunk/product-creator/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/VERSION?rev=63985&r1=63984&r2=63985&view=diff ============================================================================== --- trunk/product-creator/VERSION (original) +++ trunk/product-creator/VERSION Fri May 13 10:00:55 2011 @@ -1 +1 @@ -2.21.1 +2.21.2 Modified: trunk/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-product-creator.changes?rev=63985&r1=63984&r2=63985&view=diff ============================================================================== --- trunk/product-creator/package/yast2-product-creator.changes (original) +++ trunk/product-creator/package/yast2-product-creator.changes Fri May 13 10:00:55 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri May 13 09:59:46 CEST 2011 - jsuchome@suse.cz + +- better UI for locale related settings (fate#311734) +- 2.21.2 + +------------------------------------------------------------------- Fri Mar 11 15:07:59 CET 2011 - jsuchome@suse.cz - allow live iso creation only for x86/x86_64 (bnc#678145) Modified: trunk/product-creator/src/Kiwi.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/Kiwi.ycp?rev=63985&r1=63984&r2=63985&view=diff ============================================================================== --- trunk/product-creator/src/Kiwi.ycp (original) +++ trunk/product-creator/src/Kiwi.ycp Fri May 13 10:00:55 2011 @@ -79,6 +79,12 @@ string stderr_file = "image_creator.stderr"; string logs_directory = "/tmp"; + // all available locales + global list<string> all_locales = []; + + // all available time zones + global list<string> all_timezones = []; + /** * crypt given user password with current encryption algorithm */ Modified: trunk/product-creator/src/kiwi_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.ycp?rev=63985&r1=63984&r2=63985&view=diff ============================================================================== --- trunk/product-creator/src/kiwi_dialogs.ycp (original) +++ trunk/product-creator/src/kiwi_dialogs.ycp Fri May 13 10:00:55 2011 @@ -14,6 +14,7 @@ import "CWMTab"; import "Directory"; import "FileUtils"; + import "Keyboard"; import "Kiwi"; import "Label"; import "Message"; @@ -516,6 +517,73 @@ } /** + * initialize the list value of "locale" combo box + */ + define void InitLocaleCombo (string id) { + + string lang = KiwiConfig["preferences",0,id,0,content_key]:""; + list items = []; + + if (Kiwi::all_locales == []) + { + map out = (map) SCR::Execute (.target.bash_output, "/usr/bin/locale -a"); + Kiwi::all_locales = filter (string s, splitstring (out["stdout"]:"", "\n"), { + return s != ""; + }); + } + foreach (string line, Kiwi::all_locales, { + string code = splitstring (line, ".@")[0]:line; + items = add (items, `item (`id (code), code, lang == code)); + }); + + UI::ChangeWidget (`id (id), `Items, items); + } + + /** + * initialize the list value of "keytable" combo box + */ + define void InitKeytableCombo (string id) { + + string kb = KiwiConfig["preferences",0,id,0,content_key]:""; + + list items = []; + boolean kb_present = false; + + foreach (string name, string yast, Keyboard::keymap2yast (), { + items = add (items, `item (`id (name), name, kb == name)); + if (kb == name) kb_present = true; + }); + if (!kb_present) + { + items = add (items, `item (`id (kb), kb, true)); + } + UI::ChangeWidget (`id (id), `Items, items); + } + + /** + * initialize the list value of "timezone" combo box + */ + define void InitTimezoneCombo (string id) { + + string tz = KiwiConfig["preferences",0,id,0,content_key]:""; + + if (Kiwi::all_timezones == []) + { + map out = (map) SCR::Execute (.target.bash_output, + "grep -v '#' /usr/share/zoneinfo/zone.tab | cut -f 3 | sort", $["LANG":"C"]); + Kiwi::all_timezones = filter (string t, splitstring (out["stdout"]:"", "\n"), { + return t != ""; + }); + } + + list items = maplist (string zone, Kiwi::all_timezones, { + return `item (`id (zone), zone, tz == zone); + }); + + UI::ChangeWidget (`id (id), `Items, items); + } + + /** * initialize the string value of "preferences" related widget */ define void InitPreferences (string id) { @@ -1942,10 +2010,12 @@ "no_help" : true, ], "locale" : $[ - "widget" : `textentry, + "widget" : `combobox, + "opt" : [ `hstretch, `notify ], + "items" : [], // textentry label "label" : _("&Locale"), - "init" : InitPreferences, + "init" : InitLocaleCombo, "store" : StorePreferences, "handle" : HandlePreferences, // help text for locale (heading) @@ -1954,20 +2024,23 @@ _("<p>The value of <b>Locale</b> (e.g. <tt>en_US</tt>) defines the contents of the RC_LANG variable in <t>/etc/sysconfig/language</tt>.</p>"), ], "keytable" : $[ - "widget" : `textentry, + "widget" : `combobox, + "opt" : [ `hstretch, `notify, `editable ], // textentry label "label" : _("&Keyboard layout"), - "init" : InitPreferences, + "init" : InitKeytableCombo, "store" : StorePreferences, "handle" : HandlePreferences, // help text for keytable "help" : _("<p><b>Keyboard layout</b> specifies the name of the console keymap to use. The value corresponds to a map file in <tt>/usr/share/kbd/keymaps</tt>.</p>"), ], "timezone" : $[ - "widget" : `textentry, + "widget" : `combobox, + "opt" : [ `hstretch, `notify ], + "items" : [], // textentry label "label" : _("&Time zone"), - "init" : InitPreferences, + "init" : InitTimezoneCombo, "store" : StorePreferences, "handle" : HandlePreferences, // help text for timezone Modified: trunk/product-creator/yast2-product-creator.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/yast2-product-creator.spec.in?rev=63985&r1=63984&r2=63985&view=diff ============================================================================== --- trunk/product-creator/yast2-product-creator.spec.in (original) +++ trunk/product-creator/yast2-product-creator.spec.in Fri May 13 10:00:55 2011 @@ -7,7 +7,7 @@ PreReq: %fillup_prereq -Requires: autoyast2-installation yast2-security +Requires: autoyast2-installation yast2-security yast2-country # ag_pattern handling gzipped files Requires: yast2-add-on-creator >= 2.17.1 -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn2.opensuse.org