From d7dd5180cf1e74905a4aec311064f334a08c9a9f Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 7 Mar 2008 01:13:45 +0000 Subject: [PATCH] Add 'page' argument to show() to allow opening the Preferences dialog to a specific page. --- deluge/ui/gtkui/preferences.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 11ba1d675..d21c260bb 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -164,7 +164,14 @@ class Preferences(component.Component): def _on_get_listen_port(self, port): self.active_port = port - def show(self): + def show(self, page=None): + """Page should be the string in the left list.. ie, 'Network' or 'Bandwidth'""" + if page != None: + for (index, string) in self.liststore: + if page == string: + self.notebook.set_current_page(index) + break + # Update the preferences dialog to reflect current config settings self.core_config = {} client.get_config(self._on_get_config)