mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
...
This commit is contained in:
parent
8e2ca7681f
commit
157155d774
@ -142,7 +142,10 @@ Getting resources from the plugin zip file
|
|||||||
Enabling user configuration of your plugin
|
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
|
.. literalinclude:: plugin_examples/interface_demo/__init__.py
|
||||||
:pyobject: InterfacePluginDemo.config_widget
|
:pyobject: InterfacePluginDemo.config_widget
|
||||||
|
@ -32,6 +32,13 @@ class InterfacePluginDemo(InterfaceActionBase):
|
|||||||
#: The specified class must be defined in the specified module.
|
#: The specified class must be defined in the specified module.
|
||||||
actual_plugin = 'calibre_plugins.interface_demo.ui:InterfacePlugin'
|
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):
|
def config_widget(self):
|
||||||
'''
|
'''
|
||||||
Implement this method and :meth:`save_settings` in your plugin to
|
Implement this method and :meth:`save_settings` in your plugin to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user