From 58c3b60ca71ad616e0f5fe369f49ffa74bd11f61 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 12 Aug 2009 00:42:48 +0000 Subject: [PATCH] add a new preferences page for encryption --- .../web/js/Deluge.Preferences.Encryption.js | 81 +++++++++++++++++++ deluge/ui/web/js/build.sh | 2 +- deluge/ui/web/server.py | 1 + 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 deluge/ui/web/js/Deluge.Preferences.Encryption.js diff --git a/deluge/ui/web/js/Deluge.Preferences.Encryption.js b/deluge/ui/web/js/Deluge.Preferences.Encryption.js new file mode 100644 index 000000000..ae81c65d3 --- /dev/null +++ b/deluge/ui/web/js/Deluge.Preferences.Encryption.js @@ -0,0 +1,81 @@ +Ext.namespace('Ext.deluge.preferences'); +Ext.deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, { + constructor: function(config) { + config = Ext.apply({ + border: false, + title: _('Encryption'), + layout: 'form' + }, config); + Ext.deluge.preferences.Encryption.superclass.constructor.call(this, config); + }, + + initComponent: function() { + Ext.deluge.preferences.Encryption.superclass.initComponent.call(this); + + var optMan = Deluge.Preferences.getOptionsManager(); + + var fieldset = this.add({ + xtype: 'fieldset', + border: false, + title: _('Settings'), + autoHeight: true, + defaultType: 'combo' + }); + optMan.bind('enc_in_policy', fieldset.add({ + fieldLabel: _('Inbound'), + mode: 'local', + width: 150, + store: new Ext.data.SimpleStore({ + fields: ['id', 'text'], + data: [ + [0, _('Forced')], + [1, _('Enabled')], + [2, _('Disabled')] + ] + }), + triggerAction: 'all', + valueField: 'id', + displayField: 'text' + })); + optMan.bind('enc_out_policy', fieldset.add({ + fieldLabel: _('Outbound'), + mode: 'local', + width: 150, + store: new Ext.data.SimpleStore({ + fields: ['id', 'text'], + data: [ + [0, _('Forced')], + [1, _('Enabled')], + [2, _('Disabled')] + ] + }), + triggerAction: 'all', + valueField: 'id', + displayField: 'text' + })); + optMan.bind('enc_level', fieldset.add({ + fieldLabel: _('Level'), + mode: 'local', + width: 150, + store: new Ext.data.SimpleStore({ + fields: ['id', 'text'], + data: [ + [0, _('Handshake')], + [1, _('Full Stream')], + [2, _('Either')] + ] + }), + triggerAction: 'all', + valueField: 'id', + displayField: 'text' + })); + optMan.bind('enc_prefer_rc4', fieldset.add({ + xtype: 'checkbox', + name: 'enc_prefer_rc4', + height: 40, + hideLabel: true, + boxLabel: _('Encrypt entire stream') + })); + } +}); +Deluge.Preferences.addPage(new Ext.deluge.preferences.Encryption()); \ No newline at end of file diff --git a/deluge/ui/web/js/build.sh b/deluge/ui/web/js/build.sh index 1e1deebc9..88d4712bb 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.Cache.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.Encryption.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 b54f6b543..be242ec93 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -301,6 +301,7 @@ class TopLevel(resource.Resource): "/js/Deluge.Preferences.js", "/js/Deluge.Preferences.Downloads.js", "/js/Deluge.Preferences.Network.js", + "/js/Deluge.Preferences.Encryption.js", "/js/Deluge.Preferences.Bandwidth.js", "/js/Deluge.Preferences.Interface.js", "/js/Deluge.Preferences.Other.js",