+
+(* The disk usage dialog. *)
+and disk_usage_dialog tree path0 () =
+ let model, _, _, dev, _,_ = tree in
+ let row = model#get_iter (fst path0) in
+ let dir = get_pathname tree row in
+
+ (* We can't use GWindow.message_dialog since lablgtk2 doesn't expose
+ * the label field. It wouldn't help very much anyway.
+ *)
+ let title = "Calculating disk usage ..." in
+ let dlg = GWindow.dialog ~title ~modal:true () in
+ let text =
+ sprintf "Calculating disk usage of %s ... This may take a moment." dir in
+ let label = GMisc.label ~text ~packing:dlg#vbox#pack () in
+ dlg#add_button "Stop" `STOP;
+ dlg#add_button "Close" `DELETE_EVENT;
+ let close_button, stop_button =
+ match dlg#action_area#children with
+ | c::s::_ -> c, s
+ | _ -> assert false in
+ close_button#misc#set_sensitive false;
+
+ let callback = function
+ | `STOP -> debug "STOP response" (* XXX NOT IMPL XXX *)
+ | `DELETE_EVENT -> debug "DELETE_EVENT response"; dlg#destroy ()
+ in
+ ignore (dlg#connect#response ~callback);
+
+ Slave.disk_usage dev dir (
+ fun kbytes -> (* Called when operation has finished. *)
+ dlg#set_title "Disk usage";
+ label#set_text (sprintf "Disk usage of %s: %Ld KB" dir kbytes);
+ close_button#misc#set_sensitive true;
+ stop_button#misc#set_sensitive false
+ );
+
+ (* NB. We cannot use dlg#run. See:
+ * http://www.math.nagoya-u.ac.jp/~garrigue/soft/olabl/lablgtk-list/600.txt
+ * Therefore this function just exits back to the ordinary main loop.
+ *)
+ dlg#show ()
+
+and export_archive_dialog tree path0 () =
+ (* XXX NOT IMPL XXX *)
+ ()
+
+and export_checksums_dialog tree path0 () =
+ (* XXX NOT IMPL XXX *)
+ ()
+
+and export_list_dialog tree path0 () =
+ (* XXX NOT IMPL XXX *)
+ ()
+
+and do_export_dialog tree path0 t =
+ (* XXX NOT IMPL XXX *)
+ ()