fix setting the download priority for files in the files tab

This commit is contained in:
Damien Churchill 2009-05-27 11:49:27 +00:00
parent 668683f369
commit 91a471e781
1 changed files with 4 additions and 8 deletions

View File

@ -129,26 +129,22 @@ Copyright:
default:
var indexes = {};
function walk(node) {
if (!node.attributes.fileIndex) return;
if (Ext.isEmpty(node.attributes.fileIndex)) return;
indexes[node.attributes.fileIndex] = node.attributes.priority;
}
this.getRootNode().cascade(walk);
var nodes = this.getSelectionModel().getSelectedNodes();
Ext.each(nodes, function(node) {
if (!node.attributes.fileIndex) return;
if (Ext.isEmpty(node.attributes.fileIndex)) return;
indexes[node.attributes.fileIndex] = baseItem.filePriority;
});
alert(Ext.keys(indexes));
priorities = new Array(Ext.keys(indexes).length);
var priorities = new Array(Ext.keys(indexes).length);
for (var index in indexes) {
priorities[index] = indexes[index];
}
alert(this.torrentId);
alert(priorities);
Deluge.Client.core.set_torrent_file_priorities(this.torrentId, priorities, {
success: function() {
Ext.each(nodes, function(node) {