From 7bd53903a425ec5d00b79d93d1d0edcdab779ee2 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sat, 11 May 2013 16:15:17 +0100 Subject: [PATCH] Rearrange the Network tab in GTK and Web UIs Also applied the suggestions in #2055 including removing 'Encrypt Entire Stream' and default it (prefer_rc4) to True --- deluge/core/preferencesmanager.py | 7 +- deluge/ui/console/modes/preference_panes.py | 1 - deluge/ui/gtkui/glade/preferences_dialog.ui | 992 ++++++++---------- deluge/ui/gtkui/preferences.py | 16 +- .../deluge-all/preferences/EncryptionPage.js | 22 +- .../js/deluge-all/preferences/NetworkPage.js | 75 +- 6 files changed, 515 insertions(+), 598 deletions(-) diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index 68c7d7f50..f22c6b23d 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -73,7 +73,6 @@ DEFAULT_PREFS = { "enc_in_policy": 1, "enc_out_policy": 1, "enc_level": 2, - "enc_prefer_rc4": True, "max_connections_global": 200, "max_upload_speed": -1.0, "max_download_speed": -1.0, @@ -305,18 +304,16 @@ class PreferencesManager(component.Component): def _on_set_enc_level(self, key, value): self._on_set_encryption(key, value) - def _on_set_enc_prefer_rc4(self, key, value): - self._on_set_encryption(key, value) - def _on_set_encryption(self, key, value): log.debug("encryption value %s set to %s..", key, value) pe_enc_level = {0: lt.enc_level.plaintext, 1: lt.enc_level.rc4, 2: lt.enc_level.both} + pe_settings = lt.pe_settings() pe_settings.out_enc_policy = \ lt.enc_policy(self.config["enc_out_policy"]) pe_settings.in_enc_policy = lt.enc_policy(self.config["enc_in_policy"]) pe_settings.allowed_enc_level = lt.enc_level(pe_enc_level[self.config["enc_level"]]) - pe_settings.prefer_rc4 = self.config["enc_prefer_rc4"] + pe_settings.prefer_rc4 = True self.session.set_pe_settings(pe_settings) set = self.session.get_pe_settings() log.debug("encryption settings:\n\t\t\tout_policy: %s\n\t\t\ diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py index da042bc5d..78c4efd39 100644 --- a/deluge/ui/console/modes/preference_panes.py +++ b/deluge/ui/console/modes/preference_panes.py @@ -287,7 +287,6 @@ class NetworkPane(BasePane): self.add_select_input("enc_in_policy","Inbound:",["Forced","Enabled","Disabled"],[0,1,2],parent.core_config["enc_in_policy"]) self.add_select_input("enc_out_policy","Outbound:",["Forced","Enabled","Disabled"],[0,1,2],parent.core_config["enc_out_policy"]) self.add_select_input("enc_level","Level:",["Handshake","Full Stream","Either"],[0,1,2],parent.core_config["enc_level"]) - self.add_checked_input("enc_prefer_rc4","Encrypt Entire Stream",parent.core_config["enc_prefer_rc4"]) class BandwidthPane(BasePane): diff --git a/deluge/ui/gtkui/glade/preferences_dialog.ui b/deluge/ui/gtkui/glade/preferences_dialog.ui index 245e33d17..5936447b4 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.ui +++ b/deluge/ui/gtkui/glade/preferences_dialog.ui @@ -2,6 +2,52 @@ + + 999999 + 100 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + + + 65535 + 1 + 10 + 1 32000 @@ -9,12 +55,6 @@ 1 10 - - 999999 - 100 - 1 - 10 - 0.5 100 @@ -106,46 +146,6 @@ 1 10 - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - -1 9999 @@ -410,6 +410,7 @@ True True + False @@ -937,6 +938,55 @@ used sparingly. 1 + + + True + False + 0 + none + + + True + False + 0 + 0 + 1 + 12 + + + True + True + The IP address of the interface to listen for incoming bittorrent connections on. Leave this empty if you want to use the default. + 15 + 15 + True + False + False + True + True + + + + + + + True + False + 2 + Incoming Address + + + + + + + + False + False + 2 + 2 + + True @@ -947,86 +997,12 @@ used sparingly. True False - 2 - 2 + 1 12 True False - - - True - False - 20 - - - Use Random Ports - False - True - True - False - Deluge will automatically choose a different port to use every time. - True - - - - False - True - 5 - 0 - - - - - True - False - - - True - False - 1 - Active Port: - right - - - False - True - 5 - 0 - - - - - True - False - 0 - 0000 - 5 - - - False - True - 5 - 1 - - - - - False - True - 5 - 1 - - - - - True - True - 5 - 0 - - True @@ -1102,6 +1078,81 @@ used sparingly. 3 + + + Random + False + True + True + False + Uses random ports in range 49152 to 65525 + True + + + + False + True + 5 + 4 + + + + + True + True + 5 + 0 + + + + + True + False + 10 + + + True + False + + + True + False + 0 + Active Port: + right + + + False + True + 0 + + + + + 50 + True + False + 0 + 0 + 5 + + + + + + False + True + 5 + 1 + + + + + False + True + 0 + + Test Active Port @@ -1109,35 +1160,36 @@ used sparingly. True True True + right False False - 4 + 1 True False - 5 + 0 False - gtk-missing-image + gtk-dialog-question False True - 5 + 2 - True + False True 5 1 @@ -1151,6 +1203,7 @@ used sparingly. True False + 2 Incoming Ports @@ -1161,8 +1214,8 @@ used sparingly. False True - 5 - 2 + 2 + 3 @@ -1175,22 +1228,18 @@ used sparingly. True False - 5 + 1 12 - + True False 5 - - Use Random Ports - False + True - True - False - True - + False + From: False @@ -1199,87 +1248,80 @@ used sparingly. - + True - False - 5 - - - True - False - From: - - - False - False - 0 - - - - - True - False - True - 5 - 1 - False - False - True - True - adjustment_spin_outgoing_port_min - 1 - True - True - - - False - True - 5 - 1 - - - - - True - False - To: - - - False - False - 2 - - - - - True - False - True - 5 - 1 - False - False - True - True - adjustment_spin_outgoing_port_max - 1 - True - True - - - False - True - 5 - 3 - - + False + True + 5 + 1 + False + False + True + True + adjustment_spin_outgoing_port_min + 1 + True + True - True + False True + 5 1 + + + True + False + To: + + + False + False + 2 + + + + + True + False + True + 5 + 1 + False + False + True + True + adjustment_spin_outgoing_port_max + 1 + True + True + + + False + True + 5 + 3 + + + + + Random + False + True + True + False + Uses random ports in range 49152 to 65525 + True + + + + False + False + 4 + + @@ -1288,6 +1330,7 @@ used sparingly. True False + 2 Outgoing Ports @@ -1298,39 +1341,92 @@ used sparingly. False False - 3 + 2 + 4 - + True False 0 none - + True False - 2 - 2 12 - + True False + 5 - + True - True - Enter the IP address of the interface to listen for incoming bittorrent connections on. Leave this empty if you want to use the default. - 60 - - 30 - True - False - False - True - True + False + 2 + 2 + + + True + False + liststore3 + + + + + 0 + + + + + 1 + 2 + 1 + 2 + 5 + + + + + True + False + liststore1 + + + + + 0 + + + + + 1 + 2 + 5 + + + + + True + False + 1 + Outgoing: + + + 1 + 2 + + + + + True + False + 1 + Incoming: + + False @@ -1339,17 +1435,65 @@ used sparingly. - + + True + False + 0 + + + True + False + + + True + False + 0 + 5 + Level: + + + True + True + 0 + + + + + True + False + liststore2 + + + + 0 + + + + + True + True + 1 + + + + + + + False + False + 1 + - + True False - Interface + 2 + Encryption @@ -1359,87 +1503,6 @@ used sparingly. False False - 4 - - - - - True - False - 0 - none - - - True - False - 2 - 2 - 12 - - - True - False - - - True - False - 5 - - - True - False - The TOS byte set in the IP header of every packet sent to peers (including web seeds). Expects a Hex value. - Peer TOS Byte: - - - False - False - 0 - - - - - True - True - 4 - 0x00 - True - False - False - True - True - - - False - False - 1 - - - - - True - True - 0 - - - - - - - - - True - False - TOS - - - - - - - - False - True 5 5 @@ -1461,9 +1524,10 @@ used sparingly. True False - 2 + 3 3 - 5 + 6 + 1 UPnP @@ -1513,7 +1577,6 @@ used sparingly. 2 3 - GTK_FILL @@ -1533,7 +1596,6 @@ used sparingly. 3 1 2 - GTK_FILL @@ -1572,7 +1634,50 @@ used sparingly. - + + True + False + + + True + False + TOS can help with network conjestion. This value is included in every IPv4 packet header sent to peers (inc. web seeds). +Requires a Hex value. + 3 + Peer TOS Byte: + + + False + False + 0 + + + + + 25 + True + True + 4 + 4 + 0x00 + True + False + False + True + True + + + False + False + 1 + + + + + 3 + 2 + 3 + @@ -1582,6 +1687,7 @@ used sparingly. True False + 2 Network Extras @@ -1596,200 +1702,6 @@ used sparingly. 6 - - - True - False - 0 - none - - - True - False - 2 - 2 - 12 - - - True - False - 5 - - - True - False - - - True - False - 1 - Inbound: - - - True - True - 0 - - - - - True - False - 0 - Level: - - - True - True - 1 - - - - - False - False - 0 - - - - - True - False - - - True - False - liststore1 - - - - 0 - - - - - True - True - 0 - - - - - True - False - liststore2 - - - - 0 - - - - - True - True - 1 - - - - - False - False - 1 - - - - - True - False - - - True - False - - - True - False - 1 - Outbound: - - - False - False - 0 - - - - - True - False - liststore3 - - - - 0 - - - - - False - True - 1 - - - - - True - True - 0 - - - - - Encrypt entire stream - False - True - True - False - True - True - - - False - True - 3 - 1 - - - - - True - True - 2 - - - - - - - - - True - False - Encryption - - - - - - - - False - False - 5 - 7 - - @@ -2520,6 +2432,35 @@ used sparingly. 1 + + + False + True + True + False + Besides being experimental, using the pieces bar +will increase the bandwidth used between client +and daemon(does not apply in classic mode). +Use at your own risk if you wish to help us debug +this new feature. + True + + + + True + False + Show a pieces bar in the torrent's +status tab (<b>EXPERIMENTAL!!!</b>) + True + + + + + True + True + 2 + + True @@ -2756,35 +2697,6 @@ used sparingly. 2 - - - False - True - True - False - Besides being experimental, using the pieces bar -will increase the bandwidth used between client -and daemon(does not apply in classic mode). -Use at your own risk if you wish to help us debug -this new feature. - True - - - - True - False - Show a pieces bar in the torrent's -status tab (<b>EXPERIMENTAL!!!</b>) - True - - - - - True - True - 2 - - diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 94be00b5e..18db272af 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -161,6 +161,7 @@ class Preferences(component.Component): "on_button_rescan_plugins_clicked": self._on_button_rescan_plugins_clicked, "on_button_find_plugins_clicked": self._on_button_find_plugins_clicked, "on_button_cache_refresh_clicked": self._on_button_cache_refresh_clicked, + "on_combo_encryption_changed": self._on_combo_encryption_changed, "on_combo_proxy_type_changed": self._on_combo_proxy_type_changed, "on_button_associate_magnet_clicked": self._on_button_associate_magnet_clicked, "on_accounts_add_clicked": self._on_accounts_add_clicked, @@ -337,7 +338,6 @@ class Preferences(component.Component): "combo_encin": ("active", self.core_config["enc_in_policy"]), "combo_encout": ("active", self.core_config["enc_out_policy"]), "combo_enclevel": ("active", self.core_config["enc_level"]), - "chk_pref_rc4": ("active", self.core_config["enc_prefer_rc4"]), "spin_max_connections_global": \ ("value", self.core_config["max_connections_global"]), "spin_max_download": \ @@ -493,7 +493,6 @@ class Preferences(component.Component): "combo_encin", "combo_encout", "combo_enclevel", - "chk_pref_rc4", "spin_max_connections_global", "spin_max_download", "spin_max_upload", @@ -696,8 +695,6 @@ class Preferences(component.Component): self.builder.get_object("combo_encout").get_active() new_core_config["enc_level"] = \ self.builder.get_object("combo_enclevel").get_active() - new_core_config["enc_prefer_rc4"] = \ - self.builder.get_object("chk_pref_rc4").get_active() ## Bandwidth tab ## new_core_config["max_connections_global"] = \ @@ -1077,6 +1074,17 @@ class Preferences(component.Component): def _on_button_find_plugins_clicked(self, widget): deluge.common.open_url_in_browser("http://dev.deluge-torrent.org/wiki/Plugins") + def _on_combo_encryption_changed(self, widget): + combo_encin = self.builder.get_object("combo_encin").get_active() + combo_encout = self.builder.get_object("combo_encout").get_active() + combo_enclevel = self.builder.get_object("combo_enclevel") + + # If incoming and outgoing both set to disabled, disable level combobox + if combo_encin == 2 and combo_encout == 2: + combo_enclevel.set_sensitive(False) + else: + combo_enclevel.set_sensitive(True) + def _on_combo_proxy_type_changed(self, widget): name = widget.get_name().replace("combo_proxy_type_", "") proxy_type = widget.get_model()[widget.get_active()][0] diff --git a/deluge/ui/web/js/deluge-all/preferences/EncryptionPage.js b/deluge/ui/web/js/deluge-all/preferences/EncryptionPage.js index a259529d3..7c306ba27 100644 --- a/deluge/ui/web/js/deluge-all/preferences/EncryptionPage.js +++ b/deluge/ui/web/js/deluge-all/preferences/EncryptionPage.js @@ -1,6 +1,6 @@ /*! * Deluge.preferences.EncryptionPage.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -39,12 +39,12 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, { border: false, title: _('Encryption'), - + initComponent: function() { Deluge.preferences.Encryption.superclass.initComponent.call(this); var optMan = deluge.preferences.getOptionsManager(); - + var fieldset = this.add({ xtype: 'fieldset', border: false, @@ -54,7 +54,8 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, { width: 300 }); optMan.bind('enc_in_policy', fieldset.add({ - fieldLabel: _('Inbound'), + fieldLabel: _('Incoming:'), + labelSeparator : '', mode: 'local', width: 150, store: new Ext.data.ArrayStore({ @@ -71,7 +72,8 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, { displayField: 'text' })); optMan.bind('enc_out_policy', fieldset.add({ - fieldLabel: _('Outbound'), + fieldLabel: _('Outgoing:'), + labelSeparator : '', mode: 'local', width: 150, store: new Ext.data.SimpleStore({ @@ -88,7 +90,8 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, { displayField: 'text' })); optMan.bind('enc_level', fieldset.add({ - fieldLabel: _('Level'), + fieldLabel: _('Level:'), + labelSeparator : '', mode: 'local', width: 150, store: new Ext.data.SimpleStore({ @@ -104,12 +107,5 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, { 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') - })); } }); diff --git a/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js b/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js index 250a070a5..ad2a79ef2 100644 --- a/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js +++ b/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js @@ -45,6 +45,22 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { Deluge.preferences.Network.superclass.initComponent.call(this); var optMan = deluge.preferences.getOptionsManager(); + fieldset = this.add({ + xtype: 'fieldset', + border: false, + title: _('Incoming Address'), + style: 'margin-bottom: 5px; padding-bottom: 0px;', + autoHeight: true, + labelWidth: 1, + defaultType: 'textfield' + }); + optMan.bind('listen_interface', fieldset.add({ + name: 'listen_interface', + fieldLabel: '', + labelSeparator: '', + width: 200 + })); + var fieldset = this.add({ xtype: 'fieldset', border: false, @@ -79,7 +95,8 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { style: 'margin-right: 10px;' }, items: [{ - fieldLabel: 'From', + fieldLabel: 'From:', + labelSeparator: '', strategy: { xtype: 'number', decimalPrecision: 0, @@ -87,7 +104,8 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { maxValue: 99999 } }, { - fieldLabel: 'To', + fieldLabel: 'To:', + labelSeparator: '', strategy: { xtype: 'number', decimalPrecision: 0, @@ -132,7 +150,8 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { style: 'margin-right: 10px;' }, items: [{ - fieldLabel: 'From', + fieldLabel: 'From:', + labelSeparator: '', strategy: { xtype: 'number', decimalPrecision: 0, @@ -140,7 +159,8 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { maxValue: 99999 } }, { - fieldLabel: 'To', + fieldLabel: 'To:', + labelSeparator: '', strategy: { xtype: 'number', decimalPrecision: 0, @@ -151,37 +171,6 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { }); optMan.bind('outgoing_ports', this.outgoingPorts); - fieldset = this.add({ - xtype: 'fieldset', - border: false, - title: _('Network Interface'), - style: 'margin-bottom: 5px; padding-bottom: 0px;', - autoHeight: true, - labelWidth: 1, - defaultType: 'textfield' - }); - optMan.bind('listen_interface', fieldset.add({ - name: 'listen_interface', - fieldLabel: '', - labelSeparator: '', - width: 200 - })); - - fieldset = this.add({ - xtype: 'fieldset', - border: false, - title: _('TOS'), - style: 'margin-bottom: 5px; padding-bottom: 0px;', - bodyStyle: 'margin: 0px; padding: 0px', - autoHeight: true, - defaultType: 'textfield' - }); - optMan.bind('peer_tos', fieldset.add({ - name: 'peer_tos', - fieldLabel: _('Peer TOS Byte'), - width: 80 - })); - fieldset = this.add({ xtype: 'fieldset', border: false, @@ -233,5 +222,21 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, { ctCls: 'x-deluge-indent-checkbox', name: 'lt_tex' })); + + fieldset = this.add({ + xtype: 'fieldset', + border: false, + title: _('Type Of Service'), + style: 'margin-bottom: 5px; padding-bottom: 0px;', + bodyStyle: 'margin: 0px; padding: 0px', + autoHeight: true, + defaultType: 'textfield' + }); + optMan.bind('peer_tos', fieldset.add({ + name: 'peer_tos', + fieldLabel: _('Peer TOS Byte:'), + labelSeparator: '', + width: 40 + })); } });