Module: deluge Branch: master Commit: f7071b4428d8681ad925ec0a59010ce9d5cbaf41
Author: Damien Churchill <[email protected]> Date: Tue Mar 16 22:42:52 2010 +0000 fix the sidebar and torrent filtering (Closes: #1176) --- deluge/ui/web/js/deluge-all/Deluge.Sidebar.js | 18 ++++++++++++++---- deluge/ui/web/js/deluge-all/Deluge.Torrents.js | 3 ++- deluge/ui/web/json_api.py | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/Deluge.Sidebar.js b/deluge/ui/web/js/deluge-all/Deluge.Sidebar.js index d2d6ed9..7f6b38b 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 dfdf0cf..8628177 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 d5440a3..a174233 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() -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
