Author: jsuchome Date: Fri May 13 10:02:04 2011 New Revision: 63988 URL: http://svn.opensuse.org/viewcvs/yast?rev=63988&view=rev Log: - better UI for locale related settings (fate#311734) - 2.17.39 Modified: branches/SuSE-Code-11-SP2-Branch/product-creator/VERSION branches/SuSE-Code-11-SP2-Branch/product-creator/package/yast2-product-creator.changes branches/SuSE-Code-11-SP2-Branch/product-creator/src/Kiwi.ycp branches/SuSE-Code-11-SP2-Branch/product-creator/src/kiwi_dialogs.ycp branches/SuSE-Code-11-SP2-Branch/product-creator/yast2-product-creator.spec.in Modified: branches/SuSE-Code-11-SP2-Branch/product-creator/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/product-creator/VERSION?rev=63988&r1=63987&r2=63988&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/product-creator/VERSION (original) +++ branches/SuSE-Code-11-SP2-Branch/product-creator/VERSION Fri May 13 10:02:04 2011 @@ -1 +1 @@ -2.17.38.2 +2.17.39 Modified: branches/SuSE-Code-11-SP2-Branch/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/product-creator/package/yast2-product-creator.changes?rev=63988&r1=63987&r2=63988&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/product-creator/package/yast2-product-creator.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/product-creator/package/yast2-product-creator.changes Fri May 13 10:02:04 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Apr 26 10:50:33 CEST 2011 - jsuchome@suse.cz + +- better UI for locale related settings (fate#311734) +- 2.17.39 + +------------------------------------------------------------------- Fri Mar 11 15:09:41 CET 2011 - jsuchome@suse.cz - allow live iso creation only for x86/x86_64 (bnc#678145) Modified: branches/SuSE-Code-11-SP2-Branch/product-creator/src/Kiwi.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/product-creator/src/Kiwi.ycp?rev=63988&r1=63987&r2=63988&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/product-creator/src/Kiwi.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/product-creator/src/Kiwi.ycp Fri May 13 10:02:04 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: branches/SuSE-Code-11-SP2-Branch/product-creator/src/kiwi_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/product-creator/src/kiwi_dialogs.ycp?rev=63988&r1=63987&r2=63988&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/product-creator/src/kiwi_dialogs.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/product-creator/src/kiwi_dialogs.ycp Fri May 13 10:02:04 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) { @@ -1945,10 +2013,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) @@ -1957,20 +2027,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: branches/SuSE-Code-11-SP2-Branch/product-creator/yast2-product-creator.spec.in URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/product-creator/yast2-product-creator.spec.in?rev=63988&r1=63987&r2=63988&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/product-creator/yast2-product-creator.spec.in (original) +++ branches/SuSE-Code-11-SP2-Branch/product-creator/yast2-product-creator.spec.in Fri May 13 10:02:04 2011 @@ -5,7 +5,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