virt-manager/virtman-install.diff

61 lines
2.4 KiB
Diff

Index: virt-manager-0.2.6/src/virtManager/engine.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/engine.py
+++ virt-manager-0.2.6/src/virtManager/engine.py
@@ -30,7 +30,7 @@ from virtManager.manager import vmmManag
from virtManager.details import vmmDetails
from virtManager.console import vmmConsole
from virtManager.asyncjob import vmmAsyncJob
-from virtManager.create import vmmCreate
+from xen.install.gui import VMCreate as vmmCreate
from virtManager.serialcon import vmmSerialConsole
class vmmEngine:
@@ -38,7 +38,7 @@ class vmmEngine:
self.windowConnect = None
self.windowPreferences = None
self.windowAbout = None
- self.windowCreate = None
+ self.windowCreate = {}
self.connections = {}
self.timer = None
@@ -136,8 +136,7 @@ class vmmEngine:
ct += window.is_visible()
if conn["windowManager"]:
ct += conn["windowManager"].is_visible()
- if self.windowCreate:
- ct += self.windowCreate.is_visible()
+ ct += len(filter(lambda w: w.is_visible(), self.windowCreate.values()))
return ct
def change_timer_interval(self,ignore1,ignore2,ignore3,ignore4):
@@ -245,13 +244,21 @@ class vmmEngine:
self.connections[uri]["windowManager"] = manager
self.connections[uri]["windowManager"].show()
+ def _create_closing(self, src, key):
+ del self.windowCreate[key]
+
def show_create(self, uri):
- if self.windowCreate == None:
- self.windowCreate = vmmCreate(self.get_config(), self.get_connection(uri, False))
- self.windowCreate.connect("action-show-console", self._do_show_console)
- self.windowCreate.connect("action-show-terminal", self._do_show_terminal)
- self.windowCreate.reset_state()
- self.windowCreate.show()
+ key = 0
+ while True:
+ if not self.windowCreate.has_key(key):
+ break
+ key += 1
+ window = vmmCreate(virtman=True, key=key)
+ self.windowCreate[key] = window
+ window.connect("action-show-console", self._do_show_console)
+ window.connect("action-show-terminal", self._do_show_terminal)
+ window.connect("vmmcreate-closing", self._create_closing)
+ window.show()
def get_connection(self, uri, readOnly=True):
if not(self.connections.has_key(uri)):