let failure_hook = ref (fun _ -> ())
let busy_hook = ref (fun _ -> ())
let idle_hook = ref (fun _ -> ())
+let progress_hook = ref (fun _ -> ())
let set_failure_hook cb = failure_hook := cb
let set_busy_hook cb = busy_hook := cb
let set_idle_hook cb = idle_hook := cb
+let set_progress_hook cb = progress_hook := cb
(* Execute a function, while holding a mutex. If the function
* fails, ensure we release the mutex before rethrowing the
*)
(* g#set_verbose (verbose ());*)
+ (* Attach progress bar callback. *)
+ g#set_progress_callback (
+ fun proc_nr serial position total ->
+ debug "progress callback proc_nr=%d serial=%d posn=%Ld total=%Ld"
+ proc_nr serial position total;
+ GtkThread.async !progress_hook (position, total)
+ );
+
List.iter (
function
| filename, None ->