X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=slave.ml;h=f72a5aa159b99824842ba419bc1db53831f9c977;hb=refs%2Ftags%2F0.1.7;hp=e605a21e96a8644a3bee7c4298162d4da6cae31e;hpb=4fa4ca7430421c477e7f813819a8a70279de0a65;p=guestfs-browser.git diff --git a/slave.ml b/slave.ml index e605a21..f72a5aa 100644 --- a/slave.ml +++ b/slave.ml @@ -1,5 +1,5 @@ (* Guestfs Browser. - * Copyright (C) 2010 Red Hat Inc. + * Copyright (C) 2010-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,6 @@ open ExtList open ExtString -open CamomileLibrary -open Default.Camomile open Utils @@ -34,6 +32,8 @@ module D = Libvirt.Domain module G = Guestfs module M = Mutex module Q = Queue +module UTF8 = CamomileLibraryDefault.Camomile.UTF8 + type 'a callback = 'a -> unit @@ -488,11 +488,19 @@ and open_disk_images images cb = (* 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) + ignore ( + g#set_event_callback ( + fun g event handle buf array -> + if event == G.EVENT_PROGRESS && Array.length array >= 4 then ( + let proc_nr = array.(0) + and serial = array.(1) + and position = array.(2) + and total = array.(3) in + debug "progress callback proc_nr=%Ld serial=%Ld posn=%Ld total=%Ld" + proc_nr serial position total; + GtkThread.async !progress_hook (position, total) + ) + ) [ G.EVENT_PROGRESS ] ); List.iter (