for asPluginManager I developed a method for other plugins to provide info about themselves. It is quite easy. You can download the needed files ToolData.h and ToolData.cpp here:
http://schrell.de/cgi-bin/gitweb.cgi?p=PluginTools.git
or with git directly:
Code: Select all
git clone http://schrell.de/PluginTools.gitCode: Select all
PluginBase/
PluginBase/SDK
PluginBase/PluginTools
PluginBase/PluginDefaults (optional if you want to use it, it makes project files life easier)
PluginBase/MyPluginCode: Select all
# ToolData support:
DEPENDPATH += ../PluginTools
INCLUDEPATH += ../PluginTools
HEADERS += ToolData.h
SOURCES += ToolData.cppCode: Select all
PluginDependency *MyPlugin::createDependency(const QString &depName)
{
if (depName == "ToolData") {
ToolData *toolData = new ToolData();
if (toolData) {
toolData->owner = name();
toolData->group = group();
toolData->ownerId = m_id;
toolData->groupId = m_groupId;
toolData->addEnabledId(m_hub->optionIdForName("myPluginOn",m_id)); // simple case one option
toolData->addEnabledId(m_hub->optionIdForName("myPluginOn2",m_id), "E2", "Enable option 2", "This is the hint for E2"); // give names for more than one option
return toolData;
}
}
return NULL;
}How does this talk to asPluginManager? The asPluginManager looks for the plugin directories. Every directory name is looked u p in its config file for the corresponding plugin identifier. On the first hotnessChange it receives (this is the first possible step for this to do), it calls startPluginData() to get the ToolData from you. If you implemented it like shown above, asPM will get the info of your numeric id and you enabled option ids asynchronously (after this hotnessChange). On every following hotnessChange/settingsChange asPM will ask ASP for your enabled options and show their state in the asPM toolbox.
Thats it for the moment. I hope I did not forget something. I will release a new asPluginManager today which can be used for testing.
Further plans:
- Checkboxes in asPluginManager to have a central place to enable/disable registered plugins
Andreas
