From 00882ac867612dcac5c393cf2708ca11d6f7f6a7 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 23 Aug 2009 20:46:31 +0000 Subject: [PATCH] Hide the 'Open File' menu option when connected to a remote daemon --- deluge/ui/gtkui/files_tab.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py index a0fae7939..e52af1b3d 100644 --- a/deluge/ui/gtkui/files_tab.py +++ b/deluge/ui/gtkui/files_tab.py @@ -181,6 +181,11 @@ class FilesTab(Tab): glade.get_widget("menuitem_priority_sep") ] + self.localhost_widgets = [ + glade.get_widget("menuitem_open_file"), + glade.get_widget("menuitem3") + ] + self.listview.connect("row-activated", self._on_row_activated) self.listview.connect("button-press-event", self._on_button_press_event) @@ -215,6 +220,11 @@ class FilesTab(Tab): self.torrent_id = None + def start(self): + attr = "hide" if not client.is_localhost() else "show" + for widget in self.localhost_widgets: + getattr(widget, attr)() + def save_state(self): filename = "files_tab.state" # Get the current sort order of the view