mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 07:03:02 -06:00
s/self.window/self.builder/g
Since 'window' is overloaded, let's not make it worse.
This commit is contained in:
parent
abbdd1743a
commit
bcfbbb2bc7
@ -26,7 +26,7 @@ class vmmAbout(vmmGObjectUI):
|
||||
def __init__(self):
|
||||
vmmGObjectUI.__init__(self, "vmm-about.ui", "vmm-about")
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_about_delete_event": self.close,
|
||||
"on_vmm_about_response": self.close,
|
||||
})
|
||||
|
@ -77,7 +77,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
|
||||
self._dev = None
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_create_cancel_clicked" : self.close,
|
||||
"on_vmm_create_delete_event" : self.close,
|
||||
"on_create_finish_clicked" : self.finish,
|
||||
|
@ -184,7 +184,7 @@ class vmmAsyncJob(vmmGObjectUI):
|
||||
self.bg_thread = asyncJobWorker(callback, args)
|
||||
logging.debug("Creating async job for function cb=%s", callback)
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_async_job_delete_event" : self.delete,
|
||||
"on_async_job_cancel_clicked" : self.cancel,
|
||||
})
|
||||
|
@ -174,7 +174,7 @@ class vmmGObjectUI(vmmGObject):
|
||||
vmmGObject.__init__(self)
|
||||
|
||||
self.windowname = windowname
|
||||
self.window = None
|
||||
self.builder = None
|
||||
self.topwin = None
|
||||
self.uifile = None
|
||||
self.err = None
|
||||
@ -182,9 +182,9 @@ class vmmGObjectUI(vmmGObject):
|
||||
if filename:
|
||||
self.uifile = os.path.join(self.config.get_ui_dir(), filename)
|
||||
|
||||
self.window = Gtk.Builder()
|
||||
self.get_window().set_translation_domain("virt-manager")
|
||||
self.get_window().add_from_string(
|
||||
self.builder = Gtk.Builder()
|
||||
self.builder.set_translation_domain("virt-manager")
|
||||
self.builder.add_from_string(
|
||||
file(self.uifile).read())
|
||||
|
||||
self.topwin = self.widget(self.windowname)
|
||||
@ -192,16 +192,13 @@ class vmmGObjectUI(vmmGObject):
|
||||
|
||||
self.err = virtManager.error.vmmErrorDialog(self.topwin)
|
||||
|
||||
def get_window(self):
|
||||
return self.window
|
||||
|
||||
def widget(self, name):
|
||||
return self.get_window().get_object(name)
|
||||
return self.builder.get_object(name)
|
||||
|
||||
def cleanup(self):
|
||||
self.close()
|
||||
vmmGObject.cleanup(self)
|
||||
self.window = None
|
||||
self.builder = None
|
||||
self.topwin.destroy()
|
||||
self.topwin = None
|
||||
self.uifile = None
|
||||
|
@ -41,7 +41,7 @@ class vmmChooseCD(vmmGObjectUI):
|
||||
self.storage_browser = None
|
||||
self.media_type = disk.device
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_media_toggled": self.media_toggled,
|
||||
"on_fv_iso_location_browse_clicked": self.browse_fv_iso_location,
|
||||
"on_cd_path_changed": self.change_cd_path,
|
||||
|
@ -141,7 +141,7 @@ class vmmCloneVM(vmmGObjectUI):
|
||||
self.change_storage = self.widget("vmm-change-storage")
|
||||
self.change_storage.set_transient_for(self.topwin)
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_clone_delete_event" : self.close,
|
||||
"on_clone_cancel_clicked" : self.close,
|
||||
"on_clone_ok_clicked" : self.finish,
|
||||
|
@ -61,7 +61,7 @@ class vmmConnect(vmmGObjectUI):
|
||||
"vmm-open-connection.ui",
|
||||
"vmm-open-connection")
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_hypervisor_changed": self.hypervisor_changed,
|
||||
"on_connection_changed": self.conn_changed,
|
||||
"on_hostname_combo_changed": self.hostname_combo_changed,
|
||||
|
@ -342,7 +342,7 @@ class VNCViewer(Viewer):
|
||||
|
||||
def _desktop_resize(self, src_ignore, w, h):
|
||||
self.desktop_resolution = (w, h)
|
||||
self.console.get_window().get_object("console-vnc-scroll").queue_resize()
|
||||
self.console.widget("console-vnc-scroll").queue_resize()
|
||||
|
||||
def get_desktop_resolution(self):
|
||||
return self.desktop_resolution
|
||||
@ -535,7 +535,7 @@ class SpiceViewer(Viewer):
|
||||
self.display_channel = channel
|
||||
self.display = SpiceClientGtk.Display.new(self.spice_session,
|
||||
channel_id)
|
||||
self.console.get_window().get_object("console-vnc-viewport").add(self.display)
|
||||
self.console.widget("console-vnc-viewport").add(self.display)
|
||||
self._init_widget()
|
||||
self.console.connected()
|
||||
return
|
||||
@ -596,13 +596,13 @@ class SpiceViewer(Viewer):
|
||||
|
||||
|
||||
class vmmConsolePages(vmmGObjectUI):
|
||||
def __init__(self, vm, window, topwin):
|
||||
def __init__(self, vm, builder, topwin):
|
||||
vmmGObjectUI.__init__(self, None, None)
|
||||
|
||||
self.vm = vm
|
||||
|
||||
self.windowname = "vmm-details"
|
||||
self.window = window
|
||||
self.builder = builder
|
||||
self.topwin = topwin
|
||||
self.err = vmmErrorDialog(self.topwin)
|
||||
|
||||
|
@ -100,7 +100,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
self.config_window = None
|
||||
self.config_window_signals = []
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_newcreate_delete_event" : self.close,
|
||||
|
||||
"on_create_cancel_clicked": self.close,
|
||||
|
@ -77,7 +77,7 @@ class vmmCreateInterface(vmmGObjectUI):
|
||||
|
||||
self.ip_manually_changed = False
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_create_interface_delete_event" : self.close,
|
||||
|
||||
"on_cancel_clicked": self.close,
|
||||
|
@ -42,7 +42,7 @@ class vmmCreateNetwork(vmmGObjectUI):
|
||||
vmmGObjectUI.__init__(self, "vmm-create-net.ui", "vmm-create-net")
|
||||
self.conn = conn
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_create_pages_switch_page" : self.page_changed,
|
||||
"on_create_cancel_clicked" : self.close,
|
||||
"on_vmm_create_delete_event" : self.close,
|
||||
|
@ -43,7 +43,7 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
self._pool = None
|
||||
self._pool_class = Storage.StoragePool
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_pool_forward_clicked" : self.forward,
|
||||
"on_pool_back_clicked" : self.back,
|
||||
"on_pool_cancel_clicked" : self.close,
|
||||
|
@ -47,7 +47,7 @@ class vmmCreateVolume(vmmGObjectUI):
|
||||
self.vol = None
|
||||
self.vol_class = Storage.StoragePool.get_volume_for_pool(parent_pool.get_type())
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_create_vol_delete_event" : self.close,
|
||||
"on_vol_cancel_clicked" : self.close,
|
||||
"on_vol_create_clicked" : self.finish,
|
||||
|
@ -47,7 +47,7 @@ class vmmDeleteDialog(vmmGObjectUI):
|
||||
self.vm = None
|
||||
self.conn = None
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_delete_delete_event" : self.close,
|
||||
"on_delete_cancel_clicked" : self.close,
|
||||
"on_delete_ok_clicked" : self.finish,
|
||||
|
@ -353,7 +353,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.ignoreDetails = False
|
||||
self._cpu_copy_host = False
|
||||
|
||||
self.console = vmmConsolePages(self.vm, self.window, self.topwin)
|
||||
self.console = vmmConsolePages(self.vm, self.builder, self.topwin)
|
||||
|
||||
# Set default window size
|
||||
w, h = self.vm.get_details_window_size()
|
||||
@ -371,7 +371,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.network_traffic_graph = None
|
||||
self.init_graphs()
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_close_details_clicked": self.close,
|
||||
"on_details_menu_close_activate": self.close,
|
||||
"on_vmm_details_delete_event": self.close,
|
||||
|
@ -101,7 +101,7 @@ class vmmHost(vmmGObjectUI):
|
||||
|
||||
self.conn.connect("state-changed", self.conn_state_changed)
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_menu_file_view_manager_activate" : self.view_manager,
|
||||
"on_menu_file_quit_activate" : self.exit_app,
|
||||
"on_menu_file_close_activate": self.close,
|
||||
|
@ -131,7 +131,7 @@ class vmmManager(vmmGObjectUI):
|
||||
self.guestcpucol = None
|
||||
self.hostcpucol = None
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_menu_view_guest_cpu_usage_activate":
|
||||
self.toggle_stats_visible_guest_cpu,
|
||||
"on_menu_view_host_cpu_usage_activate":
|
||||
|
@ -55,7 +55,7 @@ class vmmMigrateDialog(vmmGObjectUI):
|
||||
|
||||
self.destconn_rows = []
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_migrate_delete_event" : self.close,
|
||||
|
||||
"on_migrate_cancel_clicked" : self.close,
|
||||
|
@ -72,7 +72,7 @@ class vmmPreferences(vmmGObjectUI):
|
||||
self.refresh_confirm_unapplied()
|
||||
self.refresh_confirm_delstorage()
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_prefs_system_tray_toggled" : self.change_view_system_tray,
|
||||
"on_prefs_stats_update_interval_changed": self.change_update_interval,
|
||||
"on_prefs_stats_history_length_changed": self.change_history_length,
|
||||
|
@ -56,7 +56,7 @@ class vmmStorageBrowser(vmmGObjectUI):
|
||||
self.rhel6_defaults = True
|
||||
self.local_args = {}
|
||||
|
||||
self.get_window().connect_signals({
|
||||
self.builder.connect_signals({
|
||||
"on_vmm_storage_browse_delete_event" : self.close,
|
||||
"on_browse_cancel_clicked" : self.close,
|
||||
"on_browse_local_clicked" : self.browse_local,
|
||||
|
Loading…
Reference in New Issue
Block a user