Commit 6b39edeb authored by Jan Möbius's avatar Jan Möbius

Added a list of failed plugins to the about dialog

parent 919f5bc6
......@@ -87,6 +87,7 @@
#include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh"
#include <OpenFlipper/common/FileTypes.hh>
#include <OpenFlipper/common/PluginStorage.hh>
/**
......@@ -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;
}
......
......@@ -72,11 +72,18 @@ namespace PluginStorage {
/// reference to Core plugin list
static std::vector<PluginInfo> plugins_;
/// reference to failed plugin list
static std::vector<PluginInfo> pluginsFailed_;
std::vector<PluginInfo>& plugins() {
return plugins_;
}
std::vector<PluginInfo>& pluginsFailed() {
return pluginsFailed_;
}
}
//=============================================================================
......
......@@ -63,6 +63,7 @@
#pragma once
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/Core/PluginInfo.hh>
......@@ -72,8 +73,13 @@
namespace PluginStorage {
/// Get the vector of all PluginInfos
DLLEXPORT
std::vector<PluginInfo>& plugins();
/// Get the vector of all PluginInfos for plugins that failed to load at startup
DLLEXPORT
std::vector<PluginInfo>& pluginsFailed();
}
......
......@@ -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
// =====================================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment