From 9d5e60c42f735728b8fed8bddf92d3ff980ae2c4 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 24 Jan 2008 01:33:37 +0000 Subject: [PATCH] Modify the Downloads tab of Preferences to include changes associated with the new Add Torrent dialog. --- .../ui/gtkui/glade/preferences_dialog.glade | 510 ++++++++++-------- deluge/ui/gtkui/gtkui.py | 4 +- deluge/ui/gtkui/preferences.py | 25 +- 3 files changed, 296 insertions(+), 243 deletions(-) diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 4a9eccf8a..cde426e7d 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -1,6 +1,6 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -8,7 +8,7 @@ Preferences GTK_WIN_POS_CENTER_ON_PARENT 510 - 520 + 525 True GDK_WINDOW_TYPE_HINT_DIALOG False @@ -88,6 +88,76 @@ 1 + + + True + 0 + GTK_SHADOW_NONE + + + True + 2 + 2 + 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 + Show the Add Torrents dialog when adding files from an external source + Always show + 0 + True + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 10 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Bring the Add Torrents dialog to focus + Bring the dialog to focus + 0 + True + + + + + 1 + + + + + + + + + True + <b>Add Torrents Dialog</b> + True + + + label_item + + + + + False + False + 5 + 2 + + True @@ -100,52 +170,28 @@ 2 12 - + True - 2 + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 - - True - Ask where to save each download - True - 0 - True - - - - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Store all downloads in: - Store all downloads in: - 0 - True - True - radio_ask_save - - - - False - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - Select A Folder - - - 1 - - + Default download location: + + + False + False + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + Select A Folder 1 @@ -170,7 +216,7 @@ False False 5 - 2 + 3 @@ -231,7 +277,7 @@ False False 5 - 3 + 4 @@ -252,17 +298,27 @@ 2 2 - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + + + 1 + 2 + + + + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Automatically add torrent files that are placed in this folder. - Client Folder: - 0 - True - GTK_FILL + 1 + 2 + 1 + 2 @@ -281,27 +337,17 @@ - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Automatically add torrent files that are placed in this folder. + Client Folder: + 0 + True - 1 - 2 - 1 - 2 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - - - 1 - 2 + GTK_FILL @@ -324,7 +370,7 @@ False False 5 - 4 + 5 @@ -395,7 +441,7 @@ False False 5 - 5 + 6 @@ -431,7 +477,7 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Set Private by default + Set private flag by default 0 True @@ -446,7 +492,7 @@ True - <b>Torrents</b> + <b>Options</b> True @@ -458,7 +504,7 @@ False False 5 - 6 + 7 @@ -1072,40 +1118,71 @@ 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 - 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 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 @@ -1130,74 +1207,43 @@ Disabled - + True - The maximum download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 1 + -1 -1 9000 1 10 10 + 1 + 1 + True - 2 - 3 + 1 + 2 + 3 + 4 GTK_FILL - + True True - The maximum number of connections allowed. Set -1 for unlimited. - 4 + The maximum upload slots for all torrents. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 True 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 - - @@ -1241,85 +1287,18 @@ Disabled 2 15 - - 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 - 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 - 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 @@ -1344,20 +1323,87 @@ 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 - 1 + True True 1 2 - 3 - 4 + 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 GTK_FILL @@ -1606,33 +1652,15 @@ Disabled 2 10 - + True + False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Open folder with: - 0 - True - True - - - - GTK_FILL - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Custom: - 0 - True - True - radio_open_folder_stock - + 1 + 2 1 2 GTK_FILL @@ -1662,20 +1690,38 @@ Thunar - + True - False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Custom: + 0 + True + True + radio_open_folder_stock + - 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 + Open folder with: + 0 + True + True + + + + GTK_FILL + + diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 3baf7897d..633839773 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -65,8 +65,8 @@ import deluge.configmanager DEFAULT_PREFS = { "config_location": deluge.common.get_config_dir(), - "interactive_add": False, - "enable_files_dialog": False, + "interactive_add": True, + "focus_add_dialog": True, "enable_system_tray": True, "close_to_tray": True, "start_in_tray": False, diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index e6102197d..6499ac5c1 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -191,6 +191,8 @@ class Preferences(component.Component): "chk_prioritize_first_last_pieces": \ ("active", self.core_config["prioritize_first_last_pieces"]), + "chk_private": \ + ("active", self.core_config["default_private"]), "spin_port_min": ("value", self.core_config["listen_ports"][0]), "spin_port_max": ("value", self.core_config["listen_ports"][1]), "active_port_label": ("text", str(self.active_port)), @@ -255,6 +257,7 @@ class Preferences(component.Component): "radio_compact_allocation", "radio_full_allocation", "chk_prioritize_first_last_pieces", + "chk_private", "spin_port_min", "spin_port_max", "active_port_label", @@ -288,10 +291,10 @@ class Preferences(component.Component): widget.set_sensitive(False) ## Downloads tab ## - self.glade.get_widget("radio_ask_save").set_active( + self.glade.get_widget("chk_show_dialog").set_active( self.gtkui_config["interactive_add"]) - self.glade.get_widget("radio_save_all_to").set_active( - not self.gtkui_config["interactive_add"]) + self.glade.get_widget("chk_focus_dialog").set_active( + self.gtkui_config["focus_add_dialog"]) self.glade.get_widget("chk_autoadd_folder").set_active( self.gtkui_config["autoadd_enable"]) self.glade.get_widget("autoadd_folder_button").set_filename( @@ -349,7 +352,9 @@ class Preferences(component.Component): ## Downloads tab ## new_gtkui_config["interactive_add"] = \ - self.glade.get_widget("radio_ask_save").get_active() + self.glade.get_widget("chk_show_dialog").get_active() + new_gtkui_config["focus_add_dialog"] = \ + self.glade.get_widget("chk_focus_dialog").get_active() new_core_config["download_location"] = \ self.glade.get_widget("download_path_button").get_filename() new_core_config["torrentfiles_location"] = \ @@ -367,6 +372,8 @@ class Preferences(component.Component): new_core_config["prioritize_first_last_pieces"] = \ self.glade.get_widget( "chk_prioritize_first_last_pieces").get_active() + new_core_config["default_private"] = \ + self.glade.get_widget("chk_private").get_active() ## Network tab ## listen_ports = [] @@ -479,11 +486,11 @@ class Preferences(component.Component): def on_toggle(self, widget): """Handles widget sensitivity based on radio/check button values.""" value = widget.get_active() - # Disable the download path button if user wants to pick where each - # new torrent is saved. - if widget == self.glade.get_widget("radio_save_all_to"): - self.glade.get_widget("download_path_button").set_sensitive(value) - + + # Disable the focus dialog checkbox if the show dialog isn't active. + if widget == self.glade.get_widget("chk_show_dialog"): + self.glade.get_widget("chk_focus_dialog").set_sensitive(value) + # Disable the port spinners if random ports is selected. if widget == self.glade.get_widget("chk_random_port"): log.debug("chk_random_port set to: %s", value)