diff --git a/deluge/ui/web/js/deluge-all/Sidebar.js b/deluge/ui/web/js/deluge-all/Sidebar.js index 8a72e883e..7b81cec5b 100644 --- a/deluge/ui/web/js/deluge-all/Sidebar.js +++ b/deluge/ui/web/js/deluge-all/Sidebar.js @@ -77,6 +77,11 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, { panel.on('selectionchange', function(view, nodes) { deluge.ui.update(); }); + panel.on('show', function() { + if (!deluge.config.sidebar_multiple_filters) { + deluge.ui.update(); + } + }); this.add(panel); this.doLayout(); @@ -94,12 +99,21 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, { getFilterStates: function() { var states = {} - // Grab the filters from each of the filter panels - this.items.each(function(panel) { - var state = panel.getState(); - if (!state == null) return; - states[panel.filterType] = state; - }, this); + if (deluge.config.sidebar_multiple_filters) { + // Grab the filters from each of the filter panels + this.items.each(function(panel) { + var state = panel.getState(); + if (!state == null) return; + states[panel.filterType] = state; + }, this); + } else { + var panel = this.getLayout().activeItem; + if (panel) { + var state = panel.getState(); + if (!state == null) return; + states[panel.filterType] = state; + } + } return states; }, diff --git a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js index 0eecaa477..c09d36660 100644 --- a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js +++ b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js @@ -74,12 +74,12 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, { labelSeparator: '', boxLabel: _('Show filters with zero torrents') })); - optMan.bind('sidebar_show_trackers', fieldset.add({ - name: 'sidebar_show_trackers', + optMan.bind('sidebar_multiple_filters', fieldset.add({ + name: 'sidebar_multiple_filters', height: 22, fieldLabel: '', labelSeparator: '', - boxLabel: _('Show trackers with zero torrents') + boxLabel: _('Allow the use of multiple filters at once') })); fieldset = this.add({ diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index decd96301..a89449bb7 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -99,7 +99,7 @@ CONFIG_DEFAULTS = { # UI Settings "sidebar_show_zero": False, - "sidebar_show_trackers": False, + "sidebar_multiple_filters": True, "show_session_speed": False, "show_sidebar": True, "theme": "gray", @@ -114,7 +114,7 @@ CONFIG_DEFAULTS = { } UI_CONFIG_KEYS = ( - "theme", "sidebar_show_zero", "sidebar_show_trackers", + "theme", "sidebar_show_zero", "sidebar_multiple_filters", "show_session_speed", "base", "first_login" )