Implement #79 ability to change outgoing port range

This commit is contained in:
Andrew Resch 2008-07-30 05:37:17 +00:00
parent e93e1391a4
commit efb4462d37
4 changed files with 628 additions and 520 deletions

View File

@ -1,41 +1,4 @@
Deluge 1.1.0 - "" (In Development)
Deluge 0.9.04 - "1.0.0_RC4" (In Development)
Deluge 0.9.03 - "1.0.0_RC3" (21 July 2008)
Core:
* File progress fixes from libtorrent
* Fix building on FreeBSD
* Fix #350 stop seeds when stop ratio is reached
* Fix #358 properly emit torrent_removed signal when remove_at_ratio happens
* Implement #79 ability to change outgoing port range
UI:
* Default to gtkui when running 'deluge' instead of defaulting to last used.
GtkUI:
* Fix open folder
* Fix #349 tab ordering when hiding/showing
Windows:
* Fix torrent file association and adding files from command line
Plugins:
* Blocklist plugin has been rewritten
Misc:
* Some changes for python 2.6 compatibility
Deluge 0.9.02 - "1.0.0_RC2" (15 July 2008)
Core:
* Fix displaying of file progress
* Fix files to have proper read/write permissions
WebUI:
* Include missing 'classic' template
* Update options tab to include queue settings
Windows:
* Fix displaying of tray icon
* Fix scrolling of tray menu
* Fix hiding of tray icon when shutting down
* Fix tray icon tool tip length to show properly

View File

@ -116,6 +116,8 @@ DEFAULT_PREFS = {
"proxy_username" : "",
"proxy_password" : "",
"proxy_port": 8080,
"outgoing_ports": [0, 0],
"random_outgoing_ports": True
}
class Core(
@ -233,6 +235,10 @@ class Core(
self._on_set_listen_ports)
self.config.register_set_function("random_port",
self._on_set_random_port)
self.config.register_set_function("outgoing_ports",
self._on_set_outgoing_ports)
self.config.register_set_function("random_outgoing_ports",
self._on_set_random_outgoing_ports)
self.config.register_set_function("dht", self._on_set_dht)
self.config.register_set_function("upnp", self._on_set_upnp)
self.config.register_set_function("natpmp", self._on_set_natpmp)
@ -758,6 +764,15 @@ class Core(
listen_ports[1])
self.session.listen_on(listen_ports[0], listen_ports[1])
def _on_set_outgoing_ports(self, key, value):
if not self.config["random_outgoing_ports"]:
log.debug("outgoing port range set to %s-%s", value[0], value[1])
self.session.outgoing_ports(value[0], value[1])
def _on_set_random_outgoing_ports(self, key, value):
if value:
self.session.outgoing_ports(0, 0)
def _on_set_dht(self, key, value):
log.debug("dht value set to %s", value)
state_file = deluge.common.get_default_config_dir('dht.state')

File diff suppressed because it is too large Load Diff

View File

@ -214,6 +214,9 @@ class Preferences(component.Component):
"spin_port_max": ("value", self.core_config["listen_ports"][1]),
"active_port_label": ("text", str(self.active_port)),
"chk_random_port": ("active", self.core_config["random_port"]),
"spin_outgoing_port_min": ("value", self.core_config["outgoing_ports"][0]),
"spin_outgoing_port_max": ("value", self.core_config["outgoing_ports"][1]),
"chk_random_outgoing_ports": ("active", self.core_config["random_outgoing_ports"]),
"chk_dht": ("active", self.core_config["dht"]),
"chk_upnp": ("active", self.core_config["upnp"]),
"chk_natpmp": ("active", self.core_config["natpmp"]),
@ -346,6 +349,9 @@ class Preferences(component.Component):
"spin_port_max",
"active_port_label",
"chk_random_port",
"spin_outgoing_port_min",
"spin_outgoing_port_max",
"chk_random_outgoing_ports",
"chk_dht",
"chk_upnp",
"chk_natpmp",
@ -520,6 +526,15 @@ class Preferences(component.Component):
new_core_config["listen_ports"] = listen_ports
new_core_config["random_port"] = \
self.glade.get_widget("chk_random_port").get_active()
outgoing_ports = []
outgoing_ports.append(
self.glade.get_widget("spin_outgoing_port_min").get_value_as_int())
outgoing_ports.append(
self.glade.get_widget("spin_outgoing_port_max").get_value_as_int())
new_core_config["outgoing_ports"] = outgoing_ports
new_core_config["random_outgoing_ports"] = \
self.glade.get_widget("chk_random_outgoing_ports").get_active()
new_core_config["dht"] = self.glade.get_widget("chk_dht").get_active()
new_core_config["upnp"] = self.glade.get_widget("chk_upnp").get_active()
new_core_config["natpmp"] = \
@ -705,6 +720,8 @@ class Preferences(component.Component):
"chk_show_dialog": {"chk_focus_dialog": True},
"chk_random_port": {"spin_port_min": False,
"spin_port_max": False},
"chk_random_outgoing_ports": {"spin_port_outgoing_min": False,
"spin_port_outgoing_max": False},
"chk_use_tray": {"chk_min_on_close": True,
"chk_start_in_tray": True,
"chk_lock_tray": True},