From 9f5b05b4d35a7be96d0690ba4c1d330fe293e042 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 6 Jun 2007 22:26:52 +0000 Subject: [PATCH] prefs, especially encryption, redone by andar --- glade/preferences_dialog.glade | 1512 ++++++++++++++------------------ src/common.py | 7 + src/core.py | 5 +- src/dialogs.py | 59 +- src/interface.py | 36 +- 5 files changed, 667 insertions(+), 952 deletions(-) diff --git a/glade/preferences_dialog.glade b/glade/preferences_dialog.glade index 84b8a22b4..0cc611b59 100644 --- a/glade/preferences_dialog.glade +++ b/glade/preferences_dialog.glade @@ -7,86 +7,82 @@ 5 Deluge Preferences GTK_WIN_POS_CENTER_ON_PARENT - 500 + 550 GDK_WINDOW_TYPE_HINT_DIALOG True True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - 2 - 2 True - Ask me where to save each download + Ask where to save each download + True True - - 2 - - + True - Save all downloads to: - True - radio_ask_save + 10 + + + True + Save all downloads to: + True + True + radio_ask_save + + + False + + + + + True + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + + + 1 + + - 1 - 2 - - - - - True - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - - - 1 - 2 - 1 - 2 + 1 @@ -96,7 +92,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Download Location</b> True @@ -107,47 +102,48 @@ False + 2 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 2 + 10 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Maximum simultaneous active torrents: + + False + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 + The number of active torrents that Deluge will run. Set to 0 for unlimited. 0 0 100 1 10 10 + 1 True GTK_UPDATE_IF_VALID - 1 - 2 - + False + 2 + 1 @@ -157,7 +153,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Torrents</b> True @@ -169,24 +164,26 @@ False False + 2 1 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 True + Compact allocation will only allocate as much storage as it needs to keep the pieces downloaded so far. Use compact storage allocation + True True @@ -195,7 +192,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Compact Allocation</b> True @@ -206,64 +202,64 @@ False + 2 2 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - 2 - 2 True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Queue torrents to bottom when they begin seeding + True True - - 2 - - + True - Stop seeding torrents when their share ratio reaches: - True + 10 + + + True + Stop seeding torrents when their share ratio reaches: + True + True + + + False + + + + + True + True + 0 0 10 0.050000000745099998 10 9 + 1 + 2 + True + + + False + 1 + + - 1 - 2 - - - - - True - True - 5 - 0.5 - 0 0 10 0.050000000000000003 10 9 - 2 - True - - - 1 - 2 - 1 - 2 - + 1 @@ -273,7 +269,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Seeding</b> True @@ -285,11 +280,160 @@ False False + 2 3 - + + True + 0 + + + True + 2 + 2 + 12 + + + True + + + True + True + + + True + 0 + Maximum Connections: + + + + + True + True + The maximum number of connections allowed. Set -1 for unlimited. + -1 -1 1000 1 10 10 + 1 + + + False + False + 1 + + + + + + + True + True + + + True + 0 + Upload Slots: + + + + + True + True + The maximum number of upload slots. Set -1 for unlimited. + -1 -1 100 1 10 10 + 1 + + + False + False + 1 + + + + + 1 + + + + + True + True + + + True + 0 + Maximum Download Rate (KB/s): + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + The maximum download rate for all torrents. Set -1 for unlimited. + -1 -1 100 1 10 10 + 1 + + + False + False + 1 + + + + + 2 + + + + + True + True + + + True + 0 + Maximum Upload Rate (KB/s): + + + + + True + True + The maximum upload rate for all torrents. Set -1 for unlimited. + -1 -1 1024 1 10 10 + 1 + + + False + False + 1 + + + + + 3 + + + + + + + + + True + <b>Bandwidth Usage</b> + True + + + label_item + + + + + False + 4 + @@ -303,7 +447,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Downloads @@ -316,27 +459,57 @@ True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Warning - Changes to these settings will only be applied the next time Deluge is restarted</b> - True - GTK_JUSTIFY_CENTER - True + + + True + 2 + + + True + gtk-dialog-warning + 6 + + + False + False + 10 + + + + + True + 0.20000000298023224 + <b>Please Note - Changes to these settings will only be applied the next time Deluge is restarted.</b> + True + True + 0 + + + False + False + 1 + + + + + False + False + 5 + + False @@ -345,97 +518,109 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - 2 - 4 - - - - + True - Test Port + + + True + From: + + + False + + + + + True + True + 0 0 65535 1 10 10 + 1 + + + False + 5 + 1 + + + + + True + 5 + To: + + + False + False + 2 + + + + + True + True + 0 0 65535 1 10 10 + 1 + + + False + 5 + 3 + + + + + True + 1 + Active Port: + GTK_JUSTIFY_RIGHT + + + False + 5 + 4 + + + + + True + 0 + 0000 + 5 + + + False + 5 + 5 + + + + + True + Test Port + True + + + False + False + 6 + + - 3 - 4 - 1 - 2 + 5 - - - True - 0000 - - - 2 - 3 - 1 - 2 - - - - - True - Active port: - - - 1 - 2 - 1 - 2 - - - - - True - True - 0.5 - 0 0 65535 1 10 10 - - - 3 - 4 - - - - - True - True - 0.5 - 0 0 65535 1 10 10 - - - 1 - 2 - - - - - True - to: - - - 2 - 3 - - - - - True - Try from: - - @@ -443,7 +628,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>TCP Port</b> True @@ -454,62 +638,62 @@ False + 2 1 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - 2 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 0 500 1 10 10 - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Max number of DHT connections: - - - 1 - 2 - - True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Distributed hash table may improve the amount of active connections. Enable Mainline DHT + True True + + + + True + + + True + 23 + Max number of DHT connections: + + + False + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 500 1 10 10 + 1 + + + False + 1 + + + - 2 + 1 @@ -519,7 +703,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>DHT</b> True @@ -530,60 +713,61 @@ False + 2 2 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True False - UPnP - True - True - - - - - True - False - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - NAT-PMP - True + True True + 2 + + + + + True + False + NAT-PMP + True + True + + + 2 1 - + True False - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK UT PeX - True + True True + 2 2 @@ -594,8 +778,7 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Network extras</b> - Always on + <b>Network Extras</b> True @@ -603,6 +786,9 @@ + + 2 + @@ -614,270 +800,108 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - 1 + 2 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_NONE - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Prefer to encrypt the entire stream - True - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Preference</b> - True + 1 + Inbound: - label_item + False - - - 3 - 4 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_NONE - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Handshake - True - True - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Either - True - chk_level_plaintext - - - 1 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Full Stream - True - chk_level_plaintext - - - 2 - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Level</b> - True + Disabled +Enabled +Forced - label_item + 5 + 1 - - - 2 - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Disabled - True - True - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Enabled - True - chk_encout_disabled - - - 1 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Forced - True - chk_encout_disabled - - - 2 - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Outbound</b> - True + 1 + Outbound: - label_item + 2 + + + + + True + Disabled +Enabled +Forced + + + 5 + 3 + + + + + + + True + + + True + True + Prefer to encrypt the entire stream + True + True + + + False + + + + + True + 1 + Level: + + + 1 + + + + + True + Handshake +Either +Full Stream + + + 6 + 2 - 1 - 2 + 1 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Disabled - True - True - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Enabled - True - chk_encin_disabled - - - 1 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Forced - True - chk_encin_disabled - - - 2 - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Inbound</b> - True - - - label_item - - - - @@ -885,7 +909,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Encryption</b> True @@ -897,23 +920,12 @@ False False + 2 4 - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - - - - - - 5 - + @@ -928,7 +940,6 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Network @@ -939,202 +950,119 @@ - + True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE GTK_SHADOW_NONE True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 12 - + True - 5 - 3 - + True + Enable system tray icon + True + True + True + + + + + True + 10 + + + True + Minimize to tray on close + True + True + + - 2 - 3 - 2 - 3 + 1 - + True + 10 + + + True + + + True + True + Password protect system tray + True + True + + + + + True + + + True + 5 + + + True + 0 + Password: + + + + + False + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + * + 16 + + + False + 1 + + + + + 1 + + + + - 2 - 3 - 1 - 2 - - - - - True - KB/s - - - 2 - 3 - 4 - 5 - - - - - - True - True - 10 - 1 - -1 -1 1024 1 10 10 - - - 1 - 2 - 4 - 5 - - - - - - True - 0 - Maximum Upload Rate: - - - 4 - 5 - - - - - True - True - 10 - 1 - -1 -1 1000 1 10 10 - - - 1 - 2 - 1 - 2 - - - - - - True - 0 - Maximum Connections - - - 1 - 2 - - - - - True - 0 - Upload Slots - - - 2 - 3 - - - - - True - 0 - Maximum Download Rate: - - - 3 - 4 - - - - - True - True - 10 - 1 - -1 -1 100 1 10 10 - - - 1 - 2 - 2 - 3 - - - - - - True - True - 10 - 1 - -1 -1 2048 1 10 10 - - - 1 - 2 - 3 - 4 - - - - - - True - KB/s - - - 2 - 3 - 3 - 4 - - - - - - True - <i>(-1 is unlimited)</i> - True - - - 3 + False + 2 @@ -1142,10 +1070,9 @@ - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Bandwidth Usage</b> + <b>System Tray</b> True @@ -1155,13 +1082,69 @@ False + 2 - - - - + + True + 0 + + + True + 2 + 2 + 12 + + + True + 15 + + + True + 0 + GUI update interval (seconds) + + + False + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 0.5 5 0.5 0.5 1 + 1 + 1 + True + + + False + 1 + + + + + + + + + True + <b>Performance</b> + True + + + label_item + + + + + False + False + 2 + 1 + @@ -1176,8 +1159,7 @@ True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Bandwidth + Other tab @@ -1186,233 +1168,27 @@ False - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - 3 - 2 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 - 2 - 3 - - - - - True - Minimize to tray on close - True - - - 2 - 1 - 2 - 12 - - - - - True - Enable system tray icon - True - True - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Password protect system tray - True - - - 2 - 3 - 12 - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>System Tray</b> - True - - - label_item - - - - - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GUI update interval - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - 0.5 0.5 5 0.5 0.5 1 - 1 - True - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - seconds - - - 2 - 3 - - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Performance</b> - True - - - label_item - - - - - False - False - 1 - - - - - - - - - - - - 3 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Other - - - tab - 3 - False - False - - - 1 + 2 + 2 True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_BUTTONBOX_END True - gtk-cancel + gtk-cancel True True - gtk-ok + gtk-ok True 1 diff --git a/src/common.py b/src/common.py index 70833cd7e..136cd57ce 100644 --- a/src/common.py +++ b/src/common.py @@ -106,3 +106,10 @@ def open_url_in_browser(dialog, link): webbrowser.open(link) except webbrowser.Error: print _("Error: no webbrowser found") + +# Encryption States +class EncState: + enabled, disabled, forced = range(3) + +class EncLevel: + plaintext, both, rc4 = range(3) diff --git a/src/core.py b/src/core.py index d7d858715..67b9ddeff 100644 --- a/src/core.py +++ b/src/core.py @@ -750,8 +750,7 @@ class Manager: def create_torrent(self, filename, source_directory, trackers, comments=None, pieces=256, author="Deluge"): - return deluge_core.create_torrent(filename, source_directory, trackers, comments, pieces, author) - 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) + 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 1c4b34c97..95811ba5d 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -38,43 +38,9 @@ class PreferencesDlg: def show(self): # Load settings into dialog try: - if(self.preferences.get("encin_disabled") == "True"): - self.glade.get_widget("chk_encin_disabled").set_active(True) - self.glade.get_widget("chk_encin_enabled").set_active(False) - self.glade.get_widget("chk_encin_forced").set_active(False) - elif(self.preferences.get("encin_enabled") == "True"): - self.glade.get_widget("chk_encin_enabled").set_active(True) - self.glade.get_widget("chk_encin_disabled").set_active(False) - self.glade.get_widget("chk_encin_forced").set_active(False) - elif(self.preferences.get("encin_forced") == "True"): - self.glade.get_widget("chk_encin_forced").set_active(True) - self.glade.get_widget("chk_encin_enabled").set_active(False) - self.glade.get_widget("chk_encin_disabled").set_active(False) - if(self.preferences.get("encout_disabled") == "True"): - self.glade.get_widget("chk_encout_disabled").set_active(True) - self.glade.get_widget("chk_encout_enabled").set_active(False) - self.glade.get_widget("chk_encout_forced").set_active(False) - elif(self.preferences.get("encout_enabled") == "True"): - self.glade.get_widget("chk_encout_enabled").set_active(True) - self.glade.get_widget("chk_encout_disabled").set_active(False) - self.glade.get_widget("chk_encout_forced").set_active(False) - elif(self.preferences.get("encout_forced") == "True"): - self.glade.get_widget("chk_encout_forced").set_active(True) - self.glade.get_widget("chk_encout_enabled").set_active(False) - self.glade.get_widget("chk_encout_disabled").set_active(False) - if(self.preferences.get("level_plaintext") == "True"): - self.glade.get_widget("chk_level_plaintext").set_active(True) - self.glade.get_widget("chk_level_rc4").set_active(False) - self.glade.get_widget("chk_level_both").set_active(False) - elif(self.preferences.get("level_both") == "True"): - self.glade.get_widget("chk_level_both").set_active(True) - self.glade.get_widget("chk_level_plaintext").set_active(False) - self.glade.get_widget("chk_level_rc4").set_active(False) - elif(self.preferences.get("level_rc4") == "True"): - self.glade.get_widget("chk_level_rc4").set_active(True) - self.glade.get_widget("chk_level_both").set_active(False) - self.glade.get_widget("chk_level_plaintext").set_active(False) - + self.glade.get_widget("combo_encin").set_active(self.preferences.get("encin_state", int, default=common.EncState.enabled)) + self.glade.get_widget("combo_encout").set_active(self.preferences.get("encout_state", int, default=common.EncState.enabled)) + self.glade.get_widget("combo_enclevel").set_active(self.preferences.get("enclevel_type", int, default=common.EncLevel.both)) self.glade.get_widget("chk_pref_rc4").set_active(self.preferences.get("pref_rc4", bool, default=True)) self.glade.get_widget("chk_use_tray").set_active(self.preferences.get("enable_system_tray", bool, default=True)) self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray", bool, default=False)) @@ -84,6 +50,7 @@ class PreferencesDlg: self.glade.get_widget("radio_save_all_to").set_active(True) else: self.glade.get_widget("radio_ask_save").set_active(True) + self.glade.get_widget("download_path_button").set_filename(self.preferences.get("default_download_path", str, default=os.path.expandvars('$HOME'))) self.glade.get_widget("chk_compact").set_active(self.preferences.get("use_compact_storage", bool, default=False)) self.glade.get_widget("active_port_label").set_text(str(self.parent.manager.get_state()['port'])) @@ -106,20 +73,14 @@ class PreferencesDlg: self.dialog.hide() # Now, get the settings from the dialog if r == 1: - self.preferences.set("encin_disabled", self.glade.get_widget("chk_encin_disabled").get_active()) - self.preferences.set("encin_enabled", self.glade.get_widget("chk_encin_enabled").get_active()) - self.preferences.set("encin_forced", self.glade.get_widget("chk_encin_forced").get_active()) - self.preferences.set("encout_disabled", self.glade.get_widget("chk_encout_disabled").get_active()) - self.preferences.set("encout_enabled", self.glade.get_widget("chk_encout_enabled").get_active()) - self.preferences.set("encout_forced", self.glade.get_widget("chk_encout_forced").get_active()) - self.preferences.set("level_plaintext", self.glade.get_widget("chk_level_plaintext").get_active()) - self.preferences.set("level_rc4", self.glade.get_widget("chk_level_rc4").get_active()) - self.preferences.set("level_both", self.glade.get_widget("chk_level_both").get_active()) - self.preferences.set("pref_rc4", self.glade.get_widget("chk_pref_rc4").get_active()) + self.preferences.set("encin_state", self.glade.get_widget("combo_encin").get_active()) + self.preferences.set("encout_state", self.glade.get_widget("combo_encout").get_active()) + self.preferences.set("encout_level", self.glade.get_widget("combo_enclevel").get_active()) + self.preferences.set("pref_rc4", self.glade.get_widget("chk_pref_rc4").get_active()) self.preferences.set("system_tray", self.glade.get_widget("chk_use_tray").get_active()) self.preferences.set("close_to_tray", self.glade.get_widget("chk_min_on_close").get_active()) - self.preferences.set("lock_tray", self.glade.get_widget("chk_lock_tray").get_active()) - self.preferences.set("tray_passwd", self.glade.get_widget("txt_tray_passwd").get_text()) + self.preferences.set("lock_tray", self.glade.get_widget("chk_lock_tray").get_active()) + self.preferences.set("tray_passwd", self.glade.get_widget("txt_tray_passwd").get_text()) self.preferences.set("use_default_dir", self.glade.get_widget("radio_save_all_to").get_active()) self.preferences.set("default_download_path", self.glade.get_widget("download_path_button").get_filename()) self.preferences.set("auto_end_seeding", self.glade.get_widget("chk_autoseed").get_active()) diff --git a/src/interface.py b/src/interface.py index 8c04f92ee..7a435ae74 100644 --- a/src/interface.py +++ b/src/interface.py @@ -30,15 +30,9 @@ import xdg, xdg.BaseDirectory import gettext, locale DEFAULT_PREFS = { - "encin_disable" : False, - "encin_enable" : True, - "encin_force" : False, - "encout_disable" : False, - "encout_enable" : True, - "encout_force" : False, - "level_plaintext" : False, - "level_both" : True, - "level_rc4" : False, + "encin_state" : common.EncState.enabled, + "encout_state" : common.EncState.enabled, + "enclevel_type" : common.EncLevel.both, "pref_rc4" : True, "auto_end_seeding" : False, "close_to_tray" : False, @@ -158,29 +152,7 @@ class DelugeGTK: pass self.apply_prefs() self.load_window_geometry() - if(self.config.get("encout_disabled", str, default="False") == "True"): - out_policy = "0" - elif(self.config.get("encout_enabled", str, default="True")): - out_policy = "1" - elif(self.config.get("encout_forced", str, default="False") == "True"): - out_policy = "2" - if(self.config.get("encin_disabled", str, default="False") == "True"): - in_policy = "0" - elif(self.config.get("encin_enabled", str, default="True") == "True"): - in_policy = "1" - elif(self.config.get("encin_forced", str, default="False") == "True"): - in_policy = "2" - if(self.config.get("level_plaintext", str, default="False") == "True"): - level_policy = "0" - elif(self.config.get("level_both", str, default="True") == "True"): - level_policy = "1" - elif(self.config.get("level_rc4", str, default="False") == "True"): - level_policy = "2" - if(self.config.get("pref_rc4", str, default="True") == "True"): - prefrc4 = "1" - elif(self.config.get("pref_rc4", str, default="True") == "False"): - prefrc4 = "0" - self.manager.pe_settings(out_policy, in_policy, level_policy, prefrc4) + self.manager.pe_settings(self.config.get("encout_state", int, default=common.EncState.enabled), self.config.get("encin_state", int, default=common.EncState.enabled), self.config.get("enclevel_type", int, default=common.EncLevel.both), self.config.get("pref_rc4", bool, default=True)) def external_add_torrent(self, torrent_file): print "Ding!"