mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
console: Properly implement cleanup()
This commit is contained in:
parent
a3fd17575c
commit
b76804a8a5
@ -234,7 +234,7 @@ class vmmConfig(object):
|
|||||||
elif func_type == self._PEROBJ_FUNC_GET:
|
elif func_type == self._PEROBJ_FUNC_GET:
|
||||||
ret = pref_func()
|
ret = pref_func()
|
||||||
elif func_type == self._PEROBJ_FUNC_LISTEN:
|
elif func_type == self._PEROBJ_FUNC_LISTEN:
|
||||||
pref_func(value)
|
ret = pref_func(value)
|
||||||
finally:
|
finally:
|
||||||
self.conf_dir = oldconf
|
self.conf_dir = oldconf
|
||||||
|
|
||||||
@ -256,7 +256,8 @@ class vmmConfig(object):
|
|||||||
ret = pref_func()
|
ret = pref_func()
|
||||||
return ret
|
return ret
|
||||||
def listen_pervm(self, uri, uuid, pref_func, cb):
|
def listen_pervm(self, uri, uuid, pref_func, cb):
|
||||||
self._pervm_helper(uri, uuid, pref_func, self._PEROBJ_FUNC_LISTEN, cb)
|
return self._pervm_helper(uri, uuid, pref_func,
|
||||||
|
self._PEROBJ_FUNC_LISTEN, cb)
|
||||||
|
|
||||||
def set_perconn(self, uri, pref_func, value):
|
def set_perconn(self, uri, pref_func, value):
|
||||||
self._perconn_helper(uri, pref_func, self._PEROBJ_FUNC_SET, value)
|
self._perconn_helper(uri, pref_func, self._PEROBJ_FUNC_SET, value)
|
||||||
@ -267,7 +268,8 @@ class vmmConfig(object):
|
|||||||
ret = pref_func()
|
ret = pref_func()
|
||||||
return ret
|
return ret
|
||||||
def listen_perconn(self, uri, pref_func, cb):
|
def listen_perconn(self, uri, pref_func, cb):
|
||||||
self._perconn_helper(uri, pref_func, self._PEROBJ_FUNC_LISTEN, cb)
|
return self._perconn_helper(uri, pref_func,
|
||||||
|
self._PEROBJ_FUNC_LISTEN, cb)
|
||||||
|
|
||||||
def set_perhost(self, uri, pref_func, value):
|
def set_perhost(self, uri, pref_func, value):
|
||||||
self._perhost_helper(uri, pref_func, self._PEROBJ_FUNC_SET, value)
|
self._perhost_helper(uri, pref_func, self._PEROBJ_FUNC_SET, value)
|
||||||
@ -278,7 +280,8 @@ class vmmConfig(object):
|
|||||||
ret = pref_func()
|
ret = pref_func()
|
||||||
return ret
|
return ret
|
||||||
def listen_perhost(self, uri, pref_func, cb):
|
def listen_perhost(self, uri, pref_func, cb):
|
||||||
self._perhost_helper(uri, pref_func, self._PEROBJ_FUNC_LISTEN, cb)
|
return self._perhost_helper(uri, pref_func,
|
||||||
|
self._PEROBJ_FUNC_LISTEN, cb)
|
||||||
|
|
||||||
def reconcile_vm_entries(self, uri, current_vms):
|
def reconcile_vm_entries(self, uri, current_vms):
|
||||||
"""
|
"""
|
||||||
|
@ -502,13 +502,13 @@ class vmmConsolePages(vmmGObjectUI):
|
|||||||
self.desktop_resolution = None
|
self.desktop_resolution = None
|
||||||
|
|
||||||
# Initialize display widget
|
# Initialize display widget
|
||||||
self.scale_type = self.vm.get_console_scaling()
|
self.viewer = None
|
||||||
self.tunnels = None
|
self.tunnels = None
|
||||||
self.viewerRetriesScheduled = 0
|
self.viewerRetriesScheduled = 0
|
||||||
self.viewerRetryDelay = 125
|
self.viewerRetryDelay = 125
|
||||||
self.viewer = None
|
|
||||||
self.viewer_connected = False
|
self.viewer_connected = False
|
||||||
self.viewer_connecting = False
|
self.viewer_connecting = False
|
||||||
|
self.scale_type = self.vm.get_console_scaling()
|
||||||
|
|
||||||
finish_img = gtk.image_new_from_stock(gtk.STOCK_YES,
|
finish_img = gtk.image_new_from_stock(gtk.STOCK_YES,
|
||||||
gtk.ICON_SIZE_BUTTON)
|
gtk.ICON_SIZE_BUTTON)
|
||||||
@ -523,11 +523,13 @@ class vmmConsolePages(vmmGObjectUI):
|
|||||||
# Signals are added by vmmDetails. Don't use signal_autoconnect here
|
# Signals are added by vmmDetails. Don't use signal_autoconnect here
|
||||||
# or it changes will be overwritten
|
# or it changes will be overwritten
|
||||||
# Set console scaling
|
# Set console scaling
|
||||||
self.vm.on_console_scaling_changed(self.refresh_scaling)
|
self.add_gconf_handle(
|
||||||
|
self.vm.on_console_scaling_changed(self.refresh_scaling))
|
||||||
|
|
||||||
scroll = self.window.get_widget("console-vnc-scroll")
|
scroll = self.window.get_widget("console-vnc-scroll")
|
||||||
scroll.connect("size-allocate", self.scroll_size_allocate)
|
scroll.connect("size-allocate", self.scroll_size_allocate)
|
||||||
self.config.on_console_accels_changed(self.set_enable_accel)
|
self.add_gconf_handle(
|
||||||
|
self.config.on_console_accels_changed(self.set_enable_accel))
|
||||||
|
|
||||||
def is_visible(self):
|
def is_visible(self):
|
||||||
if self.topwin.flags() & gtk.VISIBLE:
|
if self.topwin.flags() & gtk.VISIBLE:
|
||||||
@ -537,6 +539,7 @@ class vmmConsolePages(vmmGObjectUI):
|
|||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
vmmGObjectUI.cleanup(self)
|
vmmGObjectUI.cleanup(self)
|
||||||
self.vm = None
|
self.vm = None
|
||||||
|
self.viewer = None
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Initialization helpers #
|
# Initialization helpers #
|
||||||
|
@ -942,8 +942,9 @@ class vmmDomainBase(vmmLibvirtObject):
|
|||||||
return self.config.get_pervm(self.connection.get_uri(), self.uuid,
|
return self.config.get_pervm(self.connection.get_uri(), self.uuid,
|
||||||
self.config.get_console_scaling)
|
self.config.get_console_scaling)
|
||||||
def on_console_scaling_changed(self, cb):
|
def on_console_scaling_changed(self, cb):
|
||||||
self.config.listen_pervm(self.connection.get_uri(), self.uuid,
|
return self.config.listen_pervm(self.connection.get_uri(), self.uuid,
|
||||||
self.config.on_console_scaling_changed, cb)
|
self.config.on_console_scaling_changed,
|
||||||
|
cb)
|
||||||
|
|
||||||
def set_details_window_size(self, w, h):
|
def set_details_window_size(self, w, h):
|
||||||
self.config.set_pervm(self.connection.get_uri(), self.uuid,
|
self.config.set_pervm(self.connection.get_uri(), self.uuid,
|
||||||
|
Loading…
Reference in New Issue
Block a user