From 6e8e7a63ccf7db59df46418de182e7c913409372 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 May 2013 01:15:38 +0100 Subject: [PATCH] #2218 #2254 : Re-enable utpex control and add lt_tex (tracker exchange) --- deluge/core/core.py | 14 ++--- deluge/core/preferencesmanager.py | 11 ++-- deluge/event.py | 3 -- deluge/ui/console/modes/preference_panes.py | 1 + deluge/ui/gtkui/glade/preferences_dialog.ui | 22 +++++++- deluge/ui/gtkui/preferences.py | 4 ++ deluge/ui/web/gettext.js | 3 ++ deluge/ui/web/js/deluge-all-debug.js | 51 +++++++++++-------- deluge/ui/web/js/deluge-all.js | 8 +-- .../js/deluge-all/preferences/NetworkPage.js | 23 ++++++--- 10 files changed, 88 insertions(+), 52 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index b97e3aded..ef7366747 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -80,10 +80,7 @@ class Core(component.Component): while len(version) < 4: version.append(0) - # Note: All libtorrent python bindings to set plugins/extensions need to be disabled - # due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369 - # Setting session flags to 1 enables all libtorrent default plugins - self.session = lt.session(lt.fingerprint("DE", *version), flags=1) + self.session = lt.session(lt.fingerprint("DE", *version), flags=0) # Load the session state if available self.__load_session_state() @@ -105,12 +102,9 @@ class Core(component.Component): lt.io_buffer_mode_t.disable_os_cache self.session.set_settings(self.settings) - # Load metadata extension - # Note: All libtorrent python bindings to set plugins/extensions need to be disabled - # due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369 - # self.session.add_extension(lt.create_metadata_plugin) - # self.session.add_extension(lt.create_ut_metadata_plugin) - # self.session.add_extension(lt.create_smart_ban_plugin) + self.session.add_extension("metadata_transfer") + self.session.add_extension("ut_metadata") + self.session.add_extension("smart_ban") # Create the components self.eventmanager = EventManager() diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index 903565590..bbfb48b33 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -68,6 +68,7 @@ DEFAULT_PREFS = { "upnp": True, "natpmp": True, "utpex": True, + "lt_tex": True, "lsd": True, "enc_in_policy": 1, "enc_out_policy": 1, @@ -288,10 +289,12 @@ class PreferencesManager(component.Component): def _on_set_utpex(self, key, value): log.debug("utpex value set to %s", value) if value: - # Note: All libtorrent python bindings to set plugins/extensions need to be disabled - # due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369 - #self.session.add_extension(lt.create_ut_pex_plugin) - pass + self.session.add_extension("ut_pex") + + def _on_set_lt_tex(self, key, value): + log.debug("lt_tex value set to %s", value) + if value: + self.session.add_extension("lt_trackers") def _on_set_enc_in_policy(self, key, value): self._on_set_encryption(key, value) diff --git a/deluge/event.py b/deluge/event.py index 4a1d644e4..db69ab8c4 100644 --- a/deluge/event.py +++ b/deluge/event.py @@ -184,9 +184,6 @@ class TorrentResumedEvent(DelugeEvent): class TorrentFileCompletedEvent(DelugeEvent): """ Emitted when a file completes. - - This will only work with libtorrent 0.15 or greater. - """ def __init__(self, torrent_id, index): """ diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py index 9f2543e82..da042bc5d 100644 --- a/deluge/ui/console/modes/preference_panes.py +++ b/deluge/ui/console/modes/preference_panes.py @@ -279,6 +279,7 @@ class NetworkPane(BasePane): self.add_checked_input("upnp","UPnP",parent.core_config["upnp"]) self.add_checked_input("natpmp","NAT-PMP",parent.core_config["natpmp"]) self.add_checked_input("utpex","Peer Exchange",parent.core_config["utpex"]) + self.add_checked_input("lt_tex","Tracker Exchange",parent.core_config["lt_tex"]) self.add_checked_input("lsd","LSD",parent.core_config["lsd"]) self.add_checked_input("dht","DHT",parent.core_config["dht"]) diff --git a/deluge/ui/gtkui/glade/preferences_dialog.ui b/deluge/ui/gtkui/glade/preferences_dialog.ui index 312fa335e..9e9102059 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.ui +++ b/deluge/ui/gtkui/glade/preferences_dialog.ui @@ -1505,7 +1505,7 @@ used sparingly. True True False - Peer Exchange + Exchanges peers between clients. (Changing setting requires restart) True True True @@ -1516,6 +1516,26 @@ used sparingly. GTK_FILL + + + Tracker Exchange + False + True + True + False + Exchanges trackers between clients. (Changing setting requires restart) + True + True + True + + + 2 + 3 + 1 + 2 + GTK_FILL + + LSD diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 2755a330c..d7fa3e200 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -323,6 +323,7 @@ class Preferences(component.Component): "chk_upnp": ("active", self.core_config["upnp"]), "chk_natpmp": ("active", self.core_config["natpmp"]), "chk_utpex": ("active", self.core_config["utpex"]), + "chk_lt_tex": ("active", self.core_config["lt_tex"]), "chk_lsd": ("active", self.core_config["lsd"]), "chk_new_releases": ("active", self.core_config["new_release_check"]), "chk_send_info": ("active", self.core_config["send_info"]), @@ -478,6 +479,7 @@ class Preferences(component.Component): "chk_upnp", "chk_natpmp", "chk_utpex", + "chk_lt_tex", "chk_lsd", "chk_send_info", "chk_new_releases", @@ -678,6 +680,8 @@ class Preferences(component.Component): self.builder.get_object("chk_natpmp").get_active() new_core_config["utpex"] = \ self.builder.get_object("chk_utpex").get_active() + new_core_config["lt_tex"] = \ + self.builder.get_object("chk_lt_tex").get_active() new_core_config["lsd"] = \ self.builder.get_object("chk_lsd").get_active() new_core_config["enc_in_policy"] = \ diff --git a/deluge/ui/web/gettext.js b/deluge/ui/web/gettext.js index 54371a648..069fd9471 100644 --- a/deluge/ui/web/gettext.js +++ b/deluge/ui/web/gettext.js @@ -755,6 +755,9 @@ GetText.add('Total Size', '${escape(_("Total Size"))}') // EditTrackersWindow.js:80, TorrentGrid.js:193, EditTrackerWindow.js:66, DetailsTab.js:53, ProxyPage.js:64 GetText.add('Tracker', '${escape(_("Tracker"))}') +// NetworkPage.js:232 +GetText.add('Tracker Exchange', '${escape(_("Tracker Exchange"))}') + // Sidebar.js:35 GetText.add('Tracker Host', '${escape(_("Tracker Host"))}') diff --git a/deluge/ui/web/js/deluge-all-debug.js b/deluge/ui/web/js/deluge-all-debug.js index fc40d836f..43dfa2d04 100644 --- a/deluge/ui/web/js/deluge-all-debug.js +++ b/deluge/ui/web/js/deluge-all-debug.js @@ -3388,7 +3388,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, { }); /*! * Deluge.preferences.NetworkPage.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -3424,7 +3424,7 @@ Ext.namespace('Deluge.preferences'); * @extends Ext.form.FormPanel */ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { - + border: false, layout: 'form', title: _('Network'), @@ -3432,7 +3432,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { initComponent: function() { Deluge.preferences.Network.superclass.initComponent.call(this); var optMan = deluge.preferences.getOptionsManager(); - + var fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3485,7 +3485,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { }] }); optMan.bind('listen_ports', this.listenPorts); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3538,7 +3538,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { }] }); optMan.bind('outgoing_ports', this.outgoingPorts); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3554,7 +3554,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { labelSeparator: '', width: 200 })); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3569,7 +3569,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { fieldLabel: _('Peer TOS Byte'), width: 80 })); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3578,7 +3578,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { layout: 'table', layoutConfig: { columns: 3 - }, + }, defaultType: 'checkbox' }); optMan.bind('upnp', fieldset.add({ @@ -3614,11 +3614,18 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { ctCls: 'x-deluge-indent-checkbox', name: 'dht' })); + optMan.bind('lt_tex', fieldset.add({ + fieldLabel: '', + labelSeparator: '', + boxLabel: _('Tracker Exchange'), + ctCls: 'x-deluge-indent-checkbox', + name: 'lt_tex' + })); } }); /*! * Deluge.preferences.OtherPage.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -3662,12 +3669,12 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, { }, config); Deluge.preferences.Other.superclass.constructor.call(this, config); }, - + initComponent: function() { Deluge.preferences.Other.superclass.initComponent.call(this); - + var optMan = deluge.preferences.getOptionsManager(); - + var fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3683,7 +3690,7 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, { name: 'new_release_check', boxLabel: _('Be alerted about new releases') })); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -3696,9 +3703,9 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, { xtype: 'panel', border: false, bodyCfg: { - html: _('Help us improve Deluge by sending us your ' - + 'Python version, PyGTK version, OS and processor ' - + 'types. Absolutely no other information is sent.') + html: _('Help us improve Deluge by sending us your \ +Python version, PyGTK version, OS and processor \ +types. Absolutely no other information is sent.') } }); optMan.bind('send_info', fieldset.add({ @@ -3708,7 +3715,7 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, { boxLabel: _('Yes, please send anonymous statistics'), name: 'send_info' })); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -4827,7 +4834,7 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, { }); /*! * Deluge.OptionsManager.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -4867,7 +4874,7 @@ Ext.namespace('Deluge'); * @param {Object} config Configuration options */ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { - + constructor: function(config) { config = config || {}; this.binds = {}; @@ -4909,7 +4916,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { addOptions: function(options) { this.options = Ext.applyIf(this.options, options); }, - + /** * Binds a form field to the specified option. * @param {String} option @@ -5089,7 +5096,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { * @private */ onFieldChange: function(field, event) { - if (field.field) field = field.field // fix for spinners + if (field.field) field = field.field; // fix for spinners this.update(field._doption, field.getValue()); }, @@ -5106,7 +5113,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { // If we don't have a bind there's nothing to do. if (Ext.isEmpty(this.binds[option])) return; Ext.each(this.binds[option], function(bind) { - // The field is currently focused so we don't want to + // The field is currently focused so we don't want to // change it. if (bind == this.focused) return; // Set the form field to the new value. diff --git a/deluge/ui/web/js/deluge-all.js b/deluge/ui/web/js/deluge-all.js index 351f21e58..fe20c1f8e 100644 --- a/deluge/ui/web/js/deluge-all.js +++ b/deluge/ui/web/js/deluge-all.js @@ -736,7 +736,7 @@ Ext.namespace("Deluge.preferences");Deluge.preferences.InstallPluginWindow=Ext.e Ext.namespace("Deluge.preferences");Deluge.preferences.Interface=Ext.extend(Ext.form.FormPanel,{border:false,title:_("Interface"),layout:"form",initComponent:function(){Deluge.preferences.Interface.superclass.initComponent.call(this);var c=this.optionsManager=new Deluge.OptionsManager();this.on("show",this.onPageShow,this);var a=this.add({xtype:"fieldset",border:false,title:_("Interface"),style:"margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px",autoHeight:true,labelWidth:1,defaultType:"checkbox"});c.bind("show_session_speed",a.add({name:"show_session_speed",height:22,fieldLabel:"",labelSeparator:"",boxLabel:_("Show session speed in titlebar")}));c.bind("sidebar_show_zero",a.add({name:"sidebar_show_zero",height:22,fieldLabel:"",labelSeparator:"",boxLabel:_("Show filters with zero torrents")}));c.bind("sidebar_multiple_filters",a.add({name:"sidebar_multiple_filters",height:22,fieldLabel:"",labelSeparator:"",boxLabel:_("Allow the use of multiple filters at once")}));a=this.add({xtype:"fieldset",border:false,title:_("Password"),style:"margin-bottom: 0px; padding-bottom: 0px; padding-top: 5px",autoHeight:true,labelWidth:110,defaultType:"textfield",defaults:{width:180,inputType:"password"}});this.oldPassword=a.add({name:"old_password",fieldLabel:_("Old Password")});this.newPassword=a.add({name:"new_password",fieldLabel:_("New Password")});this.confirmPassword=a.add({name:"confirm_password",fieldLabel:_("Confirm Password")});var b=a.add({xtype:"panel",autoHeight:true,border:false,width:320,bodyStyle:"padding-left: 230px"});b.add({xtype:"button",text:_("Change"),listeners:{click:{fn:this.onPasswordChange,scope:this}}});a=this.add({xtype:"fieldset",border:false,title:_("Server"),style:"margin-top: 0px; padding-top: 0px; margin-bottom: 0px; padding-bottom: 0px",autoHeight:true,labelWidth:110,defaultType:"spinnerfield",defaults:{width:80}});c.bind("session_timeout",a.add({name:"session_timeout",fieldLabel:_("Session Timeout"),decimalPrecision:0,minValue:-1,maxValue:99999}));c.bind("port",a.add({name:"port",fieldLabel:_("Port"),decimalPrecision:0,minValue:-1,maxValue:99999}));this.httpsField=c.bind("https",a.add({xtype:"checkbox",name:"https",hideLabel:true,width:280,height:22,boxLabel:_("Use SSL (paths relative to Deluge config folder)")}));this.httpsField.on("check",this.onSSLCheck,this);this.pkeyField=c.bind("pkey",a.add({xtype:"textfield",disabled:true,name:"pkey",width:180,fieldLabel:_("Private Key")}));this.certField=c.bind("cert",a.add({xtype:"textfield",disabled:true,name:"cert",width:180,fieldLabel:_("Certificate")}))},onApply:function(){var b=this.optionsManager.getDirty();if(!Ext.isObjectEmpty(b)){deluge.client.web.set_config(b,{success:this.onSetConfig,scope:this});for(var a in deluge.config){deluge.config[a]=this.optionsManager.get(a)}}},onGotConfig:function(a){this.optionsManager.set(a)},onPasswordChange:function(){var b=this.newPassword.getValue();if(b!=this.confirmPassword.getValue()){Ext.MessageBox.show({title:_("Invalid Password"),msg:_("Your passwords don't match!"),buttons:Ext.MessageBox.OK,modal:false,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});return}var a=this.oldPassword.getValue();deluge.client.auth.change_password(a,b,{success:function(c){if(!c){Ext.MessageBox.show({title:_("Password"),msg:_("Your old password was incorrect!"),buttons:Ext.MessageBox.OK,modal:false,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});this.oldPassword.setValue("")}else{Ext.MessageBox.show({title:_("Change Successful"),msg:_("Your password was successfully changed!"),buttons:Ext.MessageBox.OK,modal:false,icon:Ext.MessageBox.INFO,iconCls:"x-deluge-icon-info"});this.oldPassword.setValue("");this.newPassword.setValue("");this.confirmPassword.setValue("")}},scope:this})},onSetConfig:function(){this.optionsManager.commit()},onPageShow:function(){deluge.client.web.get_config({success:this.onGotConfig,scope:this})},onSSLCheck:function(b,a){this.pkeyField.setDisabled(!a);this.certField.setDisabled(!a)}}); /* * Deluge.preferences.NetworkPage.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -765,10 +765,10 @@ Ext.namespace("Deluge.preferences");Deluge.preferences.Interface=Ext.extend(Ext. * this exception statement from your version. If you delete this exception * statement from all source files in the program, then also delete it here. */ -Ext.namespace("Deluge.preferences");Deluge.preferences.Network=Ext.extend(Ext.form.FormPanel,{border:false,layout:"form",title:_("Network"),initComponent:function(){Deluge.preferences.Network.superclass.initComponent.call(this);var b=deluge.preferences.getOptionsManager();var a=this.add({xtype:"fieldset",border:false,title:_("Incoming Ports"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:true,labelWidth:1,defaultType:"checkbox"});b.bind("random_port",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Use Random Ports"),name:"random_port",height:22,listeners:{check:{fn:function(d,c){this.listenPorts.setDisabled(c)},scope:this}}}));this.listenPorts=a.add({xtype:"spinnergroup",name:"listen_ports",fieldLabel:"",labelSeparator:"",colCfg:{labelWidth:40,style:"margin-right: 10px;"},items:[{fieldLabel:"From",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}},{fieldLabel:"To",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}}]});b.bind("listen_ports",this.listenPorts);a=this.add({xtype:"fieldset",border:false,title:_("Outgoing Ports"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:true,labelWidth:1,defaultType:"checkbox"});b.bind("random_outgoing_ports",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Use Random Ports"),name:"random_outgoing_ports",height:22,listeners:{check:{fn:function(d,c){this.outgoingPorts.setDisabled(c)},scope:this}}}));this.outgoingPorts=a.add({xtype:"spinnergroup",name:"outgoing_ports",fieldLabel:"",labelSeparator:"",colCfg:{labelWidth:40,style:"margin-right: 10px;"},items:[{fieldLabel:"From",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}},{fieldLabel:"To",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}}]});b.bind("outgoing_ports",this.outgoingPorts);a=this.add({xtype:"fieldset",border:false,title:_("Network Interface"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:true,labelWidth:1,defaultType:"textfield"});b.bind("listen_interface",a.add({name:"listen_interface",fieldLabel:"",labelSeparator:"",width:200}));a=this.add({xtype:"fieldset",border:false,title:_("TOS"),style:"margin-bottom: 5px; padding-bottom: 0px;",bodyStyle:"margin: 0px; padding: 0px",autoHeight:true,defaultType:"textfield"});b.bind("peer_tos",a.add({name:"peer_tos",fieldLabel:_("Peer TOS Byte"),width:80}));a=this.add({xtype:"fieldset",border:false,title:_("Network Extras"),autoHeight:true,layout:"table",layoutConfig:{columns:3},defaultType:"checkbox"});b.bind("upnp",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("UPnP"),name:"upnp"}));b.bind("natpmp",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("NAT-PMP"),ctCls:"x-deluge-indent-checkbox",name:"natpmp"}));b.bind("utpex",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Peer Exchange"),ctCls:"x-deluge-indent-checkbox",name:"utpex"}));b.bind("lsd",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("LSD"),name:"lsd"}));b.bind("dht",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("DHT"),ctCls:"x-deluge-indent-checkbox",name:"dht"}))}}); +Ext.namespace("Deluge.preferences");Deluge.preferences.Network=Ext.extend(Ext.form.FormPanel,{border:false,layout:"form",title:_("Network"),initComponent:function(){Deluge.preferences.Network.superclass.initComponent.call(this);var b=deluge.preferences.getOptionsManager();var a=this.add({xtype:"fieldset",border:false,title:_("Incoming Ports"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:true,labelWidth:1,defaultType:"checkbox"});b.bind("random_port",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Use Random Ports"),name:"random_port",height:22,listeners:{check:{fn:function(d,c){this.listenPorts.setDisabled(c)},scope:this}}}));this.listenPorts=a.add({xtype:"spinnergroup",name:"listen_ports",fieldLabel:"",labelSeparator:"",colCfg:{labelWidth:40,style:"margin-right: 10px;"},items:[{fieldLabel:"From",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}},{fieldLabel:"To",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}}]});b.bind("listen_ports",this.listenPorts);a=this.add({xtype:"fieldset",border:false,title:_("Outgoing Ports"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:true,labelWidth:1,defaultType:"checkbox"});b.bind("random_outgoing_ports",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Use Random Ports"),name:"random_outgoing_ports",height:22,listeners:{check:{fn:function(d,c){this.outgoingPorts.setDisabled(c)},scope:this}}}));this.outgoingPorts=a.add({xtype:"spinnergroup",name:"outgoing_ports",fieldLabel:"",labelSeparator:"",colCfg:{labelWidth:40,style:"margin-right: 10px;"},items:[{fieldLabel:"From",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}},{fieldLabel:"To",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999}}]});b.bind("outgoing_ports",this.outgoingPorts);a=this.add({xtype:"fieldset",border:false,title:_("Network Interface"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:true,labelWidth:1,defaultType:"textfield"});b.bind("listen_interface",a.add({name:"listen_interface",fieldLabel:"",labelSeparator:"",width:200}));a=this.add({xtype:"fieldset",border:false,title:_("TOS"),style:"margin-bottom: 5px; padding-bottom: 0px;",bodyStyle:"margin: 0px; padding: 0px",autoHeight:true,defaultType:"textfield"});b.bind("peer_tos",a.add({name:"peer_tos",fieldLabel:_("Peer TOS Byte"),width:80}));a=this.add({xtype:"fieldset",border:false,title:_("Network Extras"),autoHeight:true,layout:"table",layoutConfig:{columns:3},defaultType:"checkbox"});b.bind("upnp",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("UPnP"),name:"upnp"}));b.bind("natpmp",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("NAT-PMP"),ctCls:"x-deluge-indent-checkbox",name:"natpmp"}));b.bind("utpex",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Peer Exchange"),ctCls:"x-deluge-indent-checkbox",name:"utpex"}));b.bind("lsd",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("LSD"),name:"lsd"}));b.bind("dht",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("DHT"),ctCls:"x-deluge-indent-checkbox",name:"dht"}));b.bind("lt_tex",a.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Tracker Exchange"),ctCls:"x-deluge-indent-checkbox",name:"lt_tex"}))}}); /* * Deluge.preferences.OtherPage.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -992,7 +992,7 @@ Ext.namespace("Deluge.preferences");Deluge.preferences.Queue=Ext.extend(Ext.form Ext.ns("Deluge");Deluge.StatusbarMenu=Ext.extend(Ext.menu.Menu,{initComponent:function(){Deluge.StatusbarMenu.superclass.initComponent.call(this);this.otherWin=new Deluge.OtherLimitWindow(this.initialConfig.otherWin||{});this.items.each(function(a){if(a.getXType()!="menucheckitem"){return}if(a.value=="other"){a.on("click",this.onOtherClicked,this)}else{a.on("checkchange",this.onLimitChanged,this)}},this)},setValue:function(b){var c=false;this.value=b=(b==0)?-1:b;var a=null;this.items.each(function(d){if(d.setChecked){d.suspendEvents();if(d.value==b){d.setChecked(true);c=true}else{d.setChecked(false)}d.resumeEvents()}if(d.value=="other"){a=d}});if(c){return}a.suspendEvents();a.setChecked(true);a.resumeEvents()},onLimitChanged:function(c,b){if(!b||c.value=="other"){return}var a={};a[c.group]=c.value;deluge.client.core.set_config(a,{success:function(){deluge.ui.update()}})},onOtherClicked:function(a,b){this.otherWin.group=a.group;this.otherWin.setValue(this.value);this.otherWin.show()}}); /* * Deluge.OptionsManager.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify diff --git a/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js b/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js index 13b1448fb..250a070a5 100644 --- a/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js +++ b/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js @@ -1,6 +1,6 @@ /*! * Deluge.preferences.NetworkPage.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -36,7 +36,7 @@ Ext.namespace('Deluge.preferences'); * @extends Ext.form.FormPanel */ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { - + border: false, layout: 'form', title: _('Network'), @@ -44,7 +44,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { initComponent: function() { Deluge.preferences.Network.superclass.initComponent.call(this); var optMan = deluge.preferences.getOptionsManager(); - + var fieldset = this.add({ xtype: 'fieldset', border: false, @@ -97,7 +97,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { }] }); optMan.bind('listen_ports', this.listenPorts); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -150,7 +150,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { }] }); optMan.bind('outgoing_ports', this.outgoingPorts); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -166,7 +166,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { labelSeparator: '', width: 200 })); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -181,7 +181,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { fieldLabel: _('Peer TOS Byte'), width: 80 })); - + fieldset = this.add({ xtype: 'fieldset', border: false, @@ -190,7 +190,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { layout: 'table', layoutConfig: { columns: 3 - }, + }, defaultType: 'checkbox' }); optMan.bind('upnp', fieldset.add({ @@ -226,5 +226,12 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { ctCls: 'x-deluge-indent-checkbox', name: 'dht' })); + optMan.bind('lt_tex', fieldset.add({ + fieldLabel: '', + labelSeparator: '', + boxLabel: _('Tracker Exchange'), + ctCls: 'x-deluge-indent-checkbox', + name: 'lt_tex' + })); } });