mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Merge pull request #13 from AnyOldName3/free-plugin-support
Add support for free plugins which don't implement any specialised interface
This commit is contained in:
@@ -26,8 +26,11 @@ virtual bool isActive() const override; \
|
||||
virtual QList<MOBase::PluginSetting> settings() const override;
|
||||
|
||||
|
||||
class IPluginWrapper : public MOBase::IPlugin, public boost::python::wrapper<MOBase::IPlugin>
|
||||
// Even though the base interface is not a QObject, this has to be because we have no way to pass Mod Organizer a plugin that implements multiple interfaces.
|
||||
// QObject must be the first base class because moc assumes the first base class is a QObject
|
||||
class IPluginWrapper : public QObject, public MOBase::IPlugin, public boost::python::wrapper<MOBase::IPlugin>
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(MOBase::IPlugin)
|
||||
|
||||
COMMON_I_PLUGIN_WRAPPER_DECLARATIONS
|
||||
|
||||
@@ -1320,6 +1320,8 @@ QList<QObject*> PythonRunner::instantiate(const QString &pluginName)
|
||||
TRY_PLUGIN_TYPE(IPluginModPage, pluginObj);
|
||||
TRY_PLUGIN_TYPE(IPluginPreview, pluginObj);
|
||||
TRY_PLUGIN_TYPE(IPluginTool, pluginObj);
|
||||
if (interfaceList.isEmpty())
|
||||
TRY_PLUGIN_TYPE(IPluginWrapper, pluginObj);
|
||||
|
||||
return interfaceList;
|
||||
} catch (const bpy::error_already_set&) {
|
||||
|
||||
Reference in New Issue
Block a user