From aeb087eb3df70e52aacfd2e0f7e9d1212c0f273e Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 31 Jul 2009 08:35:28 +0000 Subject: [PATCH] add the cache preferences page --- deluge/ui/web/js/Deluge.Preferences.Cache.js | 51 ++++++++++++++++++++ deluge/ui/web/js/build.sh | 2 +- deluge/ui/web/server.py | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 deluge/ui/web/js/Deluge.Preferences.Cache.js diff --git a/deluge/ui/web/js/Deluge.Preferences.Cache.js b/deluge/ui/web/js/Deluge.Preferences.Cache.js new file mode 100644 index 000000000..2a81df316 --- /dev/null +++ b/deluge/ui/web/js/Deluge.Preferences.Cache.js @@ -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()); \ No newline at end of file diff --git a/deluge/ui/web/js/build.sh b/deluge/ui/web/js/build.sh index f8acde0b8..1e1deebc9 100755 --- a/deluge/ui/web/js/build.sh +++ b/deluge/ui/web/js/build.sh @@ -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" diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index 8ae7e9c93..cbe602ea0 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -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",