filetree_markup.cmi: slave_types.cmi
filetree_markup.cmo: utils.cmi slave_types.cmi filetree_markup.cmi
filetree_markup.cmx: utils.cmx slave_types.cmx filetree_markup.cmi
-main.cmo: window.cmi utils.cmi slave.cmi op_view_file.cmi op_inspection_dialog.cmi op_file_information.cmi op_download_file.cmi op_download_dir_tarball.cmi op_download_dir_find0.cmi op_download_as_reg.cmi op_disk_usage.cmi op_copy_regvalue.cmi op_checksum_file.cmi config.cmi cmdline.cmi
-main.cmx: window.cmx utils.cmx slave.cmx op_view_file.cmx op_inspection_dialog.cmx op_file_information.cmx op_download_file.cmx op_download_dir_tarball.cmx op_download_dir_find0.cmx op_download_as_reg.cmx op_disk_usage.cmx op_copy_regvalue.cmx op_checksum_file.cmx config.cmx cmdline.cmx
+main.cmo: window.cmi utils.cmi slave.cmi op_view_file.cmi op_inspection_dialog.cmi op_file_information.cmi op_download_file.cmi op_download_dir_tarball.cmi op_download_dir_find0.cmi op_download_as_reg.cmi op_disk_usage.cmi op_copy_regvalue.cmi op_checksum_file.cmi menu_open_uri.cmi menu_open_disk.cmi config.cmi cmdline.cmi
+main.cmx: window.cmx utils.cmx slave.cmx op_view_file.cmx op_inspection_dialog.cmx op_file_information.cmx op_download_file.cmx op_download_dir_tarball.cmx op_download_dir_find0.cmx op_download_as_reg.cmx op_disk_usage.cmx op_copy_regvalue.cmx op_checksum_file.cmx menu_open_uri.cmx menu_open_disk.cmx config.cmx cmdline.cmx
+menu_open_disk.cmi: window.cmi
+menu_open_disk.cmo: utils.cmi menu_open_disk.cmi
+menu_open_disk.cmx: utils.cmx menu_open_disk.cmi
+menu_open_uri.cmi: window.cmi
+menu_open_uri.cmo: utils.cmi menu_open_uri.cmi
+menu_open_uri.cmx: utils.cmx menu_open_uri.cmi
op_checksum_file.cmi: filetree.cmi
op_checksum_file.cmo: utils.cmi slave.cmi op_checksum_file.cmi
op_checksum_file.cmx: utils.cmx slave.cmx op_checksum_file.cmi
filetree_markup.mli \
filetree_markup.ml \
main.ml \
+ menu_open_disk.mli \
+ menu_open_disk.ml \
+ menu_open_uri.mli \
+ menu_open_uri.ml \
op_checksum_file.mli \
op_checksum_file.ml \
op_copy_regvalue.mli \
op_file_information.cmo \
op_inspection_dialog.cmo \
op_view_file.cmo \
+ menu_open_uri.cmo \
+ menu_open_disk.cmo \
window.cmo \
main.cmo
~callback:(w#connect_to (Some "xen:///")));
ignore (w#connect_none_signal
~callback:(w#connect_to None));
+ ignore (w#connect_uri_signal
+ ~callback:(Menu_open_uri.open_uri_dialog w));
+ ignore (w#open_disk_signal
+ ~callback:(Menu_open_disk.open_disk_dialog w));
ignore (w#reopen_signal ~callback:w#reopen);
ignore (
w#inspection_signal
--- /dev/null
+(* Guestfs Browser.
+ * Copyright (C) 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
+ * 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 Utils
+
+open Printf
+
+let open_disk_dialog w () =
+ debug "open disk dialog";
+ let title = "Open disk image directly" in
+
+ let d = GWindow.file_chooser_dialog ~action:`OPEN ~title ~modal:true () in
+ d#add_button_stock `CANCEL `CANCEL;
+ d#add_select_button_stock `OPEN `OPEN;
+
+ match d#run () with
+ | `DELETE_EVENT | `CANCEL ->
+ d#destroy ()
+ | `OPEN ->
+ match d#filename with
+ | None -> ()
+ | Some localfile ->
+ d#destroy ();
+
+ (* Open the disk image. *)
+ w#open_disk_images [localfile, None]
--- /dev/null
+(* Guestfs Browser.
+ * Copyright (C) 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
+ * 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.
+ *)
+
+(** Connect -> Open disk image dialog.
+
+ Currently this is limited to opening a single disk. *)
+
+val open_disk_dialog : Window.window -> unit -> unit
--- /dev/null
+(* Guestfs Browser.
+ * Copyright (C) 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
+ * 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 Utils
+
+open Printf
+
+let open_uri_dialog w () =
+ debug "open URI dialog";
+ let title = "Open libvirt URI" in
+
+ let msg = "Note that guestfs-browser needs access to the disk images.
+Therefore remote URIs will usually not work." in
+ let uri = GToolbox.input_string ~title ~text:"qemu:///system" msg in
+
+ match uri with
+ | None -> ()
+ | Some "" -> (* assume default URI *)
+ debug "open URI: connect to NULL";
+ w#connect_to None ()
+ | Some uri ->
+ debug "open URI: connect to non-NULL URI %s" uri;
+ w#connect_to (Some uri) ()
--- /dev/null
+(* Guestfs Browser.
+ * Copyright (C) 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
+ * 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.
+ *)
+
+(** Connect -> Connect to a libvirt URI dialog. *)
+
+val open_uri_dialog : Window.window -> unit -> unit
let connect_xen_signal = new GUtil.signal () in
let connect_none_signal = new GUtil.signal () in
let connect_uri_signal = new GUtil.signal () in
+ let open_disk_signal = new GUtil.signal () in
let reopen_signal = new GUtil.signal () in
let inspection_signal = new GUtil.signal () in
connect_xen_signal#disconnect;
connect_none_signal#disconnect;
connect_uri_signal#disconnect;
+ open_disk_signal#disconnect;
reopen_signal#disconnect;
inspection_signal#disconnect]
method connect_xen_signal = connect_xen_signal#connect ~after
method connect_none_signal = connect_none_signal#connect ~after
method connect_uri_signal = connect_uri_signal#connect ~after
+ method open_disk_signal = open_disk_signal#connect ~after
method reopen_signal = reopen_signal#connect ~after
method inspection_signal = inspection_signal#connect ~after
~callback:connect_none_signal#call);
ignore (connect_menu.connect_uri_item#connect#activate
~callback:connect_uri_signal#call);
+ ignore (connect_menu.open_disk_item#connect#activate
+ ~callback:open_disk_signal#call);
ignore (connect_menu.reopen_item#connect#activate
~callback:reopen_signal#call);
ignore (guest_menu.guest_inspection_item#connect#activate
self#when_opened_common name data
(* When a set of disk images is selected by the user. *)
- method private open_disk_images images =
+ method open_disk_images images =
match images with
| [] -> ()
| images ->
method after : 'a
method disconnect : GtkSignal.id -> unit
- (** Signals that can be emitted by window. *)
+ (** Signals that can be emitted by window menu items. *)
method connect_kvm_signal : callback:(unit -> unit) -> GtkSignal.id
method connect_xen_signal : callback:(unit -> unit) -> GtkSignal.id
method connect_none_signal : callback:(unit -> unit) -> GtkSignal.id
method connect_uri_signal : callback:(unit -> unit) -> GtkSignal.id
+ method open_disk_signal : callback:(unit -> unit) -> GtkSignal.id
method reopen_signal : callback:(unit -> unit) -> GtkSignal.id
method inspection_signal : callback:(unit -> unit) -> GtkSignal.id
method connect_to : string option -> unit -> unit
(** Connect to the given libvirt URI. *)
+ method open_disk_images : (string * string option) list -> unit
+ (** Open disk image(s) directly. The second part of each pair
+ is the optional disk format. *)
+
method reopen : unit -> unit
(** Reopen the libguestfs handle and current guest. *)