fix the sidebar and torrent filtering (Closes: #1176)
This commit is contained in:
parent
296d790421
commit
f7071b4428
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Script: deluge-bars.js
|
Script: Deluge.Sidebar.js
|
||||||
Contains all objects and functions related to the statusbar, toolbar and
|
Contains all objects and functions related to the statusbar, toolbar and
|
||||||
sidebar.
|
sidebar.
|
||||||
|
|
||||||
|
@ -96,13 +96,14 @@ Copyright:
|
||||||
},
|
},
|
||||||
|
|
||||||
createFilter: function(filter, states) {
|
createFilter: function(filter, states) {
|
||||||
var store = new Ext.data.SimpleStore({
|
var store = new Ext.data.ArrayStore({
|
||||||
id: filter,
|
idIndex: 0,
|
||||||
fields: [
|
fields: [
|
||||||
{name: 'filter'},
|
{name: 'filter'},
|
||||||
{name: 'count'}
|
{name: 'count'}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
store.id = filter;
|
||||||
|
|
||||||
var title = filter.replace('_', ' ');
|
var title = filter.replace('_', ' ');
|
||||||
var parts = title.split(' ');
|
var parts = title.split(' ');
|
||||||
|
@ -231,7 +232,16 @@ Copyright:
|
||||||
states = this.removeZero(states);
|
states = this.removeZero(states);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.panels[filter].store.loadData(states);
|
var store = this.panels[filter].getStore();
|
||||||
|
Ext.each(states, function(s, i) {
|
||||||
|
var record = store.getAt(i);
|
||||||
|
record.beginEdit();
|
||||||
|
record.set('filter', s[0]);
|
||||||
|
record.set('count', s[1]);
|
||||||
|
record.endEdit();
|
||||||
|
record.commit();
|
||||||
|
}, this);
|
||||||
|
|
||||||
if (this.selected && this.selected.panel == this.panels[filter]) {
|
if (this.selected && this.selected.panel == this.panels[filter]) {
|
||||||
this.panels[filter].getSelectionModel().selectRow(this.selected.row);
|
this.panels[filter].getSelectionModel().selectRow(this.selected.row);
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,8 +285,9 @@ Copyright:
|
||||||
store.each(function(record) {
|
store.each(function(record) {
|
||||||
if (!torrents[record.id]) {
|
if (!torrents[record.id]) {
|
||||||
store.remove(record);
|
store.remove(record);
|
||||||
|
delete this.torrents[record.id];
|
||||||
}
|
}
|
||||||
});
|
}, this);
|
||||||
store.commitChanges();
|
store.commitChanges();
|
||||||
|
|
||||||
var sortState = store.getSortState()
|
var sortState = store.getSortState()
|
||||||
|
|
|
@ -514,7 +514,7 @@ class WebApi(JSONComponent):
|
||||||
def on_complete(result):
|
def on_complete(result):
|
||||||
d.callback(ui_info)
|
d.callback(ui_info)
|
||||||
|
|
||||||
d1 = client.core.get_torrents_status({}, keys)
|
d1 = client.core.get_torrents_status(filter_dict, keys)
|
||||||
d1.addCallback(got_torrents)
|
d1.addCallback(got_torrents)
|
||||||
|
|
||||||
d2 = client.core.get_filter_tree()
|
d2 = client.core.get_filter_tree()
|
||||||
|
|
Loading…
Reference in New Issue