diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 6c74d6a46..47ad518a4 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 @@ -105,108 +105,25 @@ 4 2 - - True - 0 - Download to: - - - GTK_FILL - - - - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - + 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 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 1 - 2 - - - - - True - True - Move completed to: - 0 - True - - - - 1 - 2 - GTK_FILL - - - - - True - True - Copy of .torrent files to: - 0 - True - - - - 2 - 3 - GTK_FILL - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Auto add .torrents from: - 0 - True - - - - 3 - 4 - GTK_FILL - - - - - True - - - True 5 - + True 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 - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 @@ -218,8 +135,8 @@ 1 2 - 1 - 2 + 3 + 4 @@ -259,25 +176,23 @@ - + 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 5 - + True 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 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 @@ -289,8 +204,93 @@ 1 2 + 1 + 2 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Auto add .torrents from: + 0 + True + + + 3 4 + GTK_FILL + + + + + True + True + Copy of .torrent files to: + 0 + True + + + + 2 + 3 + GTK_FILL + + + + + True + True + Move completed to: + 0 + True + + + + 1 + 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + 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 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + 1 + 2 + + + + + True + 0 + Download to: + + + GTK_FILL @@ -874,53 +874,17 @@ - + True True - Distributed hash table may improve the amount of active connections. - DHT - True - 0 - True - - - 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 - Local Service Discovery finds local peers on your network. - LSD - 0 - True - - - 1 - 2 - GTK_FILL - - - - - True - True - Peer Exchange - Peer Exchange + Universal Plug and Play + UPnP True 0 True True - 2 - 3 GTK_FILL @@ -942,17 +906,53 @@ - + True True - Universal Plug and Play - UPnP + Peer Exchange + Peer Exchange True 0 True True + 2 + 3 + GTK_FILL + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Local Service Discovery finds local peers on your network. + LSD + 0 + True + + + 1 + 2 + GTK_FILL + + + + + True + True + Distributed hash table may improve the amount of active connections. + DHT + True + 0 + True + + + 1 + 2 + 1 + 2 GTK_FILL @@ -1215,40 +1215,127 @@ 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 + -1 -1 9999 1 10 10 True 1 2 + 5 + 6 + GTK_FILL + + + + + True + True + 1 + -1 -1 9999 1 10 10 + True + + + 1 + 2 + 4 + 5 + GTK_FILL + + + + + True + 0 + Maximum Connection Attempts per Second: + + + 5 + 6 + GTK_FILL + + + + + True + 0 + Maximum Half-Open Connections: + + + 4 + 5 + GTK_FILL + + + + + 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 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 @@ -1273,127 +1360,40 @@ Disabled - - True - The maximum download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 - GTK_FILL - - - - + True True - The maximum number of connections allowed. Set -1 for unlimited. - 4 + The maximum upload speed for all torrents. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 - True + 1 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 - - True - 0 - Maximum Half-Open Connections: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - Maximum Connection Attempts per Second: - - - 5 - 6 - GTK_FILL - - - - + True True + The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9999 1 10 10 + -1 -1 9000 1 10 10 + 1 + True True 1 2 - 4 - 5 - GTK_FILL - - - - - True - True - 1 - -1 -1 9999 1 10 10 - True - - - 1 - 2 - 5 - 6 + 1 + 2 GTK_FILL @@ -1461,18 +1461,85 @@ Disabled 2 15 - + True True - The maximum number of connections per torrent. Set -1 for unlimited. + The maximum upload slots per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - 1 + 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 + 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 @@ -1497,87 +1564,20 @@ 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 - True + 1 True 1 2 - 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 + 3 + 4 GTK_FILL @@ -2477,15 +2477,59 @@ Disabled 2 10 - + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + 2 + 3 + + + + + + True + 0 + Total active seeding: + + + 2 + 3 + GTK_FILL + + + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active downloading: + Total active: - 1 - 2 GTK_FILL @@ -2508,62 +2552,18 @@ Disabled - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active: + Total active downloading: + 1 + 2 GTK_FILL - - - True - 0 - Total active seeding: - - - 2 - 3 - GTK_FILL - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - 2 - 3 - - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - - - @@ -2624,18 +2624,51 @@ Disabled 2 10 - + + True + 0 + Share Ratio Limit: + + + GTK_FILL + + + + + True + 0 + Seed Time Ratio: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Seed Time (m): + + + 2 + 3 + GTK_FILL + + + + True True 6 1 - 6 -1 100 1 10 10 + 1.5 -1 100 0.10000000000000001 10 10 + 2 1 2 - 2 - 3 @@ -2657,52 +2690,19 @@ Disabled - + True True 6 1 - 1.5 -1 100 0.10000000000000001 10 10 - 2 + 6 -1 100 1 10 10 1 2 - - - - - - True - 0 - Seed Time (m): - - 2 3 - GTK_FILL - - - - - True - 0 - Seed Time Ratio: - - - 1 - 2 - GTK_FILL - - - - - True - 0 - Share Ratio Limit: - - - GTK_FILL + @@ -2877,86 +2877,43 @@ Disabled 2 5 - + True - 0 - 0 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 65000 1 10 10 - True - - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 - 4 - 5 - - - - - True - 0 - Port: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - Host: - - 3 4 - GTK_FILL - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Password: + False + 1 + 2 2 3 - GTK_FILL - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Username: + 1 + 2 1 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Type: - - - GTK_FILL @@ -2977,43 +2934,86 @@ HTTP W/ Auth - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Type: + + + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Username: - 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 - False + 0 + Password: - 1 - 2 2 3 + GTK_FILL - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Host: + + + 3 + 4 + GTK_FILL + + + + + True + 0 + Port: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + 0 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 65000 1 10 10 + True + + 1 2 - 3 - 4 + 4 + 5 @@ -3114,27 +3114,18 @@ HTTP W/ Auth 2 5 - - True - - - 1 - 2 - 2 - 3 - - - - + True True - Blinking tray icon + Only OGG and WAV files are supported + Sound: True 0 True - 2 + 2 + 3 GTK_FILL @@ -3155,19 +3146,28 @@ HTTP W/ Auth - + True True - Only OGG and WAV files are supported - Sound: + Blinking tray icon True 0 True + 2 + GTK_FILL + + + + + True + + + 1 + 2 2 3 - GTK_FILL @@ -3208,115 +3208,14 @@ HTTP W/ Auth 2 5 - - True - True - Enable - 0 - True - - - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - + True 0 - Address: + Security: - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 2 - 3 - - - - - True - 0 - Server: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 3 - 4 - - - - - True - 0 - Username: - - - 3 - 4 - GTK_FILL - - - - - True - True - False - - - 1 - 2 - 4 - 5 - - - - - True - 0 - Password: - - - 4 - 5 + 5 + 6 GTK_FILL @@ -3379,17 +3278,118 @@ HTTP W/ Auth - + True 0 - Security: + Password: - 5 - 6 + 4 + 5 GTK_FILL + + + True + True + False + + + 1 + 2 + 4 + 5 + + + + + True + 0 + Username: + + + 3 + 4 + GTK_FILL + + + + + True + True + + + 1 + 2 + 3 + 4 + + + + + True + 0 + Server: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + True + 0 + Address: + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + True + Enable + 0 + True + + + 2 + GTK_FILL + GTK_FILL + + @@ -3490,7 +3490,6 @@ HTTP W/ Auth True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True @@ -3518,16 +3517,31 @@ HTTP W/ Auth True - 4 + 5 2 + 5 - + True + 0 1 2 2 + 3 + + + + + + True + 0 + + + 1 + 2 + 3 4 @@ -3535,39 +3549,40 @@ HTTP W/ Auth True + 0 + Author Email: - 1 - 2 - 1 - 2 - + 2 + 3 + GTK_FILL + GTK_FILL True - - - 1 - 2 - - - - - - True 0 - 0 - Details: + Homepage: - 2 + 3 4 GTK_FILL GTK_FILL + + + True + 0 + Author: + + + GTK_FILL + + + True @@ -3582,13 +3597,53 @@ HTTP W/ Auth - + True 0 - Author: + 0 + Details: + 4 + 5 GTK_FILL + GTK_FILL + + + + + True + 0 + + + 1 + 2 + + + + + + True + 0 + + + 1 + 2 + 1 + 2 + + + + + + True + 0 + + + 1 + 2 + 4 + 5 diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 9cdebbdb3..b9c495c03 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -2,19 +2,19 @@ # preferences.py # # Copyright (C) 2007, 2008 Andrew Resch ('andar') -# +# # Deluge is free software. -# +# # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; either version 3 of the License, or (at your option) # any later version. -# +# # deluge is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with deluge. If not, write to: # The Free Software Foundation, Inc., @@ -64,7 +64,7 @@ class Preferences(component.Component): self.treeview.append_column(column) # Add the default categories i = 0 - for category in ["Downloads", "Network", "Bandwidth", "Interface", + for category in ["Downloads", "Network", "Bandwidth", "Interface", "Other", "Daemon", "Queue", "Proxy", "Notification", "Plugins"]: self.liststore.append([i, category]) i += 1 @@ -80,15 +80,15 @@ class Preferences(component.Component): gtk.TreeViewColumn(_("Enabled"), render, active=1)) self.plugin_listview.append_column( gtk.TreeViewColumn(_("Plugin"), gtk.CellRendererText(), text=0)) - + # Connect to the 'changed' event of TreeViewSelection to get selection # changes. - self.treeview.get_selection().connect("changed", + self.treeview.get_selection().connect("changed", self.on_selection_changed) - + self.plugin_listview.get_selection().connect("changed", self.on_plugin_selection_changed) - + self.glade.signal_autoconnect({ "on_pref_dialog_delete_event": self.on_pref_dialog_delete_event, "on_button_ok_clicked": self.on_button_ok_clicked, @@ -100,10 +100,10 @@ class Preferences(component.Component): "on_button_rescan_plugins_clicked": self._on_button_rescan_plugins_clicked }) - # These get updated by requests done to the core + # These get updated by requests done to the core self.all_plugins = [] self.enabled_plugins = [] - + def __del__(self): del self.gtkui_config @@ -128,9 +128,9 @@ class Preferences(component.Component): vbox.pack_start(align, False, False, 0) scrolled = gtk.ScrolledWindow() viewport = gtk.Viewport() - viewport.set_shadow_type(gtk.SHADOW_NONE) + viewport.set_shadow_type(gtk.SHADOW_NONE) viewport.add(vbox) - scrolled.add(viewport) + scrolled.add(viewport) scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrolled.show_all() # Add this page to the notebook @@ -142,7 +142,7 @@ class Preferences(component.Component): """Removes a page from the notebook""" self.page_num_to_remove = None self.iter_to_remove = None - + def check_row(model, path, iter, user_data): row_name = model.get_value(iter, 1) if row_name == user_data: @@ -157,19 +157,19 @@ class Preferences(component.Component): self.notebook.remove_page(self.page_num_to_remove) if self.iter_to_remove != None: self.liststore.remove(self.iter_to_remove) - + def _on_get_config(self, config): self.core_config = config - + def _on_get_available_plugins(self, plugins): self.all_plugins = plugins - + def _on_get_enabled_plugins(self, plugins): self.enabled_plugins = plugins - + def _on_get_listen_port(self, port): self.active_port = port - + def show(self, page=None): """Page should be the string in the left list.. ie, 'Network' or 'Bandwidth'""" if page != None: @@ -177,7 +177,7 @@ class Preferences(component.Component): if page == string: self.treeview.get_selection().select_path(index) break - + # Update the preferences dialog to reflect current config settings self.core_config = {} try: @@ -211,7 +211,7 @@ class Preferences(component.Component): "radio_full_allocation": \ ("not_active", self.core_config["compact_allocation"]), "chk_prioritize_first_last_pieces": \ - ("active", + ("active", self.core_config["prioritize_first_last_pieces"]), "spin_port_min": ("value", self.core_config["listen_ports"][0]), "spin_port_max": ("value", self.core_config["listen_ports"][1]), @@ -276,7 +276,7 @@ class Preferences(component.Component): "txt_proxy_username": ("text", self.core_config["proxy_username"]), "txt_proxy_password": ("text", self.core_config["proxy_password"]), } - + # Change a few widgets if we're connected to a remote host if not client.is_localhost(): self.glade.get_widget("entry_download_path").show() @@ -288,7 +288,7 @@ class Preferences(component.Component): self.glade.get_widget("move_completed_path_button").hide() core_widgets.pop("move_completed_path_button") core_widgets["entry_move_completed_path"] = ("text", self.core_config["move_completed_path"]) - + self.glade.get_widget("entry_torrents_path").show() self.glade.get_widget("torrent_files_button").hide() core_widgets.pop("torrent_files_button") @@ -306,7 +306,7 @@ class Preferences(component.Component): self.glade.get_widget("entry_torrents_path").hide() self.glade.get_widget("torrent_files_button").show() self.glade.get_widget("entry_autoadd").hide() - self.glade.get_widget("folder_autoadd").show() + self.glade.get_widget("folder_autoadd").show() # Update the widgets accordingly for key in core_widgets.keys(): @@ -317,7 +317,7 @@ class Preferences(component.Component): for child in widget.get_children(): child.set_sensitive(True) widget.set_sensitive(True) - + if modifier == "filename": if value: try: @@ -423,7 +423,7 @@ class Preferences(component.Component): self.gtkui_config["lock_tray"]) self.glade.get_widget("chk_classic_mode").set_active( self.gtkui_config["classic_mode"]) - + ## Other tab ## self.glade.get_widget("chk_show_new_releases").set_active( self.gtkui_config["show_new_releases"]) @@ -468,22 +468,22 @@ class Preferences(component.Component): row = self.plugin_liststore.append() self.plugin_liststore.set_value(row, 0, plugin) self.plugin_liststore.set_value(row, 1, enabled) - + component.get("PluginManager").run_on_show_prefs() # Now show the dialog self.pref_dialog.show() - + def set_config(self): """Sets all altered config values in the core""" try: from hashlib import sha1 as sha_hash except ImportError: from sha import new as sha_hash - + # Get the values from the dialog new_core_config = {} new_gtkui_config = {} - + ## Downloads tab ## new_gtkui_config["interactive_add"] = \ self.glade.get_widget("chk_show_dialog").get_active() @@ -507,7 +507,7 @@ class Preferences(component.Component): self.glade.get_widget("entry_move_completed_path").get_text() new_core_config["torrentfiles_location"] = \ self.glade.get_widget("entry_torrents_path").get_text() - + new_core_config["autoadd_enable"] = \ self.glade.get_widget("chk_autoadd").get_active() if client.is_localhost(): @@ -516,7 +516,7 @@ class Preferences(component.Component): else: new_core_config["autoadd_location"] = \ self.glade.get_widget("entry_autoadd").get_text() - + new_core_config["compact_allocation"] = \ self.glade.get_widget("radio_compact_allocation").get_active() new_core_config["prioritize_first_last_pieces"] = \ @@ -536,12 +536,12 @@ class Preferences(component.Component): outgoing_ports.append( self.glade.get_widget("spin_outgoing_port_min").get_value_as_int()) outgoing_ports.append( - self.glade.get_widget("spin_outgoing_port_max").get_value_as_int()) + self.glade.get_widget("spin_outgoing_port_max").get_value_as_int()) new_core_config["outgoing_ports"] = outgoing_ports new_core_config["random_outgoing_ports"] = \ self.glade.get_widget("chk_random_outgoing_ports").get_active() - - new_core_config["peer_tos"] = self.glade.get_widget("entry_peer_tos").get_text() + + new_core_config["peer_tos"] = self.glade.get_widget("entry_peer_tos").get_text() new_core_config["dht"] = self.glade.get_widget("chk_dht").get_active() new_core_config["upnp"] = self.glade.get_widget("chk_upnp").get_active() new_core_config["natpmp"] = \ @@ -558,7 +558,7 @@ class Preferences(component.Component): self.glade.get_widget("combo_enclevel").get_active() new_core_config["enc_prefer_rc4"] = \ self.glade.get_widget("chk_pref_rc4").get_active() - + ## Bandwidth tab ## new_core_config["max_connections_global"] = \ self.glade.get_widget( @@ -589,7 +589,7 @@ class Preferences(component.Component): "spin_max_download_per_torrent").get_value() new_core_config["ignore_limits_on_local_network"] = \ self.glade.get_widget("chk_ignore_limits_on_local_network").get_active() - + ## Interface tab ## new_gtkui_config["enable_system_tray"] = \ self.glade.get_widget("chk_use_tray").get_active() @@ -631,8 +631,8 @@ class Preferences(component.Component): new_gtkui_config["ntf_security"] = 'SSL' elif self.glade.get_widget("rad_ntf_tls").get_active(): new_gtkui_config["ntf_security"] = 'TLS' - - ## Other tab ## + + ## Other tab ## new_gtkui_config["show_new_releases"] = \ self.glade.get_widget("chk_show_new_releases").get_active() new_core_config["send_info"] = \ @@ -681,16 +681,16 @@ class Preferences(component.Component): self.glade.get_widget("spin_seed_time_ratio_limit").get_value() new_core_config["seed_time_limit"] = \ self.glade.get_widget("spin_seed_time_limit").get_value() - + # Run plugin hook to apply preferences component.get("PluginManager").run_on_apply_prefs() - + # GtkUI for key in new_gtkui_config.keys(): # The values do not match so this needs to be updated if self.gtkui_config[key] != new_gtkui_config[key]: self.gtkui_config[key] = new_gtkui_config[key] - + # Core if client.get_core_uri() != None: # Only do this if we're connected to a daemon @@ -705,17 +705,17 @@ class Preferences(component.Component): client.force_call(True) # Update the configuration self.core_config.update(config_to_set) - + # Re-show the dialog to make sure everything has been updated self.show() - + def hide(self): self.pref_dialog.hide() - + def on_pref_dialog_delete_event(self, widget, event): self.hide() return True - + def on_toggle(self, widget): """Handles widget sensitivity based on radio/check button values.""" try: @@ -771,7 +771,7 @@ class Preferences(component.Component): log.debug("on_button_cancel_clicked") self.hide() return True - + def on_selection_changed(self, treeselection): # Show the correct notebook page based on what row is selected. (model, row) = treeselection.get_selected() @@ -787,7 +787,7 @@ class Preferences(component.Component): "http://deluge-torrent.org/test-port.php?port=%s" % port) client.get_listen_port(on_get_listen_port) client.force_call() - + def on_plugin_toggled(self, renderer, path): log.debug("on_plugin_toggled") row = self.plugin_liststore.get_iter_from_string(path) @@ -800,9 +800,17 @@ class Preferences(component.Component): else: client.disable_plugin(name) component.get("PluginManager").disable_plugin(name) - + def on_plugin_selection_changed(self, treeselection): log.debug("on_plugin_selection_changed") + (model, itr) = treeselection.get_selected() + name = model[itr][0] + plugin_info = component.get("PluginManager").get_plugin_info(name) + self.glade.get_widget("label_plugin_author").set_text(plugin_info["Author"]) + self.glade.get_widget("label_plugin_version").set_text(plugin_info["Version"]) + self.glade.get_widget("label_plugin_email").set_text(plugin_info["Author-email"]) + self.glade.get_widget("label_plugin_homepage").set_text(plugin_info["Home-page"]) + self.glade.get_widget("label_plugin_details").set_text(plugin_info["Description"]) def _on_button_plugin_install_clicked(self, widget): log.debug("_on_button_plugin_install_clicked") @@ -834,11 +842,11 @@ class Preferences(component.Component): import os.path filename = os.path.split(filepath)[1] shutil.copyfile( - filepath, + filepath, os.path.join(self.gtkui_config["config_location"], "plugins", filename)) - + component.get("PluginManager").scan_for_plugins() - + if not client.is_localhost(): # We need to send this plugin to the daemon client.upload_plugin( @@ -849,9 +857,8 @@ class Preferences(component.Component): chooser.destroy() # We need to re-show the preferences dialog to show the new plugins self.show() - + def _on_button_rescan_plugins_clicked(self, widget): component.get("PluginManager").scan_for_plugins() client.rescan_plugins() self.show() -