Author: andar

Revision: 5985

Log:
        Fix #1085 only use ints for specific options to prevent unhandled 
exception

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-11-29 07:38:29 UTC (rev 5984)
+++ branches/1.2_RC/ChangeLog   2009-11-29 21:32:56 UTC (rev 5985)
@@ -6,6 +6,9 @@
        * Attempt to register as the default magnet uri handler in GNOME on 
startup
        * Properly show 100.00% and reduce number of progress bar updates 
during a torrent creation
        * Fix crash in Windows when creating a torrent
+
+==== Label ====
+       * Fix #1085 only use ints for specific options to prevent unhandled 
exception
        
 === Deluge 1.2.0_rc4 (24 November 2009) ===
 ==== Core ====

Modified: branches/1.2_RC/deluge/plugins/label/label/gtkui/sidebar_menu.py
===================================================================
--- branches/1.2_RC/deluge/plugins/label/label/gtkui/sidebar_menu.py    
2009-11-29 07:38:29 UTC (rev 5984)
+++ branches/1.2_RC/deluge/plugins/label/label/gtkui/sidebar_menu.py    
2009-11-29 21:32:56 UTC (rev 5985)
@@ -156,7 +156,8 @@
 
 
 class OptionsDialog(object):
-    spin_ids = ["max_download_speed", "max_upload_speed", "max_upload_slots", 
"max_connections", "stop_ratio"]
+    spin_ids = ["max_download_speed", "max_upload_speed", "stop_ratio"]
+    spin_int_ids = ["max_upload_slots", "max_connections"]
     chk_ids = ["apply_max", "apply_queue", "stop_at_ratio", "apply_queue", 
"remove_at_ratio",
         "apply_move_completed", "move_completed", "is_auto_managed", 
"auto_add"]
 
@@ -197,7 +198,7 @@
     def load_options(self, options):
         log.debug(options.keys())
 
-        for id in self.spin_ids:
+        for id in self.spin_ids + self.spin_int_ids:
             self.glade.get_widget(id).set_value(options[id])
         for id in self.chk_ids:
             self.glade.get_widget(id).set_active(bool(options[id]))
@@ -221,6 +222,8 @@
 
         for id in self.spin_ids:
             options[id] = self.glade.get_widget(id).get_value()
+        for id in self.spin_int_ids:
+            options[id] = self.glade.get_widget(id).get_value_as_int()
         for id in self.chk_ids:
             options[id] = self.glade.get_widget(id).get_active()
 

Modified: trunk/deluge/plugins/label/label/gtkui/sidebar_menu.py
===================================================================
--- trunk/deluge/plugins/label/label/gtkui/sidebar_menu.py      2009-11-29 
07:38:29 UTC (rev 5984)
+++ trunk/deluge/plugins/label/label/gtkui/sidebar_menu.py      2009-11-29 
21:32:56 UTC (rev 5985)
@@ -156,7 +156,8 @@
 
 
 class OptionsDialog(object):
-    spin_ids = ["max_download_speed", "max_upload_speed", "max_upload_slots", 
"max_connections", "stop_ratio"]
+    spin_ids = ["max_download_speed", "max_upload_speed", "stop_ratio"]
+    spin_int_ids = ["max_upload_slots", "max_connections"]
     chk_ids = ["apply_max", "apply_queue", "stop_at_ratio", "apply_queue", 
"remove_at_ratio",
         "apply_move_completed", "move_completed", "is_auto_managed", 
"auto_add"]
 
@@ -197,7 +198,7 @@
     def load_options(self, options):
         log.debug(options.keys())
 
-        for id in self.spin_ids:
+        for id in self.spin_ids + self.spin_int_ids:
             self.glade.get_widget(id).set_value(options[id])
         for id in self.chk_ids:
             self.glade.get_widget(id).set_active(bool(options[id]))
@@ -221,6 +222,8 @@
 
         for id in self.spin_ids:
             options[id] = self.glade.get_widget(id).get_value()
+        for id in self.spin_int_ids:
+            options[id] = self.glade.get_widget(id).get_value_as_int()
         for id in self.chk_ids:
             options[id] = self.glade.get_widget(id).get_active()
 


--

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