[virt-tools-list] [virt-manager PATCH] s/gconf/gsettings/
Guido Günther
agx at sigxcpu.org
Sun Sep 28 11:37:16 UTC 2014
GConf got replaced by GSettings but some methods kept the old name
---
virt-manager | 12 ++++++------
virtManager/baseclass.py | 14 +++++++-------
virtManager/config.py | 8 ++++----
virtManager/console.py | 14 +++++++-------
virtManager/create.py | 2 +-
virtManager/domain.py | 8 ++++----
virtManager/engine.py | 4 ++--
virtManager/error.py | 4 ++--
virtManager/manager.py | 18 +++++++++---------
virtManager/systray.py | 2 +-
10 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/virt-manager b/virt-manager
index 534c4ab..65a5983 100755
--- a/virt-manager
+++ b/virt-manager
@@ -168,12 +168,12 @@ def main():
# Ignore SIGHUP, otherwise a serial console closing drops the whole app
signal.signal(signal.SIGHUP, signal.SIG_IGN)
- # The never ending fork+gconf/gsettings problems now require
- # us to import Gtk _after_ the fork. This creates a funny race,
- # since we need to parse the command line arguments to know if
- # we need to fork, but need to import Gtk before cli processing
- # so it can handle --g-fatal-args. We strip out our flags first
- # and pass the left overs to gtk
+ # The never ending fork+gsettings problems now require us to
+ # import Gtk _after_ the fork. This creates a funny race, since we
+ # need to parse the command line arguments to know if we need to
+ # fork, but need to import Gtk before cli processing so it can
+ # handle --g-fatal-args. We strip out our flags first and pass the
+ # left overs to gtk
origargv = sys.argv
try:
sys.argv = origargv[:1] + leftovers[:]
diff --git a/virtManager/baseclass.py b/virtManager/baseclass.py
index 2ed7442..9a44e6d 100644
--- a/virtManager/baseclass.py
+++ b/virtManager/baseclass.py
@@ -54,7 +54,7 @@ class vmmGObject(GObject.GObject):
self._gobject_handles = []
self._gobject_timeouts = []
- self._gconf_handles = []
+ self._gsettings_handles = []
self._signal_id_map = {}
self._next_signal_id = 1
@@ -69,8 +69,8 @@ class vmmGObject(GObject.GObject):
# Do any cleanup required to drop reference counts so object is
# actually reaped by python. Usually means unregistering callbacks
try:
- for h in self._gconf_handles[:]:
- self.remove_gconf_handle(h)
+ for h in self._gsettings_handles[:]:
+ self.remove_gsettings_handle(h)
for h in self._gobject_handles[:]:
if GObject.GObject.handler_is_connected(self, h):
self.disconnect(h)
@@ -97,11 +97,11 @@ class vmmGObject(GObject.GObject):
self._gobject_handles.remove(handle)
return ret
- def add_gconf_handle(self, handle):
- self._gconf_handles.append(handle)
- def remove_gconf_handle(self, handle):
+ def add_gsettings_handle(self, handle):
+ self._gsettings_handles.append(handle)
+ def remove_gsettings_handle(self, handle):
self.config.remove_notifier(handle)
- self._gconf_handles.remove(handle)
+ self._gsettings_handles.remove(handle)
def add_gobject_timeout(self, handle):
self._gobject_timeouts.append(handle)
diff --git a/virtManager/config.py b/virtManager/config.py
index a409392..9258313 100644
--- a/virtManager/config.py
+++ b/virtManager/config.py
@@ -188,7 +188,7 @@ class vmmConfig(object):
except:
return False
- # General app wide helpers (gconf agnostic)
+ # General app wide helpers (gsettings agnostic)
def get_appname(self):
return self.appname
@@ -493,9 +493,9 @@ class vmmConfig(object):
# URL/Media path history
- def _url_add_helper(self, gconf_path, url):
+ def _url_add_helper(self, gsettings_path, url):
maxlength = 10
- urls = self.conf.get(gconf_path)
+ urls = self.conf.get(gsettings_path)
if urls is None:
urls = []
@@ -504,7 +504,7 @@ class vmmConfig(object):
urls.insert(0, url)
if len(urls) > maxlength:
del urls[len(urls) - 1]
- self.conf.set(gconf_path, urls)
+ self.conf.set(gsettings_path, urls)
def add_media_url(self, url):
self._url_add_helper("/urls/urls", url)
diff --git a/virtManager/console.py b/virtManager/console.py
index 874eed6..67bfe10 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -199,7 +199,7 @@ class VNCViewer(Viewer):
try:
keys = [int(k) for k in keys.split(',')]
except:
- logging.debug("Error in grab_keys configuration in GConf",
+ logging.debug("Error in grab_keys configuration in Gsettings",
exc_info=True)
return
@@ -359,7 +359,7 @@ class SpiceViewer(Viewer):
try:
keys = [int(k) for k in keys.split(',')]
except:
- logging.debug("Error in grab_keys configuration in GConf",
+ logging.debug("Error in grab_keys configuration in Gsettings",
exc_info=True)
return
@@ -632,21 +632,21 @@ class vmmConsolePages(vmmGObjectUI):
# or it changes will be overwritten
self.refresh_scaling_from_settings()
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.vm.on_console_scaling_changed(
self.refresh_scaling_from_settings))
self.refresh_resizeguest_from_settings()
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.vm.on_console_resizeguest_changed(
self.refresh_resizeguest_from_settings))
scroll = self.widget("console-gfx-scroll")
scroll.connect("size-allocate", self.scroll_size_allocate)
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_console_accels_changed(self.set_enable_accel))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_keys_combination_changed(self.grab_keys_changed))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_keyboard_grab_default_changed(
self.keyboard_grab_default_changed))
diff --git a/virtManager/create.py b/virtManager/create.py
index f15763c..8bb8914 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -1652,7 +1652,7 @@ class vmmCreate(vmmGObjectUI):
self.addstorage.widget("config-storage-size").set_value(storage_size)
# Validation passed, store the install path (if there is one) in
- # gconf
+ # gsettings
self.get_config_local_media(store_media=True)
self.get_config_url_info(store_media=True)
return True
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 585f64b..c7b7455 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -371,16 +371,16 @@ class vmmDomain(vmmLibvirtObject):
self.snapshots_supported()
# Hook up listeners that need to be cleaned up
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_cpu_poll_changed(
self.toggle_sample_cpu_stats))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_net_poll_changed(
self.toggle_sample_network_traffic))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_disk_poll_changed(
self.toggle_sample_disk_io))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_memory_poll_changed(
self.toggle_sample_mem_stats))
diff --git a/virtManager/engine.py b/virtManager/engine.py
index b32f7f1..4a9799d 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -113,9 +113,9 @@ class vmmEngine(vmmGObject):
self.init_systray()
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_update_interval_changed(self.reschedule_timer))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_view_system_tray_changed(self.system_tray_changed))
self.schedule_timer()
diff --git a/virtManager/error.py b/virtManager/error.py
index 7307999..42f0a5a 100644
--- a/virtManager/error.py
+++ b/virtManager/error.py
@@ -215,7 +215,7 @@ class vmmErrorDialog(vmmGObject):
@dialog_type: Maps to FileChooserDialog 'action'
@confirm_func: Optional callback function if file is chosen.
@browse_reason: The vmmConfig.CONFIG_DIR* reason we are browsing.
- If set, this will override the 'folder' parameter with the gconf
+ If set, this will override the 'folder' parameter with the gsettings
value, and store the user chosen path.
"""
import os
@@ -280,7 +280,7 @@ class vmmErrorDialog(vmmGObject):
ret = fcdialog.get_filename()
fcdialog.destroy()
- # Store the chosen directory in gconf if necessary
+ # Store the chosen directory in gsettings if necessary
if ret and browse_reason and not ret.startswith("/dev"):
self.config.set_default_directory(
os.path.dirname(ret), browse_reason)
diff --git a/virtManager/manager.py b/virtManager/manager.py
index bc733ca..8f362bf 100644
--- a/virtManager/manager.py
+++ b/virtManager/manager.py
@@ -250,34 +250,34 @@ class vmmManager(vmmGObjectUI):
################
def init_stats(self):
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_vmlist_guest_cpu_usage_visible_changed(
self.toggle_guest_cpu_usage_visible_widget))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_vmlist_host_cpu_usage_visible_changed(
self.toggle_host_cpu_usage_visible_widget))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_vmlist_memory_usage_visible_changed(
self.toggle_memory_usage_visible_widget))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_vmlist_disk_io_visible_changed(
self.toggle_disk_io_visible_widget))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_vmlist_network_traffic_visible_changed(
self.toggle_network_traffic_visible_widget))
# Register callbacks with the global stats enable/disable values
# that disable the associated vmlist widgets if reporting is disabled
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_cpu_poll_changed(
self.enable_polling, COL_GUEST_CPU))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_disk_poll_changed(
self.enable_polling, COL_DISK))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_net_poll_changed(
self.enable_polling, COL_NETWORK))
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_stats_enable_memory_poll_changed(
self.enable_polling, COL_MEM))
diff --git a/virtManager/systray.py b/virtManager/systray.py
index 01cdc64..52b66bf 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -75,7 +75,7 @@ class vmmSystray(vmmGObject):
self.init_systray_menu()
- self.add_gconf_handle(
+ self.add_gsettings_handle(
self.config.on_view_system_tray_changed(self.show_systray))
self.show_systray()
--
2.1.0
More information about the virt-tools-list
mailing list