add the cache preferences page

This commit is contained in:
Damien Churchill 2009-07-31 08:35:28 +00:00
parent bdaf0062af
commit aeb087eb3d
3 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,51 @@
Ext.namespace('Ext.deluge.preferences');
Ext.deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
border: false,
title: _('Cache'),
layout: 'form'
}, config);
Ext.deluge.preferences.Cache.superclass.constructor.call(this, config);
},
initComponent: function() {
Ext.deluge.preferences.Cache.superclass.initComponent.call(this);
var optMan = Deluge.Preferences.getOptionsManager();
var fieldset = this.add({
xtype: 'fieldset',
border: false,
title: _('Settings'),
autoHeight: true,
labelWidth: 180,
defaultType: 'uxspinner'
});
optMan.bind('cache_size', fieldset.add({
fieldLabel: _('Cache Size (16 KiB Blocks)'),
name: 'cache_size',
width: 60,
value: 512,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
optMan.bind('cache_expiry', fieldset.add({
fieldLabel: _('Cache Expiry (seconds)'),
name: 'cache_expiry',
width: 60,
value: 60,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
}
});
Deluge.Preferences.addPage(new Ext.deluge.preferences.Cache());

View File

@ -1,4 +1,4 @@
DELUGE_FILES="Deluge.js Deluge.Formatters.js Deluge.Menus.js Deluge.Events.js Deluge.OptionsManager.js Deluge.MultiOptionsManager.js Deluge.Add.js Deluge.Add.File.js Deluge.Add.Url.js Deluge.Client.js Deluge.ConnectionManager.js Deluge.Details.js Deluge.Details.Status.js Deluge.Details.Details.js Deluge.Details.Files.js Deluge.Details.Peers.js Deluge.Details.Options.js Deluge.EditTrackers.js Deluge.Keys.js Deluge.Login.js Deluge.Preferences.js Deluge.Preferences.Downloads.js Deluge.Preferences.Network.js Deluge.Preferences.Bandwidth.js Deluge.Preferences.Interface.js Deluge.Preferences.Other.js Deluge.Preferences.Daemon.js Deluge.Preferences.Queue.js Deluge.Preferences.Proxy.js Deluge.Preferences.Notification.js Deluge.Preferences.Plugins.js Deluge.Remove.js Deluge.Sidebar.js Deluge.Statusbar.js Deluge.Toolbar.js Deluge.Torrents.js Deluge.UI.js"
DELUGE_FILES="Deluge.js Deluge.Formatters.js Deluge.Menus.js Deluge.Events.js Deluge.OptionsManager.js Deluge.MultiOptionsManager.js Deluge.Add.js Deluge.Add.File.js Deluge.Add.Url.js Deluge.Client.js Deluge.ConnectionManager.js Deluge.Details.js Deluge.Details.Status.js Deluge.Details.Details.js Deluge.Details.Files.js Deluge.Details.Peers.js Deluge.Details.Options.js Deluge.EditTrackers.js Deluge.Keys.js Deluge.Login.js Deluge.Preferences.js Deluge.Preferences.Downloads.js Deluge.Preferences.Network.js Deluge.Preferences.Bandwidth.js Deluge.Preferences.Interface.js Deluge.Preferences.Other.js Deluge.Preferences.Daemon.js Deluge.Preferences.Queue.js Deluge.Preferences.Proxy.js Deluge.Preferences.Notification.js Deluge.Preferences.Cache.js Deluge.Preferences.Plugins.js Deluge.Remove.js Deluge.Sidebar.js Deluge.Statusbar.js Deluge.Toolbar.js Deluge.Torrents.js Deluge.UI.js"
ALL_FILES="ext-extensions-debug.js $DELUGE_FILES"
[ -e /usr/bin/jsdoc_toolkit ] && JSDOC="/usr/bin/jsdoc_toolkit"

View File

@ -307,6 +307,7 @@ class TopLevel(resource.Resource):
"/js/Deluge.Preferences.Queue.js",
"/js/Deluge.Preferences.Proxy.js",
"/js/Deluge.Preferences.Notification.js",
"/js/Deluge.Preferences.Cache.js",
"/js/Deluge.Preferences.Plugins.js",
"/js/Deluge.Remove.js",
"/js/Deluge.Sidebar.js",