mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix setting file priorities on folders
This commit is contained in:
parent
6afe33d584
commit
f15971bdeb
2 changed files with 16 additions and 4 deletions
|
@ -8,6 +8,7 @@ Deluge 0.9.08 - "1.0.0_RC8" (In Development)
|
||||||
|
|
||||||
GtkUI:
|
GtkUI:
|
||||||
* Sort filenames alphabetically in add torrent dialog
|
* Sort filenames alphabetically in add torrent dialog
|
||||||
|
* Fix setting file priorities on folders
|
||||||
|
|
||||||
Deluge 0.9.07 - "1.0.0_RC7" (18 August 2008)
|
Deluge 0.9.07 - "1.0.0_RC7" (18 August 2008)
|
||||||
Core:
|
Core:
|
||||||
|
|
|
@ -343,13 +343,24 @@ class FilesTab(Tab):
|
||||||
|
|
||||||
def get_selected_files(self):
|
def get_selected_files(self):
|
||||||
"""Returns a list of file indexes that are selected"""
|
"""Returns a list of file indexes that are selected"""
|
||||||
|
def get_iter_children(itr, selected):
|
||||||
|
i = self.treestore.iter_children(itr)
|
||||||
|
while i:
|
||||||
|
selected.append(self.treestore[i][5])
|
||||||
|
if self.treestore.iter_has_child(i):
|
||||||
|
get_selected_files(i, selected)
|
||||||
|
i = self.treestore.iter_next(i)
|
||||||
|
|
||||||
selected = []
|
selected = []
|
||||||
paths = self.listview.get_selection().get_selected_rows()[1]
|
paths = self.listview.get_selection().get_selected_rows()[1]
|
||||||
for path in paths:
|
for path in paths:
|
||||||
selected.append(self.treestore.get_value(self.treestore.get_iter(path), 5))
|
i = self.treestore.get_iter(path)
|
||||||
|
selected.append(self.treestore[i][5])
|
||||||
|
if self.treestore.iter_has_child(i):
|
||||||
|
get_iter_children(i, selected)
|
||||||
|
|
||||||
return selected
|
return selected
|
||||||
|
|
||||||
def _on_get_torrent_files(self, status):
|
def _on_get_torrent_files(self, status):
|
||||||
self.files_list[self.torrent_id] = status["files"]
|
self.files_list[self.torrent_id] = status["files"]
|
||||||
self.update_files()
|
self.update_files()
|
||||||
|
@ -405,7 +416,7 @@ class FilesTab(Tab):
|
||||||
file_priorities = []
|
file_priorities = []
|
||||||
def set_file_priority(model, path, iter, data):
|
def set_file_priority(model, path, iter, data):
|
||||||
index = model.get_value(iter, 5)
|
index = model.get_value(iter, 5)
|
||||||
if index in selected:
|
if index in selected and index != -1:
|
||||||
file_priorities.append((index, priority))
|
file_priorities.append((index, priority))
|
||||||
elif index != -1:
|
elif index != -1:
|
||||||
file_priorities.append((index, model.get_value(iter, 4)))
|
file_priorities.append((index, model.get_value(iter, 4)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue