Add progress bar.
[guestfs-browser.git] / window.ml
index b15c690..c4e17b0 100644 (file)
--- a/window.ml
+++ b/window.ml
@@ -124,6 +124,10 @@ let throbber_busy ws () =
 let throbber_idle ws () =
   ws.throbber#set_pixbuf ws.throbber_static
 
+let progress ws (position, total) =
+  ws.progress_bar#set_fraction
+    (Int64.to_float position /. Int64.to_float total)
+
 (* This is called in the main thread whenever a command fails in the
  * slave thread.  The command queue has been cleared before this is
  * called, so our job here is to reset the main window, and if
@@ -158,7 +162,7 @@ let rec open_main_window () =
   let view = make_filetree ~packing:(vbox#pack ~expand:true ~fill:true) () in
 
   (* Status bar and progress bar. *)
-  let hbox = GPack.hbox ~packing:vbox#pack () in
+  let hbox = GPack.hbox ~spacing:4 ~packing:vbox#pack () in
   let progress_bar = GRange.progress_bar ~packing:hbox#pack () in
   let statusbar = GMisc.statusbar ~packing:(hbox#pack ~expand:true) () in
   let statusbar_context = statusbar#new_context ~name:"Standard" in