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:
parent
a55901c87a
commit
495182832d
|
@ -184,6 +184,7 @@ class FilesTab(Tab):
|
||||||
# Connect to the 'torrent_file_renamed' signal
|
# 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_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_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
|
# Attempt to load state
|
||||||
self.load_state()
|
self.load_state()
|
||||||
|
@ -634,6 +635,10 @@ class FilesTab(Tab):
|
||||||
break
|
break
|
||||||
itr = self.treestore.iter_next(itr)
|
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):
|
def _on_drag_data_get_data(self, treeview, context, selection, target_id, etime):
|
||||||
indexes = self.get_selected_files()
|
indexes = self.get_selected_files()
|
||||||
selection.set_text(",".join([str(x) for x in indexes]))
|
selection.set_text(",".join([str(x) for x in indexes]))
|
||||||
|
|
Loading…
Reference in New Issue