store listen_ports and outgoing_ports as tuples for the config set, fixes #1242
This commit is contained in:
parent
c2b4fad389
commit
5effdd4cd4
|
@ -557,19 +557,17 @@ class Preferences(component.Component):
|
||||||
self.glade.get_widget("chk_add_paused").get_active()
|
self.glade.get_widget("chk_add_paused").get_active()
|
||||||
|
|
||||||
## Network tab ##
|
## Network tab ##
|
||||||
listen_ports = []
|
listen_ports = (
|
||||||
listen_ports.append(
|
self.glade.get_widget("spin_port_min").get_value_as_int(),
|
||||||
self.glade.get_widget("spin_port_min").get_value_as_int())
|
self.glade.get_widget("spin_port_max").get_value_as_int()
|
||||||
listen_ports.append(
|
)
|
||||||
self.glade.get_widget("spin_port_max").get_value_as_int())
|
|
||||||
new_core_config["listen_ports"] = listen_ports
|
new_core_config["listen_ports"] = listen_ports
|
||||||
new_core_config["random_port"] = \
|
new_core_config["random_port"] = \
|
||||||
self.glade.get_widget("chk_random_port").get_active()
|
self.glade.get_widget("chk_random_port").get_active()
|
||||||
outgoing_ports = []
|
outgoing_ports = (
|
||||||
outgoing_ports.append(
|
self.glade.get_widget("spin_outgoing_port_min").get_value_as_int(),
|
||||||
self.glade.get_widget("spin_outgoing_port_min").get_value_as_int())
|
self.glade.get_widget("spin_outgoing_port_max").get_value_as_int()
|
||||||
outgoing_ports.append(
|
)
|
||||||
self.glade.get_widget("spin_outgoing_port_max").get_value_as_int())
|
|
||||||
new_core_config["outgoing_ports"] = outgoing_ports
|
new_core_config["outgoing_ports"] = outgoing_ports
|
||||||
new_core_config["random_outgoing_ports"] = \
|
new_core_config["random_outgoing_ports"] = \
|
||||||
self.glade.get_widget("chk_random_outgoing_ports").get_active()
|
self.glade.get_widget("chk_random_outgoing_ports").get_active()
|
||||||
|
@ -722,11 +720,12 @@ class Preferences(component.Component):
|
||||||
if self.core_config[key] != new_core_config[key]:
|
if self.core_config[key] != new_core_config[key]:
|
||||||
config_to_set[key] = new_core_config[key]
|
config_to_set[key] = new_core_config[key]
|
||||||
|
|
||||||
# Set each changed config value in the core
|
if config_to_set:
|
||||||
client.core.set_config(config_to_set)
|
# Set each changed config value in the core
|
||||||
client.force_call(True)
|
client.core.set_config(config_to_set)
|
||||||
# Update the configuration
|
client.force_call(True)
|
||||||
self.core_config.update(config_to_set)
|
# Update the configuration
|
||||||
|
self.core_config.update(config_to_set)
|
||||||
|
|
||||||
if hide:
|
if hide:
|
||||||
self.hide()
|
self.hide()
|
||||||
|
|
Loading…
Reference in New Issue