Commit 431e6841 authored by Jan Möbius's avatar Jan Möbius

Document initialization in Base Interface

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10990 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 785326e3
......@@ -287,15 +287,17 @@ To use the BaseInterface:
<li> And add the signals or slots you want to use to your plugin class (You don't need to implement all of them except BaseInterface::description() and BaseInterface::name() )
</ul>
\section Plugin initialization
\section Plugin Initialization
BaseInterface provides two functions to initialize a plugin. The first function is BaseInterface::initializePlugin().
This function is called immediatly after the plugin has been connected with OpenFlipper. When a plugin is
loaded, all signals and slots from the used interfaces are connected to the core. After this, the
BaseInterface::initializePlugin() slot is called. In this slot you can initialize your plugin and add
user interface parts to OpenFlipper. The order how plugins are loaded is not fixed. So you should
not rely or communicate with other plugins in this slot. \n
BaseInterface::initializePlugin() slot is called. In this slot you can initialize your plugin.
The order how plugins are loaded is not fixed. So you should not rely or communicate with other plugins
in this slot. \n
After all plugins are loaded, the slot BaseInterface::pluginsInitialized() is called for each plugin. All
other plugins are now available and the user interface is setup correctly.
other plugins are now available and you can setup your userinterface components in this slot.
The following graphic shows the initialization of a plugin.
\image html startupProcess.jpg
*/
......
......@@ -165,7 +165,7 @@ To use the ContextMenuInterface:
</ul>
Usually you should implement the BaseInterface::initializePlugin() function from BaseInterface. In this function you can setup
Usually you should implement the BaseInterface::pluginsInitialized() function from BaseInterface. In this function you can setup
your menus.\n
You have to create a QAction. The signals and slots of your actions have to be connected
......@@ -184,7 +184,7 @@ The following code shows a simple example to create a menu entry in the context
\code
// Setup the menus in initialize plugins
void ExamplePlugin::initializePlugin()
void ExamplePlugin::pluginsInitialized()
{
// create a global QMenu in the plugin that contains our menu
// in the header is:
......
......@@ -128,12 +128,12 @@ To use the MenuInterface:
<li> And add the signals or slots you want to use to your plugin class (You don't need to implement all of them)
</ul>
Usually you should implement the BaseInterface::initializePlugin() function from BaseInterface. In this function you can setup
Usually you should implement the BaseInterface::pluginsInitialized() function from BaseInterface. In this function you can setup
your menus.
The following code shows a simple example to create a menu entry in the file menu.
\code
void PrintPlugin::initializePlugin()
void PrintPlugin::pluginsInitialized()
{
// Create a submenu called printing
QMenu *printMenu = new QMenu(tr("&Printing"));
......
......@@ -114,13 +114,13 @@ To use the ToolboxInterface:
<li> And add the signals or slots you want to use to your plugin class (You don't need to implement all of them)
</ul>
Usually you should implement the BaseInterface::initializePlugin() function from BaseInterface. In this function you can setup
Usually you should implement the BaseInterface::pluginsInitialized() function from BaseInterface. In this function you can setup
your toolbox ( some kind of QWidget, can also be any widget created with qt-designer). Optionally you can also
add an icon to the toolbox.
The following code shows a simple example to create an empty toolbox.
\code
void SmootherPlugin::initializePlugin()
void SmootherPlugin::pluginsInitialized()
{
// Create the Toolbox Widget
QWidget* toolBox = new QWidget();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment