diff --git a/src/common/plugins/interfaces/plugin_interface.cpp b/src/common/plugins/interfaces/plugin_interface.cpp index 7161c8049..f33a3bd97 100644 --- a/src/common/plugins/interfaces/plugin_interface.cpp +++ b/src/common/plugins/interfaces/plugin_interface.cpp @@ -1,7 +1,7 @@ #include "plugin_interface.h" PluginInterface::PluginInterface() : - logstream(nullptr) + logstream(nullptr), enabled(true) { } @@ -10,6 +10,26 @@ void PluginInterface::setLog(GLLogStream* log) this->logstream = log; } +bool PluginInterface::isEnabled() const +{ + return enabled; +} + +void PluginInterface::enable() +{ + enabled = true; +} + +void PluginInterface::disable() +{ + enabled = false; +} + +QFileInfo PluginInterface::pluginFileInfo() const +{ + return plugFileInfo; +} + void PluginInterface::log(const char* s) { if(logstream != nullptr) { diff --git a/src/common/plugins/interfaces/plugin_interface.h b/src/common/plugins/interfaces/plugin_interface.h index 41ec2fb0e..865c3c504 100644 --- a/src/common/plugins/interfaces/plugin_interface.h +++ b/src/common/plugins/interfaces/plugin_interface.h @@ -25,7 +25,7 @@ #define MESHLAB_PLUGIN_INTERFACE_H #include - +#include #include "../../GLLogStream.h" #include "../../parameters/rich_parameter_list.h" @@ -46,6 +46,8 @@ class PluginInterface { public: + friend class PluginManager; + typedef int FilterIDType; /** the type used to identify plugin actions; there is a one-to-one relation between an ID and an Action. @@ -72,6 +74,12 @@ public: /// Standard stuff that usually should not be redefined. void setLog(GLLogStream* log); + + bool isEnabled() const; + void enable(); + void disable(); + + QFileInfo pluginFileInfo() const; // This function must be used to communicate useful information collected in the parsing/saving of the files. // NEVER EVER use a msgbox to say something to the user. @@ -97,6 +105,8 @@ public: private: GLLogStream *logstream; + bool enabled; + QFileInfo plugFileInfo; }; /************************ diff --git a/src/common/plugins/plugin_manager.cpp b/src/common/plugins/plugin_manager.cpp index fb3c996a9..7dc5f1b50 100644 --- a/src/common/plugins/plugin_manager.cpp +++ b/src/common/plugins/plugin_manager.cpp @@ -251,6 +251,7 @@ bool PluginManager::loadPlugin(const QString& fileName) //TODO: check in some way also the meshlab version of the plugin if (ip) { //Classic MeshLab plugin (non Edit...) + ip->plugFileInfo = fin; bool loadOk = false; //FilterPlugin FilterPluginInterface *iFilter = qobject_cast(plugin);