Module: deluge
Branch: master
Commit: 5effdd4cd49b8897bb3ff0911717bc57b5e32a62

Author: Damien Churchill <[email protected]>
Date:   Sun May  2 18:32:21 2010 +0100

store listen_ports and outgoing_ports as tuples for the config set, fixes #1242

---

 deluge/ui/gtkui/preferences.py |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index b772a39..d224686 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()

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to