Hook up ConnectionManager tool button.
Fix preferences when applying config with no daemon.
This commit is contained in:
parent
e03401e3aa
commit
40e1376bc4
|
@ -341,17 +341,19 @@ class Preferences(component.Component):
|
|||
self.gtkui_config[key] = new_gtkui_config[key]
|
||||
|
||||
# Core
|
||||
config_to_set = {}
|
||||
for key in new_core_config.keys():
|
||||
# The values do not match so this needs to be updated
|
||||
if self.core_config[key] != new_core_config[key]:
|
||||
config_to_set[key] = new_core_config[key]
|
||||
if client.get_core_uri() != None:
|
||||
# Only do this if we're connected to a daemon
|
||||
config_to_set = {}
|
||||
for key in new_core_config.keys():
|
||||
# The values do not match so this needs to be updated
|
||||
if self.core_config[key] != new_core_config[key]:
|
||||
config_to_set[key] = new_core_config[key]
|
||||
|
||||
# Set each changed config value in the core
|
||||
client.set_config(config_to_set)
|
||||
# Set each changed config value in the core
|
||||
client.set_config(config_to_set)
|
||||
|
||||
# Update the configuration
|
||||
self.core_config.update(config_to_set)
|
||||
# Update the configuration
|
||||
self.core_config.update(config_to_set)
|
||||
|
||||
# Re-show the dialog to make sure everything has been updated
|
||||
self.show()
|
||||
|
|
|
@ -52,9 +52,9 @@ class ToolBar(component.Component):
|
|||
"on_toolbutton_pause_clicked": self.on_toolbutton_pause_clicked,
|
||||
"on_toolbutton_resume_clicked": self.on_toolbutton_resume_clicked,
|
||||
"on_toolbutton_preferences_clicked": \
|
||||
self.on_toolbutton_preferences_clicked,
|
||||
"on_toolbutton_plugins_clicked": \
|
||||
self.on_toolbutton_plugins_clicked,
|
||||
self.on_toolbutton_preferences_clicked,
|
||||
"on_toolbutton_connectionmanager_clicked": \
|
||||
self.on_toolbutton_connectionmanager_clicked
|
||||
})
|
||||
|
||||
def add_toolbutton(self, callback, label=None, image=None, stock=None,
|
||||
|
@ -123,7 +123,7 @@ class ToolBar(component.Component):
|
|||
# Use the menubar's callbacks
|
||||
component.get("MenuBar").on_menuitem_preferences_activate(data)
|
||||
|
||||
def on_toolbutton_plugins_clicked(self, data):
|
||||
log.debug("on_toolbutton_plugins_clicked")
|
||||
def on_toolbutton_connectionmanager_clicked(self, data):
|
||||
log.debug("on_toolbutton_connectionmanager_clicked")
|
||||
# Use the menubar's callbacks
|
||||
component.get("MenuBar").on_menuitem_preferences_activate(data)
|
||||
component.get("MenuBar").on_menuitem_connectionmanager_activate(data)
|
||||
|
|
Loading…
Reference in New Issue