From: <man...@us...> - 2012-06-20 20:40:50
|
Revision: 12652 http://openmsx.svn.sourceforge.net/openmsx/?rev=12652&view=rev Author: manuelbi Date: 2012-06-20 20:40:44 +0000 (Wed, 20 Jun 2012) Log Message: ----------- Present a sorted list of extensions and machines (and select the current machine). Modified Paths: -------------- openmsx/trunk/share/scripts/osd_menu.tcl Modified: openmsx/trunk/share/scripts/osd_menu.tcl =================================================================== --- openmsx/trunk/share/scripts/osd_menu.tcl 2012-06-19 20:32:20 UTC (rev 12651) +++ openmsx/trunk/share/scripts/osd_menu.tcl 2012-06-20 20:40:44 UTC (rev 12652) @@ -534,7 +534,7 @@ post-spacing 6 selectable false } { text "Change Machine..." - actions { A { osd_menu::menu_create [osd_menu::menu_create_load_machine_list] }}} + actions { A { osd_menu::menu_create [osd_menu::menu_create_load_machine_list]; catch { osd_menu::select_menu_item [machine_info config_name]} }}} { text "Extensions..." actions { A { osd_menu::menu_create $osd_menu::extensions_menu }}} { text "Connectors..." @@ -691,9 +691,17 @@ foreach i $items { lappend presentation [utils::get_machine_display_name_by_config_name ${i}] } - lappend menu_def presentation $presentation - return [prepare_menu_list $items 10 $menu_def] + set items_sorted [list] + set presentation_sorted [list] + + foreach i [lsort -dictionary -indices $presentation] { + lappend presentation_sorted [lindex $presentation $i] + lappend items_sorted [lindex $items $i] + } + + lappend menu_def presentation $presentation_sorted + return [prepare_menu_list $items_sorted 10 $menu_def] } proc menu_load_machine_exec_replace {item} { @@ -734,9 +742,18 @@ foreach i $items { lappend presentation [utils::get_extension_display_name_by_config_name $i] } - lappend menu_def presentation $presentation - return [prepare_menu_list $items 10 $menu_def] + set items_sorted [list] + set presentation_sorted [list] + + foreach i [lsort -dictionary -indices $presentation] { + lappend presentation_sorted [lindex $presentation $i] + lappend items_sorted [lindex $items $i] + } + + lappend menu_def presentation $presentation_sorted + + return [prepare_menu_list $items_sorted 10 $menu_def] } proc menu_add_extension_exec {item} { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |