From be5a0b3dc5edd627ab7ca4e9c1e9bc212ac8f339 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 27 Feb 2012 12:06:24 +0000 Subject: [PATCH] Catch glade object issue when re-enabling Autoadd Found an additional glade object from the previous instance of Autoadd calling cb_get_config resulting in an exceptions.AttributeError. This workaround simply checks that get_widget is not None. --- deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py index 907af6f19..6803755d2 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py @@ -407,7 +407,6 @@ class GtkUI(GtkPluginBase): ) self.on_show_prefs() - def disable(self): component.get("Preferences").remove_page("AutoAdd") component.get("PluginManager").deregister_hook( @@ -511,7 +510,8 @@ class GtkUI(GtkPluginBase): watchdir_id, watchdir['enabled'], watchdir.get('owner', 'localclient'), watchdir['path'] ]) - # Disable the remove and edit buttons, because nothing in the store is selected - self.glade.get_widget('remove_button').set_sensitive(False) - self.glade.get_widget('edit_button').set_sensitive(False) - + # Workaround for cached glade signal appearing when re-enabling plugin in same session + if self.glade.get_widget('edit_button'): + # Disable the remove and edit buttons, because nothing in the store is selected + self.glade.get_widget('remove_button').set_sensitive(False) + self.glade.get_widget('edit_button').set_sensitive(False)