Implement pulse mode progress bar.
[guestfs-browser.git] / window.ml
index dd4f5ad..47b9f80 100644 (file)
--- a/window.ml
+++ b/window.ml
@@ -116,8 +116,11 @@ 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)
+  if position = 0L && total = 1L then
+    ws.progress_bar#pulse ()
+  else
+    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