change the multiple filters to be configurable, deprecating the show trackers with zero torrents option
This commit is contained in:
parent
67905b6f5b
commit
fd122db7b7
|
@ -77,6 +77,11 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
|
||||||
panel.on('selectionchange', function(view, nodes) {
|
panel.on('selectionchange', function(view, nodes) {
|
||||||
deluge.ui.update();
|
deluge.ui.update();
|
||||||
});
|
});
|
||||||
|
panel.on('show', function() {
|
||||||
|
if (!deluge.config.sidebar_multiple_filters) {
|
||||||
|
deluge.ui.update();
|
||||||
|
}
|
||||||
|
});
|
||||||
this.add(panel);
|
this.add(panel);
|
||||||
|
|
||||||
this.doLayout();
|
this.doLayout();
|
||||||
|
@ -94,12 +99,21 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
|
||||||
getFilterStates: function() {
|
getFilterStates: function() {
|
||||||
var states = {}
|
var states = {}
|
||||||
|
|
||||||
// Grab the filters from each of the filter panels
|
if (deluge.config.sidebar_multiple_filters) {
|
||||||
this.items.each(function(panel) {
|
// Grab the filters from each of the filter panels
|
||||||
var state = panel.getState();
|
this.items.each(function(panel) {
|
||||||
if (!state == null) return;
|
var state = panel.getState();
|
||||||
states[panel.filterType] = state;
|
if (!state == null) return;
|
||||||
}, this);
|
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;
|
return states;
|
||||||
},
|
},
|
||||||
|
|
|
@ -74,12 +74,12 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
|
||||||
labelSeparator: '',
|
labelSeparator: '',
|
||||||
boxLabel: _('Show filters with zero torrents')
|
boxLabel: _('Show filters with zero torrents')
|
||||||
}));
|
}));
|
||||||
optMan.bind('sidebar_show_trackers', fieldset.add({
|
optMan.bind('sidebar_multiple_filters', fieldset.add({
|
||||||
name: 'sidebar_show_trackers',
|
name: 'sidebar_multiple_filters',
|
||||||
height: 22,
|
height: 22,
|
||||||
fieldLabel: '',
|
fieldLabel: '',
|
||||||
labelSeparator: '',
|
labelSeparator: '',
|
||||||
boxLabel: _('Show trackers with zero torrents')
|
boxLabel: _('Allow the use of multiple filters at once')
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fieldset = this.add({
|
fieldset = this.add({
|
||||||
|
|
|
@ -99,7 +99,7 @@ CONFIG_DEFAULTS = {
|
||||||
|
|
||||||
# UI Settings
|
# UI Settings
|
||||||
"sidebar_show_zero": False,
|
"sidebar_show_zero": False,
|
||||||
"sidebar_show_trackers": False,
|
"sidebar_multiple_filters": True,
|
||||||
"show_session_speed": False,
|
"show_session_speed": False,
|
||||||
"show_sidebar": True,
|
"show_sidebar": True,
|
||||||
"theme": "gray",
|
"theme": "gray",
|
||||||
|
@ -114,7 +114,7 @@ CONFIG_DEFAULTS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_CONFIG_KEYS = (
|
UI_CONFIG_KEYS = (
|
||||||
"theme", "sidebar_show_zero", "sidebar_show_trackers",
|
"theme", "sidebar_show_zero", "sidebar_multiple_filters",
|
||||||
"show_session_speed", "base", "first_login"
|
"show_session_speed", "base", "first_login"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue