From 0ff862e0e32bd7f2b5cc5cd668d9613cba4bafcb Mon Sep 17 00:00:00 2001
From: Doadin <tbkizle@gmail.com>
Date: Fri, 4 Jul 2014 00:12:39 -0400
Subject: [PATCH] Add Support for anonymous_mode
---
deluge/core/preferencesmanager.py | 5 +++++
deluge/ui/console/modes/preference_panes.py | 2 ++
deluge/ui/gtkui/preferences.py | 3 +++
3 files changed, 10 insertions(+)
diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
index 064c202..47332cf 100644
a
|
b
|
|
131 | 131 | "peer_tos": "0x00", |
132 | 132 | "rate_limit_ip_overhead": True, |
133 | 133 | "rate_limit_utp": True, |
| 134 | "anonymous_mode": False, |
134 | 135 | "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", |
135 | 136 | "cache_size": 512, |
136 | 137 | "cache_expiry": 60, |
… |
… |
def _on_set_rate_limit_ip_overhead(self, key, value):
|
447 | 448 | def _on_set_rate_limit_utp(self, key, value): |
448 | 449 | log.debug("%s: %s", key, value) |
449 | 450 | self.session_set_setting("rate_limit_utp", value) |
| 451 | |
| 452 | def _on_set_anonymous_mode(self, key, value): |
| 453 | log.debug("%s: %s", key, value) |
| 454 | self.session_set_setting("anonymous_mode", value) |
450 | 455 | |
451 | 456 | def _on_set_geoip_db_location(self, key, value): |
452 | 457 | log.debug("%s: %s", key, value) |
diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py
index d8e3a89..8b21928 100644
a
|
b
|
def __init__(self, offset, parent, width):
|
441 | 441 | i2p_proxy = parent.core_config["i2p_proxy"] |
442 | 442 | self.add_text_input("i2p_hostname", "Hostname:", i2p_proxy["hostname"]) |
443 | 443 | self.add_int_spin_input("i2p_port", "Port:", i2p_proxy["port"], 0, 65535) |
| 444 | |
| 445 | self.add_checked_input("anonymous_mode","Anonymous Mode",parent.core_config["anonymous_mode"]) |
444 | 446 | |
445 | 447 | |
446 | 448 | class CachePane(BasePane): |
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index 47b9fae..738204e 100644
a
|
b
|
def _show(self):
|
387 | 387 | "chk_ignore_limits_on_local_network": ("active", "ignore_limits_on_local_network"), |
388 | 388 | "chk_rate_limit_ip_overhead": ("active", "rate_limit_ip_overhead"), |
389 | 389 | "chk_rate_limit_utp": ("active", "rate_limit_utp"), |
| 390 | "chk_anonymous_mode": ("active", "anonymous_mode"), |
390 | 391 | "spin_max_connections_per_torrent": ("value", "max_connections_per_torrent"), |
391 | 392 | "spin_max_upload_slots_per_torrent": ("value", "max_upload_slots_per_torrent"), |
392 | 393 | "spin_max_download_per_torrent": ("value", "max_download_speed_per_torrent"), |
… |
… |
def set_config(self, hide=False):
|
702 | 703 | new_core_config["i2p_proxy"] = {} |
703 | 704 | new_core_config["i2p_proxy"]["hostname"] = self.builder.get_object("entry_i2p_host").get_text() |
704 | 705 | new_core_config["i2p_proxy"]["port"] = self.builder.get_object("spin_i2p_port").get_value_as_int() |
| 706 | new_core_config["anonymous_mode"] = \ |
| 707 | self.builder.get_object("chk_anonymous_mode").get_active() |
705 | 708 | |
706 | 709 | ## Queue tab ## |
707 | 710 | new_core_config["queue_new_to_top"] = \ |