From 5effdd4cd49b8897bb3ff0911717bc57b5e32a62 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sun, 2 May 2010 18:32:21 +0100 Subject: [PATCH] store listen_ports and outgoing_ports as tuples for the config set, fixes #1242 --- deluge/ui/gtkui/preferences.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index b772a396d..d22468679 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -557,19 +557,17 @@ class Preferences(component.Component): self.glade.get_widget("chk_add_paused").get_active() ## Network tab ## - listen_ports = [] - listen_ports.append( - self.glade.get_widget("spin_port_min").get_value_as_int()) - listen_ports.append( - self.glade.get_widget("spin_port_max").get_value_as_int()) + listen_ports = ( + self.glade.get_widget("spin_port_min").get_value_as_int(), + self.glade.get_widget("spin_port_max").get_value_as_int() + ) new_core_config["listen_ports"] = listen_ports new_core_config["random_port"] = \ self.glade.get_widget("chk_random_port").get_active() - outgoing_ports = [] - outgoing_ports.append( - self.glade.get_widget("spin_outgoing_port_min").get_value_as_int()) - outgoing_ports.append( - self.glade.get_widget("spin_outgoing_port_max").get_value_as_int()) + outgoing_ports = ( + self.glade.get_widget("spin_outgoing_port_min").get_value_as_int(), + self.glade.get_widget("spin_outgoing_port_max").get_value_as_int() + ) new_core_config["outgoing_ports"] = outgoing_ports new_core_config["random_outgoing_ports"] = \ 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]: config_to_set[key] = new_core_config[key] - # Set each changed config value in the core - client.core.set_config(config_to_set) - client.force_call(True) - # Update the configuration - self.core_config.update(config_to_set) + if config_to_set: + # Set each changed config value in the core + client.core.set_config(config_to_set) + client.force_call(True) + # Update the configuration + self.core_config.update(config_to_set) if hide: self.hide()