s/gconf/gsettings/
GConf got replaced by GSettings but some methods kept the old name
This commit is contained in:
parent
a41e2c6f5a
commit
1726505fd6
12
virt-manager
12
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[:]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue