Hide the 'Open File' menu option when connected to a remote daemon

This commit is contained in:
Andrew Resch 2009-08-23 20:46:31 +00:00
parent df72c38f22
commit 00882ac867
1 changed files with 10 additions and 0 deletions

View File

@ -181,6 +181,11 @@ class FilesTab(Tab):
glade.get_widget("menuitem_priority_sep") 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("row-activated", self._on_row_activated)
self.listview.connect("button-press-event", self._on_button_press_event) self.listview.connect("button-press-event", self._on_button_press_event)
@ -215,6 +220,11 @@ class FilesTab(Tab):
self.torrent_id = None 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): def save_state(self):
filename = "files_tab.state" filename = "files_tab.state"
# Get the current sort order of the view # Get the current sort order of the view