From 157155d774e1366664b68461171c023ed2b60710 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Mar 2011 16:38:23 -0600 Subject: [PATCH] ... --- src/calibre/manual/creating_plugins.rst | 5 ++++- .../manual/plugin_examples/interface_demo/__init__.py | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/calibre/manual/creating_plugins.rst b/src/calibre/manual/creating_plugins.rst index 90494231d2..5eefffae9f 100644 --- a/src/calibre/manual/creating_plugins.rst +++ b/src/calibre/manual/creating_plugins.rst @@ -142,7 +142,10 @@ Getting resources from the plugin zip file Enabling user configuration of your plugin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To allow users to configure your plugin, you must define a couple of methods in your base plugin class, **config_widget** and **save_settings** as shown below: +To allow users to configure your plugin, you must define three methods in your base plugin class, '**is_customizable**, **config_widget** and **save_settings** as shown below: + +.. literalinclude:: plugin_examples/interface_demo/__init__.py + :pyobject: InterfacePluginDemo.is_customizable .. literalinclude:: plugin_examples/interface_demo/__init__.py :pyobject: InterfacePluginDemo.config_widget diff --git a/src/calibre/manual/plugin_examples/interface_demo/__init__.py b/src/calibre/manual/plugin_examples/interface_demo/__init__.py index 2ad4a0245e..9e13879fe9 100644 --- a/src/calibre/manual/plugin_examples/interface_demo/__init__.py +++ b/src/calibre/manual/plugin_examples/interface_demo/__init__.py @@ -32,6 +32,13 @@ class InterfacePluginDemo(InterfaceActionBase): #: The specified class must be defined in the specified module. actual_plugin = 'calibre_plugins.interface_demo.ui:InterfacePlugin' + def is_customizable(self): + ''' + This method must return True to enable customization via + Preferences->Plugins + ''' + return True + def config_widget(self): ''' Implement this method and :meth:`save_settings` in your plugin to