diff --git a/deluge/ui/web/js/deluge-all/Deluge.Sidebar.js b/deluge/ui/web/js/deluge-all/Deluge.Sidebar.js index d2d6ed902..7f6b38bc8 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.Sidebar.js +++ b/deluge/ui/web/js/deluge-all/Deluge.Sidebar.js @@ -1,5 +1,5 @@ /* -Script: deluge-bars.js +Script: Deluge.Sidebar.js Contains all objects and functions related to the statusbar, toolbar and sidebar. @@ -96,13 +96,14 @@ Copyright: }, createFilter: function(filter, states) { - var store = new Ext.data.SimpleStore({ - id: filter, + var store = new Ext.data.ArrayStore({ + idIndex: 0, fields: [ {name: 'filter'}, {name: 'count'} ] }); + store.id = filter; var title = filter.replace('_', ' '); var parts = title.split(' '); @@ -231,7 +232,16 @@ Copyright: 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]) { this.panels[filter].getSelectionModel().selectRow(this.selected.row); } diff --git a/deluge/ui/web/js/deluge-all/Deluge.Torrents.js b/deluge/ui/web/js/deluge-all/Deluge.Torrents.js index dfdf0cffd..8628177d9 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.Torrents.js +++ b/deluge/ui/web/js/deluge-all/Deluge.Torrents.js @@ -285,8 +285,9 @@ Copyright: store.each(function(record) { if (!torrents[record.id]) { store.remove(record); + delete this.torrents[record.id]; } - }); + }, this); store.commitChanges(); var sortState = store.getSortState() diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index d5440a35b..a174233b8 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -514,7 +514,7 @@ class WebApi(JSONComponent): def on_complete(result): d.callback(ui_info) - d1 = client.core.get_torrents_status({}, keys) + d1 = client.core.get_torrents_status(filter_dict, keys) d1.addCallback(got_torrents) d2 = client.core.get_filter_tree()