28 lines
853 B
C++
28 lines
853 B
C++
|
|
#include "PluginContentWidgetContextBase.h"
|
|||
|
|
#include "PluginRegister.h"
|
|||
|
|
#include "PluginModule.h"
|
|||
|
|
#include <QDebug>
|
|||
|
|
|
|||
|
|
PluginContentWidgetContextBase::PluginContentWidgetContextBase() = default;
|
|||
|
|
|
|||
|
|
void PluginContentWidgetContextBase::moduleAction(
|
|||
|
|
const QString &module_identifier,
|
|||
|
|
QString module_action,
|
|||
|
|
const ModuleActionParameters &action_params
|
|||
|
|
)
|
|||
|
|
{
|
|||
|
|
auto reg = PluginRegister::getInstance();
|
|||
|
|
auto mod = reg->findModule(module_identifier);
|
|||
|
|
if (mod) {
|
|||
|
|
auto action = mod->findModuleAction(module_action);
|
|||
|
|
if (action) {
|
|||
|
|
qDebug() << QString("module %1 action %2 called ").arg(module_identifier, module_action);
|
|||
|
|
(*action)(this, action_params);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
qWarning() << QString("module %1 has no action %2").arg(module_identifier, module_action);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
qWarning() << QString("module not found %1").arg(module_identifier);
|
|||
|
|
}
|