diff --git a/deluge/core/core.py b/deluge/core/core.py index e4c4e948b..66e4d9596 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -680,6 +680,21 @@ class Core( if add_to_session: self.export_add_torrent_file(os.path.split(target)[1], open(target, "rb").read(), None) + def export_upload_plugin(self, filename, plugin_data): + """This method is used to upload new plugins to the daemon. It is used + when connecting to the daemon remotely and installing a new plugin on + the client side. 'plugin_data' is a xmlrpc.Binary object of the file data, + ie, plugin_file.read()""" + + f = open(os.path.join(self.config["config_location"], "plugins", filename), "wb") + f.write(plugin_data.data) + f.close() + component.get("PluginManager").scan_for_plugins() + + def export_rescan_plugins(self): + """Rescans the plugin folders for new plugins""" + component.get("PluginManager").scan_for_plugins() + ## Queueing functions ## def export_queue_top(self, torrent_ids): log.debug("Attempting to queue %s to top", torrent_ids) diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py index 163e3d570..d8d39b46e 100644 --- a/deluge/pluginmanagerbase.py +++ b/deluge/pluginmanagerbase.py @@ -49,6 +49,10 @@ class PluginManagerBase: self.config = deluge.configmanager.ConfigManager(config_file) + # Create the plugins folder if it doesn't exist + if not os.path.exists(os.path.join(deluge.configmanager.get_config_dir(), "plugins")): + os.mkdir(os.path.join(deluge.configmanager.get_config_dir(), "plugins")) + # This is the entry we want to load.. self.entry_name = entry_name diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 2f8300a9f..7510da478 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -169,7 +169,8 @@ class BaseClient(object): "set_torrent_prioritize_first_last", "set_torrent_auto_managed", "set_torrent_stop_ratio", "set_torrent_stop_at_ratio", "set_torrent_remove_at_ratio", "set_torrent_move_on_completed", - "set_torrent_move_on_completed_path", "add_torrent_magnets", "create_torrent"] + "set_torrent_move_on_completed_path", "add_torrent_magnets", + "create_torrent", "upload_plugin", "rescan_plugins"] def __init__(self): self.core = _core diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 3f137e2e3..4085e0f9e 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 @@ -174,25 +174,108 @@ 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 @@ -204,8 +287,8 @@ 1 2 - 3 - 4 + 1 + 2 @@ -245,23 +328,25 @@ - + 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 @@ -273,93 +358,8 @@ 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 @@ -943,34 +943,36 @@ - + True True - Universal Plug and Play - UPnP + Distributed hash table may improve the amount of active connections. + DHT True 0 - True - True - - - GTK_FILL - - - - - True - True - NAT Port Mapping Protocol - NAT-PMP - True - 0 - True 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 @@ -992,36 +994,34 @@ - + 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 + NAT Port Mapping Protocol + NAT-PMP True 0 + True True 1 2 - 1 - 2 + GTK_FILL + + + + + True + True + Universal Plug and Play + UPnP + True + 0 + True + True + + GTK_FILL @@ -1284,127 +1284,40 @@ Disabled 2 15 - + 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 - 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 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 download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 + 3 + 4 GTK_FILL @@ -1429,40 +1342,127 @@ 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 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 + 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 9000 1 10 10 - 1 - True + -1 -1 9999 1 10 10 True 1 2 - 1 - 2 + 4 + 5 + GTK_FILL + + + + + True + True + 1 + -1 -1 9999 1 10 10 + True + + + 1 + 2 + 5 + 6 GTK_FILL @@ -1530,85 +1530,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 @@ -1633,20 +1566,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 @@ -2476,59 +2476,15 @@ 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: + Total active downloading: + 1 + 2 GTK_FILL @@ -2551,18 +2507,62 @@ Disabled - + 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 + + + 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 + + + @@ -2623,51 +2623,18 @@ 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 - 1.5 -1 100 0.10000000000000001 10 10 - 2 + 6 -1 100 1 10 10 1 2 + 2 + 3 @@ -2689,19 +2656,52 @@ Disabled - + True True 6 1 - 6 -1 100 1 10 10 + 1.5 -1 100 0.10000000000000001 10 10 + 2 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 @@ -2876,43 +2876,86 @@ Disabled 2 5 - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 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 + 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 - 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 + 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 @@ -2933,86 +2976,43 @@ 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 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - True - 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 - 4 - 5 + 1 + 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 + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 2 + 3 + 4 @@ -3113,18 +3113,27 @@ HTTP W/ Auth 2 5 - + + True + + + 1 + 2 + 2 + 3 + + + + True True - Only OGG and WAV files are supported - Sound: + Blinking tray icon True 0 True - 2 - 3 + 2 GTK_FILL @@ -3145,28 +3154,19 @@ HTTP W/ Auth - + True True - Blinking tray icon + Only OGG and WAV files are supported + Sound: True 0 True - 2 - GTK_FILL - - - - - True - - - 1 - 2 2 3 + GTK_FILL @@ -3207,14 +3207,115 @@ HTTP W/ Auth 2 5 - + True - 0 - Security: + True + Enable + 0 + True - 5 - 6 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + 0 + Address: + + + 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 GTK_FILL @@ -3277,118 +3378,17 @@ HTTP W/ Auth - + True 0 - Password: + Security: - 4 - 5 + 5 + 6 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 - - @@ -3478,11 +3478,20 @@ HTTP W/ Auth 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 - True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + False @@ -3490,18 +3499,118 @@ HTTP W/ Auth - + True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - GTK_WRAP_WORD - False - False + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + 4 + 2 + + + True + + + 1 + 2 + 2 + 4 + + + + + + True + + + 1 + 2 + 1 + 2 + + + + + + True + + + 1 + 2 + + + + + + True + 0 + 0 + Details: + + + 2 + 4 + GTK_FILL + GTK_FILL + + + + + True + 0 + Version: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Author: + + + GTK_FILL + + + + + + + + + + True + <b>Info</b> + True + + + label_item + + + + False - True + False @@ -3509,6 +3618,102 @@ HTTP W/ Auth 2 + + + True + GTK_BUTTONBOX_CENTER + + + True + True + True + 0 + + + + True + 5 + + + True + gtk-add + + + False + False + + + + + True + _Install Plugin + True + True + + + False + False + 1 + + + + + + + False + False + + + + + True + True + True + 0 + + + + True + 5 + + + True + gtk-refresh + + + False + False + + + + + True + _Rescan Plugins + True + True + + + False + False + 1 + + + + + + + False + False + 1 + + + + + False + False + 3 + + diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 61baf03bf..01ba4519c 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -94,7 +94,9 @@ class Preferences(component.Component): "on_button_apply_clicked": self.on_button_apply_clicked, "on_button_cancel_clicked": self.on_button_cancel_clicked, "on_toggle": self.on_toggle, - "on_test_port_clicked": self.on_test_port_clicked + "on_test_port_clicked": self.on_test_port_clicked, + "on_button_plugin_install_clicked": self._on_button_plugin_install_clicked, + "on_button_rescan_plugins_clicked": self._on_button_rescan_plugins_clicked }) # These get updated by requests done to the core @@ -800,4 +802,55 @@ class Preferences(component.Component): def on_plugin_selection_changed(self, treeselection): log.debug("on_plugin_selection_changed") + + def _on_button_plugin_install_clicked(self, widget): + log.debug("_on_button_plugin_install_clicked") + chooser = gtk.FileChooserDialog(_("Select the Plugin"), + self.pref_dialog, + gtk.FILE_CHOOSER_ACTION_OPEN, + buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, + gtk.RESPONSE_OK)) + + chooser.set_transient_for(self.pref_dialog) + chooser.set_select_multiple(False) + chooser.set_property("skip-taskbar-hint", True) + + file_filter = gtk.FileFilter() + file_filter.set_name(_("Plugin Eggs")) + file_filter.add_pattern("*." + "egg") + chooser.add_filter(file_filter) + + # Run the dialog + response = chooser.run() + + if response == gtk.RESPONSE_OK: + filepath = chooser.get_filename() + else: + chooser.destroy() + return + + import shutil + import os.path + filename = os.path.split(filepath)[1] + shutil.copyfile( + 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( + filename, + xmlrpclib.Binary(open(filepath, "rb").read())) + + client.rescan_plugins() + 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()