From fcbc3b48b43cbf8c6600a4d98bfa66fabab52072 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Thu, 21 Jun 2007 23:06:06 +0000 Subject: [PATCH] new proxy redone --- src/core.py | 4 ++-- src/dialogs.py | 18 +++++++++++++----- src/interface.py | 18 ++++++++---------- src/pref.py | 8 ++++++-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/core.py b/src/core.py index ec77b1b00..8a294be0f 100644 --- a/src/core.py +++ b/src/core.py @@ -799,8 +799,8 @@ class Manager: def add_range_to_ip_filter(self, start, end): return deluge_core.add_range_to_IP_filter(start, end) - def proxy_settings(self, server, login, paswd, portnum, proxytype): - return deluge_core.proxy_settings(server, login, paswd, portnum, proxytype) + def proxy_settings(self, server, login, paswd, portnum, proxytype, peerproxy, webseedproxy, trackerproxy, dhtproxy): + return deluge_core.proxy_settings(server, login, paswd, portnum, proxytype, peerproxy, webseedproxy, trackerproxy, dhtproxy) def pe_settings(self, out_enc_policy, in_enc_policy, allowed_enc_level, prefer_rc4): return deluge_core.pe_settings(out_enc_policy, in_enc_policy, allowed_enc_level, prefer_rc4) diff --git a/src/dialogs.py b/src/dialogs.py index 97aee1f85..f62b4be0e 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -54,16 +54,20 @@ class PreferencesDlg: self.glade.get_widget("combo_enclevel").set_active(self.preferences.get("enclevel_type")) self.glade.get_widget("combo_proxy_type").set_active(self.preferences.get("proxy_type")) self.glade.get_widget("chk_pref_rc4").set_active(self.preferences.get("pref_rc4")) + self.glade.get_widget("chk_peer_proxy").set_active(self.preferences.get("peer_proxy")) + self.glade.get_widget("chk_web_seed_proxy").set_active(self.preferences.get("web_seed_proxy")) + self.glade.get_widget("chk_tracker_proxy").set_active(self.preferences.get("tracker_proxy")) + self.glade.get_widget("chk_dht_proxy").set_active(self.preferences.get("dht_proxy")) self.glade.get_widget("chk_upnp").set_active(self.preferences.get("use_upnp")) self.glade.get_widget("chk_natpmp").set_active(self.preferences.get("use_natpmp")) self.glade.get_widget("chk_utpex").set_active(self.preferences.get("use_utpex")) self.glade.get_widget("chk_use_tray").set_active(self.preferences.get("enable_system_tray")) self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray")) - self.glade.get_widget("chk_lock_tray").set_active(self.preferences.get("lock_tray")) - self.glade.get_widget("txt_tray_passwd").set_text(self.preferences.get("tray_passwd")) - self.glade.get_widget("txt_proxy_hostname").set_text(self.preferences.get("proxy_hostname")) - self.glade.get_widget("txt_proxy_username").set_text(self.preferences.get("proxy_username")) - self.glade.get_widget("txt_proxy_password").set_text(self.preferences.get("proxy_password")) + self.glade.get_widget("chk_lock_tray").set_active(self.preferences.get("lock_tray")) + self.glade.get_widget("txt_tray_passwd").set_text(self.preferences.get("tray_passwd")) + self.glade.get_widget("txt_proxy_hostname").set_text(self.preferences.get("proxy_hostname")) + self.glade.get_widget("txt_proxy_username").set_text(self.preferences.get("proxy_username")) + self.glade.get_widget("txt_proxy_password").set_text(self.preferences.get("proxy_password")) if(self.preferences.get("use_default_dir")): self.glade.get_widget("radio_save_all_to").set_active(True) else: @@ -99,6 +103,10 @@ class PreferencesDlg: self.preferences.set("enclevel_type", self.glade.get_widget("combo_enclevel").get_active()) self.preferences.set("proxy_type", self.glade.get_widget("combo_proxy_type").get_active()) self.preferences.set("pref_rc4", self.glade.get_widget("chk_pref_rc4").get_active()) + self.preferences.set("peer_proxy", self.glade.get_widget("chk_peer_proxy").get_active()) + self.preferences.set("web_seed_proxy", self.glade.get_widget("chk_web_seed_proxy").get_active()) + self.preferences.set("tracker_proxy", self.glade.get_widget("chk_tracker_proxy").get_active()) + self.preferences.set("dht_proxy", self.glade.get_widget("chk_dht_proxy").get_active()) self.preferences.set("use_upnp", self.glade.get_widget("chk_upnp").get_active()) self.preferences.set("use_natpmp", self.glade.get_widget("chk_natpmp").get_active()) self.preferences.set("use_utpex", self.glade.get_widget("chk_utpex").get_active()) diff --git a/src/interface.py b/src/interface.py index 8aa1c53c5..936c44e52 100644 --- a/src/interface.py +++ b/src/interface.py @@ -723,7 +723,7 @@ class DelugeGTK: # Apply the preferences in the core self.manager.apply_prefs() self.manager.pe_settings(self.config.get("encout_state"), self.config.get("encin_state"), self.config.get("enclevel_type"), self.config.get("pref_rc4")) - self.manager.proxy_settings(self.config.get("proxy_hostname"), self.config.get("proxy_username"), self.config.get("proxy_password"), int(self.config.get("proxy_port")), self.config.get("proxy_type")) + self.manager.proxy_settings(self.config.get("proxy_hostname"), self.config.get("proxy_username"), self.config.get("proxy_password"), int(self.config.get("proxy_port")), self.config.get("proxy_type"), self.config.get("peer_proxy"), self.config.get("web_seed_proxy"), self.config.get("tracker_proxy"), self.config.get("dht_proxy")) def get_message_from_state(self, torrent_state): state = torrent_state['state'] @@ -1273,14 +1273,14 @@ class DelugeGTK: def load_window_settings(self): self.wtree.get_widget("chk_infopane").set_active(self.config.get("show_infopane")) self.wtree.get_widget("chk_toolbar").set_active(self.config.get("show_toolbar")) - self.wtree.get_widget("chk_size").set_active(self.config.get("show_size",)) + self.wtree.get_widget("chk_size").set_active(self.config.get("show_size")) self.wtree.get_widget("chk_status").set_active(self.config.get("show_status")) - self.wtree.get_widget("chk_seed").set_active(self.config.get("show_seeders",)) - self.wtree.get_widget("chk_peer").set_active(self.config.get("show_peers",)) - self.wtree.get_widget("chk_download").set_active(self.config.get("show_dl",)) - self.wtree.get_widget("chk_upload").set_active(self.config.get("show_ul",)) - self.wtree.get_widget("chk_eta").set_active(self.config.get("show_eta",)) - self.wtree.get_widget("chk_ratio").set_active(self.config.get("show_share",)) + self.wtree.get_widget("chk_seed").set_active(self.config.get("show_seeders")) + self.wtree.get_widget("chk_peer").set_active(self.config.get("show_peers")) + self.wtree.get_widget("chk_download").set_active(self.config.get("show_dl")) + self.wtree.get_widget("chk_upload").set_active(self.config.get("show_ul")) + self.wtree.get_widget("chk_eta").set_active(self.config.get("show_eta")) + self.wtree.get_widget("chk_ratio").set_active(self.config.get("show_share")) self.wtree.get_widget("vpaned1").set_position(self.config.get("window_height") - self.config.get("window_pane_position")) def save_window_settings(self): @@ -1353,5 +1353,3 @@ class DelugeGTK: if __name__ == "__main__": interface = DelugeGTK() interface.start() - - diff --git a/src/pref.py b/src/pref.py index 1d0d85655..c67bebc9a 100644 --- a/src/pref.py +++ b/src/pref.py @@ -57,11 +57,15 @@ DEFAULT_PREFS = { "max_download_rate_bps": -1.0, "max_number_downloads" : -1.0, "max_number_uploads" : -1.0, - "max_upload_rate" : -1.0, - "max_upload_rate_bps" : -1, + "max_upload_rate" : -1, + "max_upload_rate_bps" : -1.0, "max_uploads" : 2, "pref_rc4" : True, "proxy_type" : common.ProxyType.none, + "peer_proxy" : False, + "web_seed_proxy" : False, + "tracker_proxy" : False, + "dht_proxy" : False, "proxy_hostname" : "", "proxy_username" : "", "proxy_password" : "",