From b29b6fe69fe9d095d0b4a784509d8b2bb6f4aaa9 Mon Sep 17 00:00:00 2001 From: hugosenari Date: Fri, 14 Sep 2018 15:01:31 +0100 Subject: [PATCH] [GTK3] Restore and update expand_row code --- deluge/ui/gtk3/addtorrentdialog.py | 10 ++++------ deluge/ui/gtk3/files_tab.py | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deluge/ui/gtk3/addtorrentdialog.py b/deluge/ui/gtk3/addtorrentdialog.py index 6c5f81a55..947dcd072 100644 --- a/deluge/ui/gtk3/addtorrentdialog.py +++ b/deluge/ui/gtk3/addtorrentdialog.py @@ -348,9 +348,8 @@ class AddTorrentDialog(component.Component): _file, _file['path'], idx, _file.get('download', True), split_files ) self.add_files(None, split_files) - # FIXME add back expand_row - # self.listview_files.expand_row(b'0', False) - self.listview_files.expand_all() + root = Gtk.TreePath.new_first() + self.listview_files.expand_row(root, False) def prepare_file(self, _file, file_name, file_num, download, files_storage): first_slash_index = file_name.find(os.path.sep) @@ -1039,9 +1038,8 @@ class AddTorrentDialog(component.Component): # We need to re-expand the view because it might contracted # if we change the root iter - # FIXME add back expand_row - # self.listview_files.expand_row(b'0', False) - self.listview_files.expand_all() + root = Gtk.TreePath.new_first() + self.listview_files.expand_row(root, False) else: # This was a simple folder rename without any splits, so just # change the path for itr diff --git a/deluge/ui/gtk3/files_tab.py b/deluge/ui/gtk3/files_tab.py index c5db59061..ec6b7c2b5 100644 --- a/deluge/ui/gtk3/files_tab.py +++ b/deluge/ui/gtk3/files_tab.py @@ -377,8 +377,8 @@ class FilesTab(Tab): def update_files(self): with listview_replace_treestore(self.listview): self.prepare_file_store(self.files_list[self.torrent_id]) - # FIXME - # self.listview.expand_row(b'0', False) + root = Gtk.TreePath.new_first() + self.listview.expand_row(root, False) def get_selected_files(self): """Returns a list of file indexes that are selected."""