Fix the files listed in the files tab when renaming files, removing them

and then re-adding them to the same session
This commit is contained in:
Andrew Resch 2008-11-29 23:17:50 +00:00
parent a55901c87a
commit 495182832d
1 changed files with 5 additions and 0 deletions

View File

@ -184,6 +184,7 @@ class FilesTab(Tab):
# Connect to the 'torrent_file_renamed' signal
component.get("Signals").connect_to_signal("torrent_file_renamed", self._on_torrent_file_renamed_signal)
component.get("Signals").connect_to_signal("torrent_folder_renamed", self._on_torrent_folder_renamed_signal)
component.get("Signals").connect_to_signal("torrent_removed", self._on_torrent_removed_signal)
# Attempt to load state
self.load_state()
@ -634,6 +635,10 @@ class FilesTab(Tab):
break
itr = self.treestore.iter_next(itr)
def _on_torrent_removed_signal(self, torrent_id):
if torrent_id in self.files_list:
del self.files_list[torrent_id]
def _on_drag_data_get_data(self, treeview, context, selection, target_id, etime):
indexes = self.get_selected_files()
selection.set_text(",".join([str(x) for x in indexes]))