Add PluginArgs for plugin system
This commit is contained in:
@@ -15,16 +15,12 @@ void Plugin::addNewWizard(QString name, std::function<QVector<QWizardPage*>()> m
|
||||
m_newWizards.push_back({name, make});
|
||||
}
|
||||
|
||||
void Plugin::addImportWizard(QString name, std::function<QVector<QWizardPage*>()> make) {
|
||||
m_importWizards.push_back({name, make});
|
||||
QVector<WizardMaker> Plugin::newWizards(PluginArgs) {
|
||||
return {};
|
||||
}
|
||||
|
||||
QVector<WizardMaker> Plugin::newWizards() {
|
||||
return m_newWizards;
|
||||
}
|
||||
|
||||
QVector<WizardMaker> Plugin::importWizards() {
|
||||
return m_importWizards;
|
||||
QVector<WizardMaker> Plugin::importWizards(PluginArgs) {
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,12 +11,20 @@
|
||||
#include <functional>
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QPointer>
|
||||
#include <QSharedPointer>
|
||||
#include <QVector>
|
||||
#include <QWizardPage>
|
||||
|
||||
#include "project.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
|
||||
struct PluginArgs {
|
||||
Project *project = nullptr;
|
||||
};
|
||||
|
||||
struct WizardMaker {
|
||||
QString name;
|
||||
std::function<QVector<QWizardPage*>()> make;
|
||||
@@ -25,16 +33,15 @@ struct WizardMaker {
|
||||
class Plugin {
|
||||
private:
|
||||
QVector<WizardMaker> m_newWizards;
|
||||
QVector<WizardMaker> m_importWizards;
|
||||
|
||||
public:
|
||||
void addNewWizard(QString name, std::function<QVector<QWizardPage*>()> make);
|
||||
|
||||
void addImportWizard(QString name, std::function<QVector<QWizardPage*>()> make);
|
||||
|
||||
QVector<WizardMaker> newWizards();
|
||||
virtual QVector<WizardMaker> newWizards(PluginArgs);
|
||||
|
||||
QVector<WizardMaker> importWizards();
|
||||
virtual QVector<WizardMaker> importWizards(PluginArgs);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user