2018-12-30 15:46:15 +01:00
|
|
|
|
#include "plugin_support/PluginModule.h"
|
2019-01-01 11:15:16 +01:00
|
|
|
|
#include <QDebug>
|
2018-12-30 15:46:15 +01:00
|
|
|
|
|
|
|
|
|
|
PluginModule::PluginModule(QString name, QString ident)
|
|
|
|
|
|
: m_name(std::move(name))
|
|
|
|
|
|
, m_ident(std::move(ident))
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PluginModule::setDisplayCategory(QString category)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_displayCategory = std::move(category);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-01-31 19:31:17 +01:00
|
|
|
|
void PluginModule::registerStaticAction(StaticAction action)
|
2018-12-30 15:46:15 +01:00
|
|
|
|
{
|
2019-01-01 11:15:16 +01:00
|
|
|
|
qDebug() << "registerMenuAction " << action.text();
|
|
|
|
|
|
m_menuActions.emplace_back(std::move(action));
|
|
|
|
|
|
}
|
2018-12-30 15:46:15 +01:00
|
|
|
|
|
2019-01-31 19:31:17 +01:00
|
|
|
|
const PluginModule::StaticActionList& PluginModule::staticActions() const
|
2019-01-01 11:15:16 +01:00
|
|
|
|
{
|
|
|
|
|
|
return m_menuActions;
|
2018-12-30 15:46:15 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-12-31 15:20:55 +01:00
|
|
|
|
void PluginModule::registerModuleAction(QString module_action, ModuleAction action)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_moduleActions.emplace(
|
|
|
|
|
|
std::move(module_action),
|
|
|
|
|
|
std::move(action)
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2018-12-30 15:46:15 +01:00
|
|
|
|
|
2018-12-31 15:20:55 +01:00
|
|
|
|
const PluginModule::ModuleAction* PluginModule::findModuleAction(const QString &module_action) const
|
|
|
|
|
|
{
|
|
|
|
|
|
auto res = m_moduleActions.find(module_action);
|
|
|
|
|
|
if (res == m_moduleActions.end())
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
return &res->second;
|
|
|
|
|
|
}
|
2019-01-05 19:58:23 +01:00
|
|
|
|
|