[supervision] sort AC and session in alphabetic order

This commit is contained in:
Gautier Hattenberger
2013-09-06 16:47:14 +02:00
parent d2e05e51f0
commit bc3955993f
2 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -79,7 +79,8 @@ let new_ac_id = fun () ->
let parse_conf_xml = fun vbox ->
let strings = ref [] in
Hashtbl.iter (fun name _ac -> strings := name :: !strings) Utils.aircrafts;
Gtk_tools.combo ("" :: !strings) vbox
let ordered = List.sort String.compare ("" :: !strings) in
Gtk_tools.combo ordered vbox
let editor =
try Sys.getenv "EDITOR" with _ -> (
+5 -4
View File
@@ -195,10 +195,11 @@ let supervision = fun ?file gui log (ac_combo : Gtk_tools.combo) (target_combo :
Gtk_tools.add_to_combo session_combo "Simulation";
Gtk_tools.add_to_combo session_combo "Replay";
Gtk_tools.add_to_combo session_combo Gtk_tools.combo_separator;
Hashtbl.iter
(fun name _session ->
Gtk_tools.add_to_combo session_combo name)
sessions in
let strings = ref [] in
Hashtbl.iter (fun name _session -> strings := name :: !strings) sessions;
let ordered = List.sort String.compare !strings in
List.iter (fun name -> Gtk_tools.add_to_combo session_combo name) ordered
in
register_custom_sessions ();
Gtk_tools.select_in_combo session_combo "Simulation";