diff --git a/deluge/plugins/testp/testp/gtkui.py b/deluge/plugins/testp/testp/gtkui.py index 4cb921f21..f795628cf 100644 --- a/deluge/plugins/testp/testp/gtkui.py +++ b/deluge/plugins/testp/testp/gtkui.py @@ -2,19 +2,19 @@ # gtkui.py # # Copyright (C) 2007 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., @@ -34,18 +34,22 @@ from deluge.log import LOG as log import ui -class GtkUI(ui.UI): +class GtkUI(object): def __init__(self, plugin_api, plugin_name): log.debug("Calling UI init") - # Call UI constructor - ui.UI.__init__(self, plugin_api, plugin_name) - log.debug("test plugin initialized..") + self.plugin = plugin_api + + def enable(self): + pass + + def disable(self): + pass def enable(self): self.plugin.register_hook("on_apply_prefs", self.apply_prefs) - + def disable(self): self.plugin.deregister_hook("on_apply_prefs", self.apply_prefs) - + def apply_prefs(self): - log.debug("applying prefs in test plugin!!") + log.debug("applying prefs") diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index 95e2e1969..84ab092dc 100644 --- a/deluge/scripts/create_plugin.py +++ b/deluge/scripts/create_plugin.py @@ -1,9 +1,9 @@ """ -creates an empty plugin and links it from ~/.config/deluge/plugins +Creates an empty plugin and links it from ~/.config/deluge/plugins +This plugin includes the framework for using the preferences dialog -usage : python create_plugin.py --name

--path --add-dev-link - -creates an empty plugin. +Example: +python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name" --author-email "yourname@example.com" """ @@ -89,7 +89,7 @@ import deluge from deluge.log import LOG as log from deluge.plugins.corepluginbase import CorePluginBase from deluge import component -from deluge.plugins.coreclient import client +#from deluge.plugins.coreclient import client #1.1 and later only #client: see http://dev.deluge-torrent.org/wiki/Development/UiClient#Remoteapi DEFAULT_PREFS = { @@ -99,7 +99,7 @@ DEFAULT_PREFS = { class Core(CorePluginBase): def enable(self): - self.config = deluge.configmanager.ConfigManager("%(name)s.conf", DEFAULT_PREFS) + self.config = deluge.configmanager.ConfigManager("%(safe_name)s.conf", DEFAULT_PREFS) def disable(self): pass @@ -187,6 +187,7 @@ class GtkUI(object): self.plugin.add_preferences_page("%(name)s", self.glade.get_widget("prefs_box")) self.plugin.register_hook("on_apply_prefs", self.on_apply_prefs) self.plugin.register_hook("on_show_prefs", self.on_show_prefs) + self.on_show_prefs() def disable(self): self.plugin.remove_preferences_page("%(name)s") @@ -278,8 +279,7 @@ class WebUI(object): api.config_page_manager.unregister('%(safe_name)s') """ -GPL = """ -# +GPL = """# # %(filename)s # # Copyright (C) 2008 %(author_name)s <%(author_email)s>