diff --git a/deluge/ui/gtkui/pluginmanager.py b/deluge/ui/gtkui/pluginmanager.py index c211f3574..1741af071 100644 --- a/deluge/ui/gtkui/pluginmanager.py +++ b/deluge/ui/gtkui/pluginmanager.py @@ -60,7 +60,17 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase, # Enable the plugins that are enabled in the config and core self.enable_plugins() - + + def apply_prefs(self): + """Attempts to call 'apply_prefs()' in each enabled plugin. This is + called when a user clicks OK or Apply in the preferences window and is + designed to give plugins the opportunity to save their prefs.""" + for key in self.plugins.keys(): + try: + self.plugins[key].apply_prefs() + except AttributeError: + pass + ## Plugin functions.. will likely move to own class.. def add_torrentview_text_column(self, *args, **kwargs): diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 77786a74d..740c28a84 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -529,12 +529,14 @@ class Preferences(component.Component): def on_button_ok_clicked(self, data): log.debug("on_button_ok_clicked") self.set_config() + component.get("PluginManager").apply_prefs() self.hide() return True def on_button_apply_clicked(self, data): log.debug("on_button_apply_clicked") self.set_config() + component.get("PluginManager").apply_prefs() def on_button_cancel_clicked(self, data): log.debug("on_button_cancel_clicked")