Enable throbber animation.
[guestfs-browser.git] / main.ml
diff --git a/main.ml b/main.ml
index 9a72113..93e2a3a 100644 (file)
--- a/main.ml
+++ b/main.ml
@@ -20,8 +20,6 @@ open Printf
 
 open Utils
 
-module G = Guestfs
-
 (* Main. *)
 let () =
   let cli_request = Cmdline.command_line () in
@@ -31,23 +29,19 @@ let () =
    *)
   if verbose () then (
     debug "%s %s" Config.package Config.version;
-    let v = fst (Libvirt.get_version ()) in
-    debug "libvirt %d.%d.%d"
-      (v / 1_000_000) ((v / 1_000) mod 1_000) (v mod 1_000);
-    let g = G.create () in
-    let v = G.version g in
-    debug "libguestfs %Ld.%Ld.%Ld%s"
-      v.G.major v.G.minor v.G.release v.G.extra;
-    G.close g;
+    debug "libguestfs %s" (libguestfs_version_string ());
+    debug "libvirt %s" (libvirt_version_string ());
   );
 
-  let ds = Window.open_main_window () in
-  Slave.set_failure_hook (Window.failure ds);
-  Slave.set_busy_hook ds.Window.throbber_busy;
-  Slave.set_idle_hook ds.Window.throbber_idle;
+  let w = new Window.window in
+  Slave.set_failure_hook w#failure;
+  Slave.set_busy_hook w#throbber_busy;
+  Slave.set_idle_hook w#throbber_idle;
+  Slave.set_status_hook w#set_statusbar;
+  Slave.set_progress_hook w#progress;
 
   (* What did the user request on the command line? *)
-  Window.run_cli_request ds cli_request;
+  w#run_cli_request cli_request;
 
   (* Run the main display thread.  When this returns, the application
    * has been closed.