From 0b590bfcdac8347183ebd478657bc9e9679dd2b8 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 27 Jun 2008 05:37:38 +0000 Subject: [PATCH] Fix #303 make port spinners insensitive if random ports is enabled --- deluge/ui/gtkui/preferences.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 15a3ea72b..b47f9067b 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -311,6 +311,11 @@ class Preferences(component.Component): widget.set_value(value) elif modifier == "text": widget.set_text(value) + + for key in core_widgets.keys(): + widget = self.glade.get_widget(key) + # Update the toggle status if necessary + self.on_toggle(widget) else: core_widget_list = [ "download_path_button", @@ -589,7 +594,10 @@ class Preferences(component.Component): def on_toggle(self, widget): """Handles widget sensitivity based on radio/check button values.""" - value = widget.get_active() + try: + value = widget.get_active() + except: + return # Disable the focus dialog checkbox if the show dialog isn't active. if widget == self.glade.get_widget("chk_show_dialog"):