Author: jsuchome Date: Thu May 15 10:39:26 2008 New Revision: 47548 URL: http://svn.opensuse.org/viewcvs/yast?rev=47548&view=rev Log: - sort keyboard list according to translated items (bnc#390610) - 2.16.25 Modified: trunk/country/VERSION trunk/country/keyboard/src/dialogs.ycp trunk/country/keyboard/src/modules/Keyboard.ycp trunk/country/package/yast2-country.changes Modified: trunk/country/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/VERSION?rev=47548&r1=47547&r2=47548&view=diff ============================================================================== --- trunk/country/VERSION (original) +++ trunk/country/VERSION Thu May 15 10:39:26 2008 @@ -1 +1 @@ -2.16.24 +2.16.25 Modified: trunk/country/keyboard/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/keyboard/src/dialogs.ycp?rev=47548&r1=47547&r2=47548&view=diff ============================================================================== --- trunk/country/keyboard/src/dialogs.ycp (original) +++ trunk/country/keyboard/src/dialogs.ycp Thu May 15 10:39:26 2008 @@ -167,27 +167,12 @@ */ define symbol KeyboardDialog (map args) { - term keyboardsel = `dummy(); string keyboard = ""; - // Create keyboard selection box with the default selection. - // First build a map sorted by translations. - // - list<term> keyboardlist_by_translation = maplist ( - string code, string name, Keyboard::Selection(), ``( - `item (`id(code), name, Keyboard::current_kbd == code) - )); - - keyboardlist_by_translation = sort ( - term a, term b, keyboardlist_by_translation, { - list lsorted = lsort ([a[1]:"", b[1]:""]); - return (lsorted[0]:"" == a[1]:"" && a[1]:"" != b[1]:""); - }); - - keyboardsel = `SelectionBox( `id( `keyboard ), `opt(`notify), + term keyboardsel = `SelectionBox (`id (`keyboard), `opt(`notify), // title for selection box 'keyboard layout' _("&Keyboard Layout"), - keyboardlist_by_translation); + Keyboard::GetKeyboardItems ()); // title for input field to test the keyboard setting // (no more than about 25 characters!) Modified: trunk/country/keyboard/src/modules/Keyboard.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/keyboard/src/modules/Keyboard.ycp?rev=47548&r1=47547&r2=47548&view=diff ============================================================================== --- trunk/country/keyboard/src/modules/Keyboard.ycp (original) +++ trunk/country/keyboard/src/modules/Keyboard.ycp Thu May 15 10:39:26 2008 @@ -1317,6 +1317,19 @@ }); } + /** + * Return item list of keyboard items, sorted according to current language + */ + global define list<term> GetKeyboardItems () { + + list<term> ret = maplist (string code, string name, Selection(), ``( + `item (`id(code), name, current_kbd == code) + )); + return sort (term a, term b, ret, { + list lsorted = lsort ([a[1]:"", b[1]:""]); + return (lsorted[0]:"" == a[1]:"" && a[1]:"" != b[1]:""); + }); + } /** Modified: trunk/country/package/yast2-country.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/package/yast2-country.changes?rev=47548&r1=47547&r2=47548&view=diff ============================================================================== --- trunk/country/package/yast2-country.changes (original) +++ trunk/country/package/yast2-country.changes Thu May 15 10:39:26 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu May 15 10:30:58 CEST 2008 - jsuchome@suse.cz + +- sort keyboard list according to translated items (bnc#390610) +- 2.16.25 + +------------------------------------------------------------------- Tue May 13 10:28:58 CEST 2008 - jsuchome@suse.cz - added Korean keyboard layout (bnc#388057) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org