mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 10:56:11 +00:00
Document terminate() Method for Python Plugins (#1387)
This commit is contained in:
parent
7eb62a976c
commit
926b74119e
@ -21,6 +21,9 @@ Create a python file, called ``myplugin.py`` for example, and add the following
|
||||
def setupInterface(self, main):
|
||||
pass
|
||||
|
||||
def terminate(self):
|
||||
pass
|
||||
|
||||
def create_cutter_plugin():
|
||||
return MyCutterPlugin()
|
||||
|
||||
@ -39,6 +42,7 @@ The ``CutterPlugin`` subclass contains some meta-info and two callback methods:
|
||||
|
||||
* ``setupPlugin()`` is called right after the plugin is loaded and can be used to initialize the plugin itself.
|
||||
* ``setupInterface()`` is called with the instance of MainWindow as an argument and should create and register any UI components.
|
||||
* ``terminate()`` is called on shutdown and should clean up any resources used by the plugin.
|
||||
|
||||
Copy this file into the ``python`` subdirectory located under the plugins directory of Cutter and start the application.
|
||||
You should see an entry for your plugin in the list under Edit -> Preferences -> Plugins.
|
||||
@ -251,5 +255,8 @@ Full Code
|
||||
widget = MyDockWidget(main, action)
|
||||
main.addPluginDockWidget(widget, action)
|
||||
|
||||
def terminate(self):
|
||||
pass
|
||||
|
||||
def create_cutter_plugin():
|
||||
return MyCutterPlugin()
|
||||
|
Loading…
Reference in New Issue
Block a user