diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py index de720d72b..a136fd323 100644 --- a/deluge/ui/console/modes/preference_panes.py +++ b/deluge/ui/console/modes/preference_panes.py @@ -85,12 +85,11 @@ class BasePane(object): for ipt in self.inputs: if not isinstance(ipt, NoInput): # gross, have to special case in/out ports since they are tuples - if ipt.name in ("listen_ports_to", "listen_ports_from", "out_ports_from", "out_ports_to", + if ipt.name in ("listen_interface", "listen_port", "out_ports_from", "out_ports_to", "i2p_port", "i2p_hostname", "proxy_type", "proxy_username", "proxy_hostnames", - "proxy_password", "proxy_hostname", "proxy_port", "proxy_peer_connections", - "listen_interface"): - if ipt.name == "listen_ports_to": - conf_dict["listen_ports"] = (self.infrom.get_value(), self.into.get_value()) + "proxy_password", "proxy_hostname", "proxy_port", "proxy_peer_connections"): + if ipt.name == "listen_port": + conf_dict["listen_ports"] = [self.infrom.get_value()] * 2 elif ipt.name == "out_ports_to": conf_dict["outgoing_ports"] = (self.outfrom.get_value(), self.outto.get_value()) elif ipt.name == "listen_interface": @@ -309,17 +308,14 @@ class DownloadsPane(BasePane): class NetworkPane(BasePane): def __init__(self, offset, parent, width): BasePane.__init__(self, offset, parent, width) - self.add_header("Incomming Ports") - inrand = CheckedInput(parent, "Use Random Ports Active Port: %d" % parent.active_port, + self.add_header("Incomming Port") + inrand = CheckedInput(parent, "Use Random Port Active Port: %d" % parent.active_port, "random_port", parent.core_config["random_port"]) self.inputs.append(inrand) listen_ports = parent.core_config["listen_ports"] - self.infrom = IntSpinInput(self.parent, " From:", "listen_ports_from", self.move, listen_ports[0], 0, 65535) + self.infrom = IntSpinInput(self.parent, " ", "listen_port", self.move, listen_ports[0], 0, 65535) self.infrom.set_depend(inrand, True) - self.into = IntSpinInput(self.parent, " To: ", "listen_ports_to", self.move, listen_ports[1], 0, 65535) - self.into.set_depend(inrand, True) self.inputs.append(self.infrom) - self.inputs.append(self.into) self.add_header("Outgoing Ports", True) outrand = CheckedInput(parent, "Use Random Ports", "random_outgoing_ports", diff --git a/deluge/ui/gtkui/glade/preferences_dialog.ui b/deluge/ui/gtkui/glade/preferences_dialog.ui index daced7e8c..502d4ac17 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.ui +++ b/deluge/ui/gtkui/glade/preferences_dialog.ui @@ -51,6 +51,11 @@ 1 10 + + 65535 + 1 + 10 + -1 9999 @@ -121,16 +126,6 @@ 1 10 - - 65535 - 1 - 10 - - - 65535 - 1 - 10 - 65535 1 @@ -2796,78 +2791,30 @@ used sparingly. True False - + True - False - From: + False + True + 5 + 1 + False + False + True + True + adjustment_spin_incoming_port + 1 + True + True False True + 5 0 - - True - False - True - 5 - 1 - False - False - True - True - adjustment_spin_port_min - 1 - True - True - - - False - True - 5 - 1 - - - - - True - False - 5 - To: - - - False - False - 2 - - - - - True - False - True - 5 - 1 - False - False - True - True - adjustment_spin_port_max - 1 - True - True - - - False - True - 5 - 3 - - - - + Random False True @@ -2881,7 +2828,7 @@ used sparingly. False True 5 - 4 + 1 @@ -2990,7 +2937,7 @@ used sparingly. True False - Incoming Ports + Incoming Port diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 41390d08e..11b53c876 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -344,9 +344,8 @@ class Preferences(component.Component): "chk_sequential_download": ("active", "sequential_download"), "chk_add_paused": ("active", "add_paused"), "active_port_label": ("text", lambda: str(self.active_port)), - "spin_port_min": ("value", lambda: self.core_config["listen_ports"][0]), - "spin_port_max": ("value", lambda: self.core_config["listen_ports"][1]), - "chk_random_port": ("active", "random_port"), + "spin_incoming_port": ("value", lambda: self.core_config["listen_ports"][0]), + "chk_random_incoming_port": ("active", "random_port"), "spin_outgoing_port_min": ("value", lambda: self.core_config["outgoing_ports"][0]), "spin_outgoing_port_max": ("value", lambda: self.core_config["outgoing_ports"][1]), "chk_random_outgoing_ports": ("active", "random_outgoing_ports"), @@ -561,13 +560,10 @@ class Preferences(component.Component): new_core_config["pre_allocate_storage"] = self.builder.get_object("chk_pre_allocation").get_active() # Network tab # - listen_ports = ( - self.builder.get_object("spin_port_min").get_value_as_int(), - self.builder.get_object("spin_port_max").get_value_as_int() - ) + listen_ports = [self.builder.get_object("spin_incoming_port").get_value_as_int()] * 2 new_core_config["listen_ports"] = listen_ports new_core_config["random_port"] = \ - self.builder.get_object("chk_random_port").get_active() + self.builder.get_object("chk_random_incoming_port").get_active() outgoing_ports = ( self.builder.get_object("spin_outgoing_port_min").get_value_as_int(), self.builder.get_object("spin_outgoing_port_max").get_value_as_int() @@ -842,8 +838,7 @@ class Preferences(component.Component): dependents = { "chk_show_dialog": {"chk_focus_dialog": True}, - "chk_random_port": {"spin_port_min": False, - "spin_port_max": False}, + "chk_random_incoming_port": {"spin_incoming_port": False}, "chk_random_outgoing_ports": {"spin_outgoing_port_min": False, "spin_outgoing_port_max": False}, "chk_use_tray": {"radio_appind": True,