From c4b62fc1fce97970b9ffdde7b62aac898e7ab962 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 18 Jul 2008 20:53:16 +0000 Subject: [PATCH] Preferences plugin fixes --- deluge/ui/gtkui/preferences.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 0ca3ddaac..7f76c28e5 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -107,7 +107,9 @@ class Preferences(component.Component): def add_page(self, name, widget): """Add a another page to the notebook""" # Create a header and scrolled window for the preferences tab - widget.unparent() + parent = widget.get_parent() + if parent: + parent.remove(widget) vbox = gtk.VBox() label = gtk.Label() label.set_use_markup(True) @@ -660,7 +662,10 @@ class Preferences(component.Component): def on_selection_changed(self, treeselection): # Show the correct notebook page based on what row is selected. (model, row) = treeselection.get_selected() - self.notebook.set_current_page(model.get_value(row, 0)) + try: + self.notebook.set_current_page(model.get_value(row, 0)) + except TypeError: + pass def on_test_port_clicked(self, data): log.debug("on_test_port_clicked")