diff --git a/ChangeLog b/ChangeLog index 9aae66246..217d720ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 - - UI: - * Default to gtkui when running 'deluge' instead of defaulting to last used. + * Implement #79 ability to change outgoing port range - 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 diff --git a/deluge/core/core.py b/deluge/core/core.py index ae2b076e1..b9d42d5e0 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -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') diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 9bce6876d..afa2f3990 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -1,6 +1,7 @@ - + + + - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 @@ -561,8 +562,8 @@ page 6 - False tab + False @@ -771,7 +772,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Ports</b> + <b>Incoming Ports</b> True @@ -785,6 +786,118 @@ 2 + + + True + 0 + GTK_SHADOW_NONE + + + True + 5 + 12 + + + True + 5 + + + True + 5 + + + True + From: + + + False + False + + + + + True + False + True + 5 + 1 + 0 0 65535 1 10 10 + 1 + True + True + + + False + 5 + 1 + + + + + True + To: + + + False + False + 2 + + + + + True + False + True + 5 + 1 + 0 0 65535 1 10 10 + 1 + True + True + + + False + 5 + 3 + + + + + + + True + True + Use Random Ports + 0 + True + + + False + False + 1 + + + + + + + + + True + <b>Outgoing Ports</b> + True + + + label_item + + + + + False + False + 3 + + True @@ -828,7 +941,7 @@ False 5 - 3 + 4 @@ -930,7 +1043,7 @@ False 5 - 4 + 5 @@ -1078,7 +1191,7 @@ Disabled False False 5 - 5 + 6 @@ -1097,9 +1210,9 @@ Disabled page 7 + tab 1 False - tab @@ -1165,40 +1278,127 @@ Disabled 2 15 - + True True - The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9000 1 10 10 - 1 - True + -1 -1 9999 1 10 10 True 1 2 + 5 + 6 + GTK_FILL + + + + + True + True + 1 + -1 -1 9999 1 10 10 + True + + + 1 + 2 + 4 + 5 + GTK_FILL + + + + + True + 0 + Maximum Connection Attempts per Second: + + + 5 + 6 + GTK_FILL + + + + + True + 0 + Maximum Half-Open Connections: + + + 4 + 5 + GTK_FILL + + + + + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 0 + Maximum Upload Speed (KiB/s): + + + 3 + 4 + GTK_FILL + + + + + True + The maximum number of connections allowed. Set -1 for unlimited. + 0 + Maximum Connections: + + + GTK_FILL + + + + + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 0 + Maximum Upload Slots: + + 1 2 GTK_FILL - + True True - The maximum upload speed for all torrents. Set -1 for unlimited. + The maximum number of connections allowed. Set -1 for unlimited. + 4 1 -1 -1 9000 1 10 10 1 - 1 + True True + GTK_UPDATE_IF_VALID 1 2 - 3 - 4 + GTK_FILL + + + + + True + The maximum download speed for all torrents. Set -1 for unlimited. + 0 + Maximum Download Speed (KiB/s): + + + 2 + 3 GTK_FILL @@ -1223,127 +1423,40 @@ Disabled - - True - The maximum download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 - GTK_FILL - - - - + True True - The maximum number of connections allowed. Set -1 for unlimited. - 4 + The maximum upload speed for all torrents. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 - True + 1 True - GTK_UPDATE_IF_VALID 1 2 - GTK_FILL - - - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Slots: - - - 1 - 2 - GTK_FILL - - - - - True - The maximum number of connections allowed. Set -1 for unlimited. - 0 - Maximum Connections: - - - GTK_FILL - - - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Speed (KiB/s): - - 3 4 GTK_FILL - - True - 0 - Maximum Half-Open Connections: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - Maximum Connection Attempts per Second: - - - 5 - 6 - GTK_FILL - - - - + True True + The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9999 1 10 10 + -1 -1 9000 1 10 10 + 1 + True True 1 2 - 4 - 5 - GTK_FILL - - - - - True - True - 1 - -1 -1 9999 1 10 10 - True - - - 1 - 2 - 5 - 6 + 1 + 2 GTK_FILL @@ -1411,18 +1524,85 @@ Disabled 2 15 - + True True - The maximum number of connections per torrent. Set -1 for unlimited. + The maximum upload slots per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - 1 + 1 + True True 1 2 + 1 + 2 + GTK_FILL + + + + + True + True + The maximum number of connections per torrent. Set -1 for unlimited. + 1 + -1 -1 9000 1 10 10 + True + True + + + 1 + 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Connections: + + + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Upload Slots: + + + 1 + 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Download Speed (KiB/s): + + + 2 + 3 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Upload Speed (KiB/s): + + 3 4 GTK_FILL @@ -1447,87 +1627,20 @@ Disabled - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Upload Speed (KiB/s): - - - 3 - 4 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Upload Slots: - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Connections: - - - GTK_FILL - - - - + True True The maximum number of connections per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - True + 1 True 1 2 - GTK_FILL - - - - - True - True - The maximum upload slots per torrent. Set -1 for unlimited. - 1 - -1 -1 9000 1 10 10 - 1 - True - True - - - 1 - 2 - 1 - 2 + 3 + 4 GTK_FILL @@ -1569,9 +1682,9 @@ Disabled page 8 + tab 2 False - tab @@ -1820,9 +1933,9 @@ Disabled page 10 + tab 3 False - tab @@ -2041,9 +2154,9 @@ Disabled page 11 + tab 4 False - tab @@ -2235,9 +2348,9 @@ Disabled page 11 + tab 5 False - tab @@ -2356,15 +2469,59 @@ Disabled 2 10 - + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + 2 + 3 + + + + + + True + 0 + Total active seeding: + + + 2 + 3 + GTK_FILL + + + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active downloading: + Total active: - 1 - 2 GTK_FILL @@ -2387,62 +2544,18 @@ Disabled - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active: + Total active downloading: + 1 + 2 GTK_FILL - - - True - 0 - Total active seeding: - - - 2 - 3 - GTK_FILL - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - 2 - 3 - - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - - - @@ -2503,18 +2616,51 @@ Disabled 2 10 - + + True + 0 + Share Ratio Limit: + + + GTK_FILL + + + + + True + 0 + Seed Time Ratio: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Seed Time (m): + + + 2 + 3 + GTK_FILL + + + + True True 6 1 - 6 -1 100 1 10 10 + 1.5 -1 100 0.10000000000000001 10 10 + 2 1 2 - 2 - 3 @@ -2536,52 +2682,19 @@ Disabled - + True True 6 1 - 1.5 -1 100 0.10000000000000001 10 10 - 2 + 6 -1 100 1 10 10 1 2 - - - - - - True - 0 - Seed Time (m): - - 2 3 - GTK_FILL - - - - - True - 0 - Seed Time Ratio: - - - 1 - 2 - GTK_FILL - - - - - True - 0 - Share Ratio Limit: - - - GTK_FILL + @@ -2694,9 +2807,9 @@ Disabled page 12 + tab 6 False - tab @@ -2756,86 +2869,43 @@ Disabled 2 5 - + True - 0 - 0 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 65000 1 10 10 - True - - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 - 4 - 5 - - - - - True - 0 - Port: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - Host: - - 3 4 - GTK_FILL - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Password: + False + 1 + 2 2 3 - GTK_FILL - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Username: + 1 + 2 1 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Type: - - - GTK_FILL @@ -2856,43 +2926,86 @@ HTTP W/ Auth - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Type: + + + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Username: - 1 - 2 1 2 + GTK_FILL - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False + 0 + Password: - 1 - 2 2 3 + GTK_FILL - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Host: + + + 3 + 4 + GTK_FILL + + + + + True + 0 + Port: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + 0 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 65000 1 10 10 + True + + 1 2 - 3 - 4 + 4 + 5 @@ -2993,27 +3106,17 @@ HTTP W/ Auth 2 5 - - True - - - 1 - 2 - 2 - 3 - - - - + True True - Blinking tray icon + Sound: True 0 True - 2 + 2 + 3 GTK_FILL @@ -3034,18 +3137,28 @@ HTTP W/ Auth - + True True - Sound: + Blinking tray icon True 0 True + 2 + GTK_FILL + + + + + True + + + 1 + 2 2 3 - GTK_FILL @@ -3086,115 +3199,14 @@ HTTP W/ Auth 2 5 - - True - True - Enable - 0 - True - - - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - + True 0 - Address: + Security: - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 2 - 3 - - - - - True - 0 - Server: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 3 - 4 - - - - - True - 0 - Username: - - - 3 - 4 - GTK_FILL - - - - - True - True - False - - - 1 - 2 - 4 - 5 - - - - - True - 0 - Password: - - - 4 - 5 + 5 + 6 GTK_FILL @@ -3257,17 +3269,118 @@ HTTP W/ Auth - + True 0 - Security: + Password: - 5 - 6 + 4 + 5 GTK_FILL + + + True + True + False + + + 1 + 2 + 4 + 5 + + + + + True + 0 + Username: + + + 3 + 4 + GTK_FILL + + + + + True + True + + + 1 + 2 + 3 + 4 + + + + + True + 0 + Server: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + True + 0 + Address: + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + True + Enable + 0 + True + + + 2 + GTK_FILL + GTK_FILL + + diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 5bc9d43bc..d8725ca09 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -147,7 +147,7 @@ class Preferences(component.Component): self.page_num_to_remove = model.get_value(iter, 0) self.iter_to_remove = iter return - + self.liststore.foreach(check_row, name) # Remove the page and row if self.page_num_to_remove != None: @@ -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},