diff --git a/Core/PluginLoader.cc b/Core/PluginLoader.cc index 103b6038814ec8d13df2411d0ccf6a03b1ac28ce..91819278122dcb826025676c2bd36f2d71173598 100644 --- a/Core/PluginLoader.cc +++ b/Core/PluginLoader.cc @@ -87,6 +87,7 @@ #include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh" #include +#include /** @@ -804,6 +805,12 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); info.description = basePlugin->description() + tr(" *Already loaded.*"); + + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; }else{ //ask the user int ret = QMessageBox::question(coreWidget_, @@ -819,6 +826,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); info.description = basePlugin->description() + tr(" *Already loaded.*"); + + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); return; } } @@ -834,6 +846,12 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); info.status = PluginInfo::BLOCKED; + + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; } @@ -859,6 +877,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic info.description = basePlugin->description() + tr(" *Plugin access denied.*"); // Abort here, as the plugin will not do anything else until correct authentication. + + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); return; } } @@ -881,6 +904,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; } @@ -894,6 +922,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; } @@ -902,6 +935,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; } @@ -2086,6 +2124,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic printPluginLoadLog(errors, warnings); + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; } @@ -2144,6 +2187,12 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic if ( openGLCheck != "" ) { errors += tr("Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString + " !" + "\n"; errors += openGLCheck + "\n"; + + info.errors = errors; + info.warnings = warnings; + + PluginStorage::pluginsFailed().push_back(info); + return; } diff --git a/common/PluginStorage.cc b/common/PluginStorage.cc index 95cfc74fe66980a56845fefc60f27cb1008d5972..096666186acb27704201398089b77fce29cd2d14 100644 --- a/common/PluginStorage.cc +++ b/common/PluginStorage.cc @@ -72,11 +72,18 @@ namespace PluginStorage { /// reference to Core plugin list static std::vector plugins_; +/// reference to failed plugin list +static std::vector pluginsFailed_; + std::vector& plugins() { return plugins_; } +std::vector& pluginsFailed() { + return pluginsFailed_; +} + } //============================================================================= diff --git a/common/PluginStorage.hh b/common/PluginStorage.hh index 057a281c96b829923e3f8e8580e09702f47b9b8d..205ab5e569b2c42ecbf5e727a3c3975d3c750484 100644 --- a/common/PluginStorage.hh +++ b/common/PluginStorage.hh @@ -63,6 +63,7 @@ #pragma once +#include #include @@ -72,8 +73,13 @@ namespace PluginStorage { /// Get the vector of all PluginInfos + DLLEXPORT std::vector& plugins(); + /// Get the vector of all PluginInfos for plugins that failed to load at startup + DLLEXPORT + std::vector& pluginsFailed(); + } diff --git a/widgets/coreWidget/About.cc b/widgets/coreWidget/About.cc index 77cad931f2e43592aa8ca64c623c0e77dad29984..db326669126209b034d168b64759fe9ac9c20f73 100644 --- a/widgets/coreWidget/About.cc +++ b/widgets/coreWidget/About.cc @@ -777,6 +777,38 @@ void CoreWidget::showAboutWidget( ) { } + // ===================================================================================== + // List failed Plugins + // ===================================================================================== + aboutWidget_->OpenFlipperAbout->setCurrentFont(boldFont); + aboutWidget_->OpenFlipperAbout->append(tr("Failed Plugins:")); + aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont); + + for ( unsigned i = 0 ; i < PluginStorage::pluginsFailed().size() ; ++i ) { + aboutWidget_->OpenFlipperAbout->setCurrentFont(boldFont); + aboutWidget_->OpenFlipperAbout->append( "\t" + PluginStorage::pluginsFailed()[i].name ); + aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont); + aboutWidget_->OpenFlipperAbout->append( "\t\t Version: \t\t" + PluginStorage::pluginsFailed()[i].version ); + aboutWidget_->OpenFlipperAbout->append( "\t\t Description: \t" + PluginStorage::pluginsFailed()[i].description ); + aboutWidget_->OpenFlipperAbout->append( "\t\t Path \t\t" + PluginStorage::pluginsFailed()[i].path ); + + if ( !PluginStorage::pluginsFailed()[i].warnings.isEmpty() ) { + aboutWidget_->OpenFlipperAbout->setTextColor(Qt::darkYellow); + aboutWidget_->OpenFlipperAbout->append( "\t\t Warnings: \t\t" + PluginStorage::pluginsFailed()[i].warnings ); + aboutWidget_->OpenFlipperAbout->setTextColor(Qt::black); + } + + if ( !PluginStorage::pluginsFailed()[i].errors.isEmpty() ) { + aboutWidget_->OpenFlipperAbout->setTextColor(Qt::darkRed); + aboutWidget_->OpenFlipperAbout->append( "\t\t Errors: \t\t" + PluginStorage::pluginsFailed()[i].errors ); + aboutWidget_->OpenFlipperAbout->setTextColor(Qt::black); + } + + } + + + + // ===================================================================================== // List of build-in resources // =====================================================================================