diff --git a/glade/file_tab_menu.glade b/glade/file_tab_menu.glade index 2468b4491..f93eef209 100644 --- a/glade/file_tab_menu.glade +++ b/glade/file_tab_menu.glade @@ -5,7 +5,7 @@ True - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK _Open File @@ -22,7 +22,7 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK diff --git a/src/files.py b/src/files.py index 56940a4b6..01f639ac7 100644 --- a/src/files.py +++ b/src/files.py @@ -45,10 +45,10 @@ class FilesBaseManager(object): def __init__(self, file_view, file_store): self.file_view = file_view - file_glade = gtk.glade.XML(common.get_glade_file("file_tab_menu.glade"), + self.glade = gtk.glade.XML(common.get_glade_file("file_tab_menu.glade"), domain='deluge') - self.file_menu = file_glade.get_widget("file_tab_menu") - file_glade.signal_autoconnect({ + self.file_menu = self.glade.get_widget("file_tab_menu") + self.glade.signal_autoconnect({ "open_file" : self.open_file, "select_all": self.file_select_all, "unselect_all": self.file_unselect_all, @@ -148,6 +148,11 @@ class FilesDialogManager(FilesBaseManager): self.dumped_torrent = dumped_torrent self.config = pref.Preferences() + + # Hide Open File menu item as it's not applicable when torrent is + # not added yet + self.glade.get_widget("open_file").hide() + self.glade.get_widget("open_file_separator").hide() def prepare_file_store(self): for file in self.dumped_torrent: