mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
fix problem with never ending gtk.main()
This commit is contained in:
parent
05764da2c6
commit
ddadec4a7e
1
AUTHORS
1
AUTHORS
@ -15,6 +15,7 @@ done by:
|
|||||||
Further patches have been submitted by:
|
Further patches have been submitted by:
|
||||||
|
|
||||||
William Sheehan <william-dot-sheehan-at-openinterface-dot-com>
|
William Sheehan <william-dot-sheehan-at-openinterface-dot-com>
|
||||||
|
Karel Zak <kzak-at-redhat-dot-com>
|
||||||
|
|
||||||
<...send a patch & get your name here...>
|
<...send a patch & get your name here...>
|
||||||
|
|
||||||
|
@ -136,6 +136,11 @@ class vmmConsole(gobject.GObject):
|
|||||||
logging.error("Failure when disconnecting from VNC server")
|
logging.error("Failure when disconnecting from VNC server")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def is_visible(self):
|
||||||
|
if self.window.get_widget("vmm-console").flags() & gtk.VISIBLE:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def control_vm_run(self, src):
|
def control_vm_run(self, src):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -309,6 +309,11 @@ class vmmCreate(gobject.GObject):
|
|||||||
self.topwin.hide()
|
self.topwin.hide()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def is_visible(self):
|
||||||
|
if self.topwin.flags() & gtk.VISIBLE:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def finish(self, ignore=None):
|
def finish(self, ignore=None):
|
||||||
# first things first, are we trying to create a fully virt guest?
|
# first things first, are we trying to create a fully virt guest?
|
||||||
if self.get_config_method() == VM_FULLY_VIRT:
|
if self.get_config_method() == VM_FULLY_VIRT:
|
||||||
|
@ -148,6 +148,11 @@ class vmmDetails(gobject.GObject):
|
|||||||
self.window.get_widget("vmm-details").hide()
|
self.window.get_widget("vmm-details").hide()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def is_visible(self):
|
||||||
|
if self.window.get_widget("vmm-details").flags() & gtk.VISIBLE:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def hw_selected(self, src=None):
|
def hw_selected(self, src=None):
|
||||||
vmlist = self.window.get_widget("hw-list")
|
vmlist = self.window.get_widget("hw-list")
|
||||||
selection = vmlist.get_selection()
|
selection = vmlist.get_selection()
|
||||||
|
@ -116,6 +116,9 @@ class vmmEngine:
|
|||||||
self.timer = gobject.timeout_add(interval, self.tick)
|
self.timer = gobject.timeout_add(interval, self.tick)
|
||||||
|
|
||||||
def tick(self):
|
def tick(self):
|
||||||
|
if self.windowConnect == None and gtk.main_level() > 0 and self.count_visible_windows() == 0:
|
||||||
|
gtk.main_quit()
|
||||||
|
|
||||||
for uri in self.connections.keys():
|
for uri in self.connections.keys():
|
||||||
try:
|
try:
|
||||||
self.connections[uri]["connection"].tick()
|
self.connections[uri]["connection"].tick()
|
||||||
@ -125,6 +128,18 @@ class vmmEngine:
|
|||||||
logging.error(("Could not refresh connection %s" % (uri)) + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
|
logging.error(("Could not refresh connection %s" % (uri)) + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def count_visible_windows(self):
|
||||||
|
ct = 0
|
||||||
|
for conn in self.connections.values():
|
||||||
|
for name in [ "windowDetails", "windowConsole", "windowSerialConsole" ]:
|
||||||
|
for window in conn[name].values():
|
||||||
|
ct += window.is_visible()
|
||||||
|
if conn["windowManager"]:
|
||||||
|
ct += conn["windowManager"].is_visible()
|
||||||
|
if self.windowCreate:
|
||||||
|
ct += self.windowCreate.is_visible()
|
||||||
|
return ct
|
||||||
|
|
||||||
def change_timer_interval(self,ignore1,ignore2,ignore3,ignore4):
|
def change_timer_interval(self,ignore1,ignore2,ignore3,ignore4):
|
||||||
gobject.source_remove(self.timer)
|
gobject.source_remove(self.timer)
|
||||||
self.schedule_timer()
|
self.schedule_timer()
|
||||||
|
@ -153,6 +153,11 @@ class vmmManager(gobject.GObject):
|
|||||||
win.hide()
|
win.hide()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def is_visible(self):
|
||||||
|
if self.window.get_widget("vmm-manager").flags() & gtk.VISIBLE:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def exit_app(self, src=None, src2=None):
|
def exit_app(self, src=None, src2=None):
|
||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ class vmmSerialConsole:
|
|||||||
self.window.hide()
|
self.window.hide()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def is_visible(self):
|
||||||
|
if self.window.flags() & gtk.VISIBLE:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def opentty(self):
|
def opentty(self):
|
||||||
if self.ptyio != None:
|
if self.ptyio != None:
|
||||||
self.closetty()
|
self.closetty()
|
||||||
|
Loading…
Reference in New Issue
Block a user