Work on plugin mechanism
Context actions have become normal actions in the pluginwidget so the widget knows abot them and can easily do things like enable/disable.
This commit is contained in:
parent
eca8841427
commit
a704332342
24 changed files with 239 additions and 267 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "ModuleActionParameters.h"
|
||||
#include "StaticAction.h"
|
||||
#include "LContextAction.h"
|
||||
#include "PluginRegister.h"
|
||||
#include <QObject>
|
||||
#include <functional>
|
||||
|
|
@ -17,7 +16,6 @@ class PluginModule: public QObject {
|
|||
Q_OBJECT
|
||||
public:
|
||||
using StaticActionList = std::vector<StaticAction>;
|
||||
using ContextActionList = std::vector<LContextAction>;
|
||||
using ModuleAction = std::function<void(IPluginContentWidgetContext*, const ModuleActionParameters &)>;
|
||||
using ModuleActionMap = std::map<QString, ModuleAction>;
|
||||
|
||||
|
|
@ -43,11 +41,6 @@ public:
|
|||
/// When the action is not found nullptr is returned.
|
||||
const ModuleAction* findModuleAction(const QString &module_action) const;
|
||||
|
||||
void registerContextAction(const LContextAction &action)
|
||||
{
|
||||
m_widgetActions.push_back(action);
|
||||
}
|
||||
const ContextActionList& contextActions() const { return m_widgetActions; }
|
||||
private:
|
||||
/// Name shown to end users
|
||||
QString m_name;
|
||||
|
|
@ -57,7 +50,6 @@ private:
|
|||
|
||||
StaticActionList m_menuActions;
|
||||
ModuleActionMap m_moduleActions;
|
||||
ContextActionList m_widgetActions;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue