From 58953ba2d9c97370d9e788f7107f4c412070543c Mon Sep 17 00:00:00 2001 From: "Hugh O. Brock" Date: Tue, 8 Aug 2006 17:02:15 -0400 Subject: [PATCH] create wizard now actually appears when you push the new button. Still doesn't do anything. --- src/virt-manager.glade | 1509 ++++++++++++++---------------------- src/virtManager/engine.py | 10 + src/virtManager/manager.py | 12 +- 3 files changed, 587 insertions(+), 944 deletions(-) diff --git a/src/virt-manager.glade b/src/virt-manager.glade index 1b5d7441..a598e7d7 100644 --- a/src/virt-manager.glade +++ b/src/virt-manager.glade @@ -5603,17 +5603,11 @@ TB - 500 - 350 True - True - True Create a new virtual system GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT + GTK_WIN_POS_NONE False - 500 - 350 True False True @@ -5631,7 +5625,8 @@ TB 0 - + + 2 True True True @@ -5642,7 +5637,6 @@ TB - 1 True False 0 @@ -5660,22 +5654,30 @@ TB 0 - + True - <span weight="heavy" size="xx-large">Creating a new virtual system </span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Creating a new virtual system </span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -6082,22 +6084,30 @@ TB 0 - + True - <span weight="heavy" size="xx-large">Naming your virtual system </span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Naming your virtual system </span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -6333,22 +6343,30 @@ TB 0 - + True - <span weight="heavy" size="xx-large">Choosing a virtualization method</span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Choosing a virtualization method</span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -6403,74 +6421,13 @@ TB 0 - + True - 2 - 2 False - 10 - 0 + 0 - - True - <b>Paravirtualized:</b> -Lightweight method of virtualizing machines. Limist operating system choices because the OS must be specially modified to support paravirtualization. Better performance than fully virtualized systems. - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - <b>Fully virtualized:</b> -Involves hardware simulation, allowing for a greater range of operating systems (does not require OS modification). Slower than paravirtualized systems. - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - + True 0.5 0 @@ -6482,10 +6439,10 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 - + True True - + _Paravirtualized: True GTK_RELIEF_NORMAL True @@ -6496,49 +6453,92 @@ Involves hardware simulation, allowing for a greater range of operating systems - 0 - 1 - 0 - 1 - - fill + 0 + True + True - + + True + Lightweight method of virtualizing machines. Limits operating system choices because the OS must be specially modified to support paravirtualization. Better performance than fully virtualized systems. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 21 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + True 0.5 0 1 0 - 0 + 5 0 0 0 - + True True - + _Fully Virtualized: True GTK_RELIEF_NORMAL True False False True - virt-method-pv - 0 - 1 - 1 - 2 - fill - fill + 0 + True + True + + + + + + True + Involves hardware simulation, allowing for a greater range of operating systems (does not require OS modification). Slower than paravirtualized systems. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 21 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False @@ -6607,22 +6607,30 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 - + True - <span weight="heavy" size="xx-large">Locating installation media</span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Locating installation media</span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -6945,22 +6953,44 @@ Involves hardware simulation, allowing for a greater range of operating systems - + True - Please insert disc 1 of the installation media for the desired operating system now. - False - False - GTK_JUSTIFY_LEFT - True - False - 0 + 0.5 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + 1 + 1 + 0 + 0 + 20 + 0 + + + + True + True + False + + + + True + Please insert disc 1 of the installation media for the desired operating system now. + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + 1 @@ -7037,22 +7067,30 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 - + True - <span weight="heavy" size="xx-large">Locating installation media</span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Locating installation media</span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -7104,7 +7142,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 0 25 - 0 + 15 @@ -7112,7 +7150,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 7 4 False - 0 + 2 0 @@ -7482,6 +7520,34 @@ Involves hardware simulation, allowing for a greater range of operating systems + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 3 + 4 + fill + + + @@ -7536,21 +7602,15 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 - + True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 + True + False True - <span weight="heavy" size="xx-large">Assigning storage space</span> + <span weight="heavy" size="xx-large" foreground="#FFF">Assigning storage space</span> False True GTK_JUSTIFY_FILL @@ -7615,7 +7675,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 0 25 - 0 + 15 @@ -7623,7 +7683,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 7 5 False - 0 + 2 0 @@ -7976,6 +8036,62 @@ Involves hardware simulation, allowing for a greater range of operating systems + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 3 + 4 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 6 + 7 + fill + + + @@ -7995,7 +8111,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 1 0 0 - 25 + 20 0 @@ -8010,7 +8126,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 4 gtk-info 0.5 - 0.5 + 0 0 0 @@ -8091,590 +8207,6 @@ Involves hardware simulation, allowing for a greater range of operating systems - - - 1 - True - False - 0 - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - <span weight="heavy" size="xx-large">Allocate memory and CPU</span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - 0 - False - True - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 5 - 3 - 12 - 0 - - - - True - False - 0 - - - - True - What is the maximum amount of memory this VM should be able to use? - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - GTK_POS_TOP - 1 - GTK_UPDATE_CONTINUOUS - False - 256 0 1024 0 0 0 - - - - 0 - True - True - - - - - - - - - - True - <b>Memory</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 15 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - 3 - True - 2 - 2 - False - 3 - 3 - - - - True - Current usage: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Total memory on host machine: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - 200 MB - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - 2 GB - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - 2 - 2 - False - 5 - 2 - - - - True - How many <b>virtual</b> CPUs should this sytem have? - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 1 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 1 32 1 10 10 - - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - <b>Physical</b> host CPU count: - False - True - GTK_JUSTIFY_RIGHT - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - - - - - True - <b>CPUs</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 15 - False - False - - - - - - True - False - 0 - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 13 - 0 - - - - True - gtk-info - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 3 - 0 - - - - True - <b>Tip:</b> For best performance, the number of virtual CPUs should be less than the number of physical CPUs on the host system. - False - True - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - False - True - - - - - - True - step5 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - 1 @@ -8695,22 +8227,30 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 - + True - <span weight="heavy" size="xx-large">Allocate memory and CPU</span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Allocate memory and CPU</span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -8724,7 +8264,7 @@ Involves hardware simulation, allowing for a greater range of operating systems True - 9 + 11 5 False 0 @@ -8807,98 +8347,13 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 1 - 5 - 6 + 6 + 7 fill - - - True - False - 0 - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 13 - 0 - - - - True - gtk-info - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 3 - 0 - - - - True - <b>Tip:</b> For best performance, the number of virtual CPUs should be less than the number of physical CPUs on the host system. - False - True - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - 0 - False - False - - - - - 1 - 5 - 8 - 9 - fill - - - True @@ -8976,8 +8431,8 @@ Involves hardware simulation, allowing for a greater range of operating systems 3 4 - 7 - 8 + 8 + 9 fill @@ -9060,8 +8515,8 @@ Involves hardware simulation, allowing for a greater range of operating systems 1 3 - 6 - 7 + 7 + 8 fill @@ -9088,6 +8543,43 @@ Involves hardware simulation, allowing for a greater range of operating systems 1 3 + 8 + 9 + fill + + + + + + + True + 0 + 0.5 + 0 + 1 + 0 + 0 + 0 + 33 + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 1 1 32 1 10 10 + + + + + + 3 + 4 7 8 fill @@ -9095,6 +8587,148 @@ Involves hardware simulation, allowing for a greater range of operating systems + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 9 + 10 + fill + + + + + + + True + False + 0 + + + + True + 0.5 + 0.10000000149 + 1 + 0.10000000149 + 0 + 0 + 5 + 0 + + + + True + gtk-info + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 3 + 0 + + + + True + <small><b>Tip:</b> For best performance, the number of virtual CPUs should be less than the number of physical CPUs on the host system.</small> + False + True + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + False + False + + + + + 1 + 5 + 10 + 11 + fill + fill + + + True @@ -9128,43 +8762,7 @@ Involves hardware simulation, allowing for a greater range of operating systems 3 30 fill - - - - - - True - 0 - 0.5 - 0 - 1 - 0 - 0 - 0 - 33 - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 1 32 1 10 10 - - - - - - 3 - 4 - 6 - 7 - fill - + fill @@ -9224,22 +8822,30 @@ Involves hardware simulation, allowing for a greater range of operating systems 0 - + True - <span weight="heavy" size="xx-large">Finished creating a new virtual system</span> - False - True - GTK_JUSTIFY_FILL - False - False - 0 - 0 - 5 - 6 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + False + + + + True + <span weight="heavy" size="xx-large" foreground="#FFF">Finished creating a new virtual system</span> + False + True + GTK_JUSTIFY_FILL + False + False + 0 + 0 + 5 + 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -9334,7 +8940,28 @@ You'll now be able to view and work with $SYSTEM_NAME in the virtual machine man 10 - + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + diff --git a/src/virtManager/engine.py b/src/virtManager/engine.py index f93307f5..c6291428 100644 --- a/src/virtManager/engine.py +++ b/src/virtManager/engine.py @@ -29,12 +29,14 @@ from virtManager.manager import vmmManager from virtManager.details import vmmDetails from virtManager.console import vmmConsole from virtManager.asyncjob import vmmAsyncJob +from virtManager.create import vmmCreate class vmmEngine: def __init__(self, config): self.windowConnect = None self.windowPreferences = None self.windowAbout = None + self.windowCreate = None self.connections = {} self.timer = None @@ -120,6 +122,8 @@ class vmmEngine: self.show_manager(uri) def _do_show_details(self, src, uri, uuid): self.show_details(uri, uuid) + def _do_show_create(self, src): + self.show_create() def _do_show_console(self, src, uri, uuid): self.show_console(uri, uuid) def _do_save_domain(self, src, uri, uuid): @@ -182,11 +186,17 @@ class vmmEngine: manager.connect("action-show-console", self._do_show_console) manager.connect("action-show-details", self._do_show_details) manager.connect("action-show-preferences", self._do_show_preferences) + manager.connect("action-show-create", self._do_show_create) manager.connect("action-show-about", self._do_show_about) manager.connect("action-show-connect", self._do_show_connect) self.connections[uri]["windowManager"] = manager self.connections[uri]["windowManager"].show() + def show_create(self): + if self.windowCreate == None: + self.windowCreate = vmmCreate(self.get_config()) + self.windowCreate.show() + def get_connection(self, uri, readOnly=True): if not(self.connections.has_key(uri)): self.connections[uri] = { diff --git a/src/virtManager/manager.py b/src/virtManager/manager.py index e983bc44..22e0d9d5 100644 --- a/src/virtManager/manager.py +++ b/src/virtManager/manager.py @@ -45,7 +45,8 @@ class vmmManager(gobject.GObject): gobject.TYPE_NONE, []), "action-show-preferences": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, []), - } + "action-show-create": (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, []),} def __init__(self, config, connection): self.__gobject_init__() self.window = gtk.glade.XML(config.get_glade_file(), "vmm-manager") @@ -73,8 +74,8 @@ class vmmManager(gobject.GObject): self.window.get_widget("menu_view_network_traffic").set_active(self.config.is_vmlist_network_traffic_visible()) - self.window.get_widget("menu_file_new").set_sensitive(False) - self.window.get_widget("vm-new").set_sensitive(False) + self.window.get_widget("menu_file_new").set_sensitive(True) + self.window.get_widget("vm-new").set_sensitive(True) self.window.get_widget("vm-view").set_sensitive(False) self.window.get_widget("vm-view").set_active(0) @@ -105,12 +106,14 @@ class vmmManager(gobject.GObject): "on_vm_manager_delete_event": self.close, "on_menu_file_open_connection_activate": self.open_connection, + "on_menu_file_new_activate": self.show_vm_create, "on_menu_file_quit_activate": self.exit_app, "on_menu_file_close_activate": self.close, "on_menu_restore_saved_activate": self.restore_saved, "on_vmm_close_clicked": self.close, "on_vm_details_clicked": self.show_vm_details, "on_vm_open_clicked": self.open_vm_console, + "on_vm_new_clicked": self.show_vm_create, "on_menu_edit_details_activate": self.show_vm_details, "on_vm_list_row_activated": self.open_vm_console, @@ -237,6 +240,9 @@ class vmmManager(gobject.GObject): def show_vm_details(self,ignore): self.emit("action-show-details", self.connection.get_uri(), self.current_vm()) + def show_vm_create(self,ignore): + self.emit("action-show-create") + def open_vm_console(self,ignore,ignore2=None,ignore3=None): self.emit("action-show-console", self.connection.get_uri(), self.current_vm())