(* Guestfs Browser. * Copyright (C) 2010 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) open Printf open Utils (* Main. *) let () = let cli_request = Cmdline.command_line () in (* If we're in verbose mode, print some debug information which * could be useful in bug reports. *) if verbose () then ( debug "%s %s" Config.package Config.version; debug "libguestfs %s" (libguestfs_version_string ()); debug "libvirt %s" (libvirt_version_string ()); ); let ws = Window.open_main_window () in Slave.set_failure_hook (Window.failure ws); Slave.set_busy_hook (Window.throbber_busy ws); Slave.set_idle_hook (Window.throbber_idle ws); Slave.set_status_hook (Window.set_statusbar ws); Slave.set_progress_hook (Window.progress ws); (* What did the user request on the command line? *) Window.run_cli_request ws cli_request; (* Run the main display thread. When this returns, the application * has been closed. *) GtkThread.main (); Slave.exit_thread ()