(* interface lockers *)
let lock_world _ =
main#buttonsToolbar#misc#set_sensitive false;
+ develList#buttonsHbox#misc#set_sensitive false;
source_view#set_editable false
in
let unlock_world _ =
main#buttonsToolbar#misc#set_sensitive true;
+ develList#buttonsHbox#misc#set_sensitive true;
source_view#set_editable true
in
let locker f =
| [[name;_]] -> MatitamakeLib.development_for_name name
| _ -> assert false
in
+ let refresh () =
+ while Glib.Main.pending () do
+ ignore(Glib.Main.iteration false);
+ done
+ in
connect_button develList#newButton
(fun () ->
next_devel_must_contain <- None;
newDevel#toplevel#misc#show());
connect_button develList#deleteButton
- (fun () ->
+ (locker (fun () ->
(match get_devel_selected () with
| None -> ()
- | Some d -> MatitamakeLib.destroy_development d);
- refresh_devels_win ());
- let refresh () =
- while Glib.Main.pending () do
- ignore(Glib.Main.iteration false);
- done
- in
+ | Some d -> MatitamakeLib.destroy_development_in_bg refresh d);
+ refresh_devels_win ()));
connect_button develList#buildButton
- (fun () ->
+ (locker (fun () ->
match get_devel_selected () with
| None -> ()
| Some d ->
let build = locker
(fun () -> MatitamakeLib.build_development_in_bg refresh d)
in
- ignore(build ()));
+ ignore(build ())));
connect_button develList#cleanButton
- (fun () ->
+ (locker (fun () ->
match get_devel_selected () with
| None -> ()
| Some d ->
let clean = locker
(fun () -> MatitamakeLib.clean_development_in_bg refresh d)
in
- ignore(clean ()));
+ ignore(clean ())));
connect_button develList#closeButton
(fun () -> develList#toplevel#misc#hide());
ignore(develList#toplevel#event#connect#delete
let clean_development_in_bg refresh_cb development =
call_make development "clean" (mk_maker refresh_cb)
-let destroy_development development =
+let destroy_development_aux development clean_development =
let delete_development development =
let unlink file =
try
logger `Warning "This may cause garbage."
end;
delete_development development
+
+let destroy_development development =
+ destroy_development_aux development clean_development
+
+let destroy_development_in_bg refresh development =
+ destroy_development_aux development (clean_development_in_bg refresh)
let root_for_development development = development.root
let name_for_development development = development.name
val list_known_developments: unit -> (string * string ) list
(* cleans the development, forgetting about it *)
val destroy_development: development -> unit
+val destroy_development_in_bg: (unit -> unit) -> development -> unit
(* initiale internal data structures *)
val initialize : unit -> unit
(* gives back the root *)