Ticket #2472: anonymous_mode.patch

File anonymous_mode.patch, 3.2 KB (added by Doadin, 10 years ago)
  • deluge/core/preferencesmanager.py

    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  
    131131    "peer_tos": "0x00", 
    132132    "rate_limit_ip_overhead": True, 
    133133    "rate_limit_utp": True, 
     134        "anonymous_mode": False, 
    134135    "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", 
    135136    "cache_size": 512, 
    136137    "cache_expiry": 60, 
    def _on_set_rate_limit_ip_overhead(self, key, value): 
    447448    def _on_set_rate_limit_utp(self, key, value): 
    448449        log.debug("%s: %s", key, value) 
    449450        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) 
    450455 
    451456    def _on_set_geoip_db_location(self, key, value): 
    452457        log.debug("%s: %s", key, value) 
  • deluge/ui/console/modes/preference_panes.py

    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): 
    441441        i2p_proxy = parent.core_config["i2p_proxy"] 
    442442        self.add_text_input("i2p_hostname", "Hostname:", i2p_proxy["hostname"]) 
    443443        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"]) 
    444446 
    445447 
    446448class CachePane(BasePane): 
  • deluge/ui/gtkui/preferences.py

    diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
    index 47b9fae..738204e 100644
    a b def _show(self): 
    387387            "chk_ignore_limits_on_local_network": ("active", "ignore_limits_on_local_network"), 
    388388            "chk_rate_limit_ip_overhead": ("active", "rate_limit_ip_overhead"), 
    389389            "chk_rate_limit_utp": ("active", "rate_limit_utp"), 
     390                        "chk_anonymous_mode": ("active", "anonymous_mode"), 
    390391            "spin_max_connections_per_torrent": ("value", "max_connections_per_torrent"), 
    391392            "spin_max_upload_slots_per_torrent": ("value", "max_upload_slots_per_torrent"), 
    392393            "spin_max_download_per_torrent": ("value", "max_download_speed_per_torrent"), 
    def set_config(self, hide=False): 
    702703        new_core_config["i2p_proxy"] = {} 
    703704        new_core_config["i2p_proxy"]["hostname"] = self.builder.get_object("entry_i2p_host").get_text() 
    704705        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() 
    705708 
    706709        ## Queue tab ## 
    707710        new_core_config["queue_new_to_top"] = \