diff --git a/BasePlugin/BaseInterface.hh b/BasePlugin/BaseInterface.hh index d4848692b1af73b2a013079d6fcb68377df0a3d4..80fa2e15184ada199d79d264b37a57dee10fcf16 100644 --- a/BasePlugin/BaseInterface.hh +++ b/BasePlugin/BaseInterface.hh @@ -287,15 +287,17 @@ To use the BaseInterface:
  • 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() ) -\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 */ diff --git a/BasePlugin/ContextMenuInterface.hh b/BasePlugin/ContextMenuInterface.hh index 5ed72b2212815698dc865e4484feeada2b6867c3..f6315ced5d3322b1f5233b9f5a2f657e3255ba82 100644 --- a/BasePlugin/ContextMenuInterface.hh +++ b/BasePlugin/ContextMenuInterface.hh @@ -165,7 +165,7 @@ To use the ContextMenuInterface: -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: diff --git a/BasePlugin/MenuInterface.hh b/BasePlugin/MenuInterface.hh index 5a98f1ba3574fb6fbbd33cf2d078718d115b3987..e1a1946da6feee3392197fe3f5bd4cc2f864ad61 100644 --- a/BasePlugin/MenuInterface.hh +++ b/BasePlugin/MenuInterface.hh @@ -128,12 +128,12 @@ To use the MenuInterface:
  • And add the signals or slots you want to use to your plugin class (You don't need to implement all of them) -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")); diff --git a/BasePlugin/ToolboxInterface.hh b/BasePlugin/ToolboxInterface.hh index 01454c843fae85a041ee1dfa8b06107ce896ba0e..a87f01a1233f251385a58cbb38a4b6a8065584b7 100644 --- a/BasePlugin/ToolboxInterface.hh +++ b/BasePlugin/ToolboxInterface.hh @@ -114,13 +114,13 @@ To use the ToolboxInterface:
  • And add the signals or slots you want to use to your plugin class (You don't need to implement all of them) -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();