Commit fa468ff5 authored by Jan Möbius's avatar Jan Möbius

Collect plugin load warnings ad errors and list them in the about dialog

parent bc4c5aef
......@@ -1225,6 +1225,10 @@ private slots:
/// Load all plugins from default plugin directory and from INI-File
void loadPlugins();
/// Print all info collected about plugin during loading
void printPluginLoadLog(const QString& errors,const QString& warnings);
private slots:
/// Show Plugins Dialog
void slotShowPlugins();
......
......@@ -85,6 +85,8 @@ class PluginInfo{
version(""),
path(""),
rpcName(""),
errors(""),
warnings(""),
optionsWidget(0),
buildIn(true),
status(FAILED)
......@@ -108,6 +110,8 @@ class PluginInfo{
version(_i.version),
path(_i.path),
rpcName(_i.rpcName),
errors(_i.errors),
warnings(_i.warnings),
rpcFunctions(_i.rpcFunctions),
slotInfos(_i.slotInfos),
keys(_i.keys),
......@@ -141,6 +145,12 @@ class PluginInfo{
/// Clean rpc name of the plugin
QString rpcName;
/// Store errors encountered during plugin loading
QString errors;
/// Store warnings encountered during plugin loading
QString warnings;
/// List of exported rpc slots
QStringList rpcFunctions;
......
......@@ -547,6 +547,7 @@ void Core::loadPlugins()
} else {
emit log(LOGWARN,tr("Plugin License check failed: "));
std::cerr << licenseTexts.toStdString() << std::endl;
}
......@@ -693,6 +694,13 @@ void Core::slotUnBlockPlugin(const QString &_name)
plugins_[i].status = PluginInfo::UNLOADED;
}
void Core::printPluginLoadLog(const QString& errors,const QString& warnings ) {
emit log(LOGERR ,errors );
emit log(LOGWARN,warnings );
emit log(LOGOUT,"================================================================================");
}
/** @brief Load a Plugin with given filename
* @param _filename complete path + filename of the plugin
* @param _silent if 'true': user isn't asked what to do if a plugin is already loaded
......@@ -719,6 +727,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// This will be the reference to our plugin
QObject *plugin = 0;
// Collect error and warning info
QString errors, warnings;
// Try to open the file if we did not get a plugin,
// Otherwise use the supplied plugin pointer
if ( _plugin == 0 ) {
......@@ -726,11 +738,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
plugin = loader.instance();
if ( !plugin) {
emit log(LOGERR,tr("Unable to load Plugin :\t %1").arg( _filename ) );
emit log(LOGERR,tr("Error was : ") + loader.errorString() );
errors += tr("Error: Unable to load Plugin :\t %1").arg( _filename ) + "\n";
errors += tr("Error: Error was : ") + loader.errorString() + "\n";
emit log(LOGERR,errors );
emit log(LOGOUT,"================================================================================");
} else {
emit log (LOGOUT,tr("Plugin loaded: \t %1").arg(_filename));
}
emit log (LOGOUT,tr("Plugin loaded: \t %1").arg(_filename));
} else {
plugin = _plugin;
......@@ -758,6 +775,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
info.name = basePlugin->name();
info.rpcName = info.name.remove(" ").toLower();
info.description = basePlugin->description();
info.warnings = "BLA";
QStringList additionalPlugins = OpenFlipperSettings().value("PluginControl/AdditionalPlugins", QStringList()).toStringList();
info.buildIn = !additionalPlugins.contains(info.path);
......@@ -777,8 +795,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if (plugins_[k].name == name_nospace && plugins_[k].path != _filename && plugins_[k].status == PluginInfo::LOADED){
if (_silent || OpenFlipper::Options::nogui() ){ //dont load the plugin
emit log(LOGWARN, tr("\t\t\t Already loaded from %1").arg( plugins_[k].path) );
emit log(LOGOUT,"================================================================================");
warnings += tr("Warning: Already loaded from %1").arg( plugins_[k].path) + "\n";
printPluginLoadLog(errors, warnings);
info.description = basePlugin->description() + tr(" *Already loaded.*");
return;
}else{ //ask the user
......@@ -790,8 +811,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
if (ret == QMessageBox::No)
{
emit log(LOGWARN, tr("\t\t\t Already loaded from %1.").arg( plugins_[k].path));
emit log(LOGOUT,"================================================================================");
warnings += tr("Warning: Already loaded from %1.").arg( plugins_[k].path) + "\n";
printPluginLoadLog(errors, warnings);
info.description = basePlugin->description() + tr(" *Already loaded.*");
return;
}
......@@ -802,8 +825,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames",QStringList()).toStringList();
if ( dontLoadPlugins.contains(basePlugin->name(), Qt::CaseInsensitive) ) {
emit log(LOGWARN,tr("OpenFlipper.ini prevented Plugin %1 from being loaded! ").arg( basePlugin->name() ));
emit log(LOGOUT,"================================================================================");
warnings += tr("Warning: OpenFlipper.ini prevented Plugin %1 from being loaded! ").arg( basePlugin->name() ) + "\n";
printPluginLoadLog(errors, warnings);
info.status = PluginInfo::BLOCKED;
return;
}
......@@ -823,8 +849,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( success )
emit log(LOGINFO,tr("... ok. Loading plugin "));
else {
emit log(LOGERR,tr("... failed. Plugin access denied."));
emit log(LOGOUT,"================================================================================");
errors += tr("Error: Failed to load plugin. Plugin access denied by license management.");
printPluginLoadLog(errors, warnings);
info.description = basePlugin->description() + tr(" *Plugin access denied.*");
// Abort here, as the plugin will not do anything else until correct authentication.
return;
......@@ -845,8 +874,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( OpenFlipper::Options::nogui() ) {
if ( ! checkSlot( plugin , "noguiSupported()" ) ) {
emit log(LOGWARN,tr("Running in nogui mode which is unsupported by this plugin, skipping") );
emit log(LOGOUT,"================================================================================");
warnings += tr("Warning: Running in nogui mode which is unsupported by this plugin, skipping");
printPluginLoadLog(errors, warnings);
return;
}
......@@ -855,14 +886,19 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// Check for baseInterface of old style!
if ( checkSignal(plugin,"updated_objects(int)") ) {
log(LOGERR,tr("Plugin Uses old style updated_objects! Convert to updatedObject!"));
emit log(LOGOUT,"================================================================================");
errors += tr("Error: Plugin Uses old style updated_objects! Convert to updatedObject!") + "\n";
printPluginLoadLog(errors, warnings);
return;
}
if ( checkSignal(plugin,"update_view()") ) {
log(LOGERR,tr("Plugin Uses old style update_view! Convert to updateView!"));
emit log(LOGOUT,"================================================================================");
errors += tr("Error: Plugin Uses old style update_view! Convert to updateView!") + "\n";
printPluginLoadLog(errors, warnings);
return;
}
......@@ -874,12 +910,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSignal(plugin,"updatedObject(int)") && checkSignal(plugin,"updatedObject(int,const UpdateType&)") ){
errors += tr("Error: Plugin uses deprecated and(!) new updatedObject. Only new updatedObject will be active.") + "\n";
log(LOGERR,tr("Plugin uses deprecated and(!) new updatedObject. Only new updatedObject will be active."));
connect(plugin,SIGNAL(updatedObject(int,const UpdateType&)),this,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::AutoConnection);
} else {
if ( checkSignal(plugin,"updatedObject(int)") ){
warnings += tr("Warning: Plugin uses deprecated updatedObject.") + "\n";
log(LOGWARN,tr("Plugin uses deprecated updatedObject."));
connect(plugin,SIGNAL(updatedObject(int)),this,SLOT(slotObjectUpdated(int)), Qt::AutoConnection);
}
......@@ -889,6 +929,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) && checkSlot( plugin , "slotObjectUpdated(int,const UpdateType&)" ) ){
errors += tr("Error: Plugin uses deprecated and(!) new slotObjectUpdated. Only new slotObjectUpdated will be active.") + "\n";
log(LOGERR,tr("Plugin uses deprecated and(!) new slotObjectUpdated. Only new slotObjectUpdated will be active."));
connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType&)),plugin,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
......@@ -896,6 +937,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} else {
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) ){
warnings += tr("Warning: Plugin uses deprecated slotObjectUpdated.") + "\n";
log(LOGWARN,tr("Plugin uses deprecated slotObjectUpdated."));
connect(this,SIGNAL(signalObjectUpdated(int)),plugin,SLOT(slotObjectUpdated(int)), Qt::DirectConnection);
}
......@@ -905,9 +947,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
if ( checkSignal(plugin,"objectPropertiesChanged(int)")) {
emit log (LOGERR,tr("Signal objectPropertiesChanged(int) is deprecated. " ));
emit log (LOGERR,tr("The signal will be automatically emitted by the object that has been changed and the core will deliver it to the plugins!. "));
emit log (LOGERR,tr("Please remove this signal from your plugins!. "));
errors += tr("Error: Signal objectPropertiesChanged(int) is deprecated.") + "\n";
errors += tr("Error: The signal will be automatically emitted by the object that has been changed and the core will deliver it to the plugins!.") + "\n";
errors += tr("Error: Please remove this signal from your plugins!.") + "\n";
}
if ( checkSlot( plugin , "slotViewChanged()" ) )
......@@ -922,13 +964,14 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSlot(plugin,"slotObjectPropertiesChanged(int)"))
connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection);
if ( checkSignal(plugin,"visibilityChanged()" ) )
emit log (LOGERR,tr("Signal visibilityChanged() now requires objectid or -1 as argument " ));
if ( checkSignal(plugin,"visibilityChanged()" ) ) {
errors += tr("Error: Signal visibilityChanged() now requires objectid or -1 as argument.") + "\n";
}
if ( checkSignal(plugin,"visibilityChanged(int)") ) {
emit log (LOGERR,tr("Signal visibilityChanged(int) is deprecated! " ));
emit log (LOGERR,tr("If an object changes its visibility, it will call the required functions automatically." ));
emit log (LOGERR,tr("If you change a scenegraph node, call nodeVisibilityChanged(int). See docu of this function for details." ));
errors += tr("Error: Signal visibilityChanged(int) is deprecated!") + "\n";
errors += tr("Error: If an object changes its visibility, it will call the required functions automatically.") + "\n";
errors += tr("Error: If you change a scenegraph node, call nodeVisibilityChanged(int). See docu of this function for details.") + "\n";
}
if ( checkSignal(plugin,"nodeVisibilityChanged(int)") )
......@@ -938,19 +981,21 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSlot(plugin,"slotVisibilityChanged(int)") )
connect(this,SIGNAL(visibilityChanged(int)),plugin,SLOT(slotVisibilityChanged(int)), Qt::DirectConnection);
if ( checkSignal(plugin,"activeObjectChanged()" ) )
emit log (LOGERR,tr("Signal activeObjectChanged() is now objectSelectionChanged( int _objectId ) ") );
if ( checkSignal(plugin,"activeObjectChanged()" ) ) {
errors += tr("Error: Signal activeObjectChanged() is now objectSelectionChanged( int _objectId )") + "\n";
}
if ( checkSlot(plugin,"slotActiveObjectChanged()" ) )
emit log (LOGERR,tr("Slot slotActiveObjectChanged() is now slotObjectSelectionChanged( int _objectId ) ") );
if ( checkSlot(plugin,"slotActiveObjectChanged()" ) ) {
errors += tr("Error: Slot slotActiveObjectChanged() is now slotObjectSelectionChanged( int _objectId ) ") + "\n";
}
if ( checkSlot(plugin,"slotAllCleared()") )
connect(this,SIGNAL(allCleared()),plugin,SLOT(slotAllCleared()));
if ( checkSignal(plugin,"objectSelectionChanged(int)") ) {
emit log (LOGERR,tr("Signal objectSelectionChanged(in) is deprecated!") );
emit log (LOGERR,tr("If the selection for an object is changed, the core will emit the required signals itself!") );
errors += tr("Error: Signal objectSelectionChanged(in) is deprecated!") + "\n";
errors += tr("Error: If the selection for an object is changed, the core will emit the required signals itself!") + "\n";
}
if ( checkSlot( plugin , "slotObjectSelectionChanged(int)" ) )
......@@ -1261,8 +1306,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( selectionPlugin && OpenFlipper::Options::gui() ) {
supported = supported + "SelectionBase ";
if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QIcon,QString&)") )
if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QIcon,QString&)") ) {
errors += tr("Error: Plugin uses deprecated addSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!") + "\n";
log(LOGERR,tr("Plugin uses deprecated addSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
}
if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QString,QString&)") )
connect(plugin , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
......@@ -1270,8 +1317,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// ===============
if ( checkSlot(plugin,"slotAddSelectionEnvironment(QString,QString,QIcon,QString&)") )
log(LOGERR,tr("Plugin uses deprecated slotAddSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
if ( checkSlot(plugin,"slotAddSelectionEnvironment(QString,QString,QIcon,QString&)") ) {
errors += tr("Error: Plugin uses deprecated slotAddSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!") + "\n";
}
if ( checkSlot( plugin , "slotAddSelectionEnvironment(QString,QString,QString,QString&)" ) )
connect(this , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
......@@ -1291,8 +1339,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// ===============
if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") )
log(LOGERR,tr("Plugin uses deprecated addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!"));
if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") ) {
errors += tr("Error: Plugin uses deprecated addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!") + "\n";
}
if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)") )
connect(plugin , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
......@@ -1309,8 +1358,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// ===============
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") )
log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") ) {
errors += tr("Error: Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!") + "\n";
log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
}
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
......@@ -1318,8 +1370,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// ===============
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") ) {
errors += tr("Error: Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!") + "\n";
log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
}
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),
......@@ -1327,8 +1381,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// ===============
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") )
log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") ) {
errors += tr("Error: Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!") + "\n";
log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
}
if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
......@@ -1336,8 +1392,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// ===============
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") ) {
errors += tr("Error: Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!") + "\n";
log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
}
if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)),
......@@ -1922,26 +1980,30 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSignal(plugin,"startJob(QString,QString,int,int,bool)" ) )
connect(plugin , SIGNAL(startJob(QString, QString,int,int,bool)),
this , SLOT( slotStartJob(QString, QString,int,int,bool) ), Qt::DirectConnection );
else
emit log(LOGERR,"Process Interface defined but no startJob signal found!");
else {
errors += tr("Error: Process Interface defined but no startJob signal found!") + "\n";
}
if ( checkSignal(plugin,"setJobState(QString,int)" ) )
connect(plugin , SIGNAL(setJobState(QString,int)),
this , SLOT( slotSetJobState(QString,int) ), Qt::QueuedConnection );
else
emit log(LOGERR,"Process Interface defined but no setJobState signal found!");
else {
errors += tr("Error: Process Interface defined but no setJobState signal found!") + "\n";
}
if ( checkSignal(plugin,"setJobName(QString,QString)" ) )
connect(plugin , SIGNAL(setJobName(QString, QString)),
this , SLOT( slotSetJobName(QString, QString) ), Qt::QueuedConnection );
else
emit log(LOGERR,"Process Interface defined but no setJobName signal found!");
else {
errors += tr("Error: Process Interface defined but no setJobName signal found!") + "\n";
}
if ( checkSignal(plugin,"setJobDescription(QString,QString)" ) )
connect(plugin , SIGNAL(setJobDescription(QString, QString)),
this , SLOT( slotSetJobDescription(QString, QString) ), Qt::QueuedConnection );
else
emit log(LOGERR,"Process Interface defined but no setJobDescription signal found!");
else {
errors += tr("Error: Process Interface defined but no setJobDescription signal found!") + "\n";
}
if ( checkSignal(plugin,"cancelJob(QString)" ) )
connect(plugin , SIGNAL(cancelJob(QString)),
......@@ -1950,14 +2012,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSignal(plugin,"finishJob(QString)" ) )
connect(plugin , SIGNAL(finishJob(QString)),
this , SLOT( slotFinishJob(QString) ), Qt::QueuedConnection );
else
emit log(LOGERR,"Process Interface defined but no finishJob signal found!");
else {
errors += tr("Error: Process Interface defined but no finishJob signal found!") + "\n";
}
if ( checkSlot(plugin,"canceledJob(QString)" ) )
connect(this , SIGNAL( jobCanceled( QString ) ) ,
plugin , SLOT( canceledJob(QString) ),Qt::QueuedConnection);
else
emit log(LOGERR,"Process Interface defined but no cancel canceledJob slot found!");
else {
errors += tr("Error: Process Interface defined but no cancel canceledJob slot found!") + "\n";
}
}
//Check if the plugin supports RPC-Interface
......@@ -2014,8 +2078,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
if ( openGLCheck != "" ) {
emit log(LOGERR,tr("Error: Insufficient OpenGL capabilities in Renderer Plugin ") + rendererNameString + " !");
emit log(LOGERR,openGLCheck);
errors += tr("Error: Insufficient OpenGL capabilities in Renderer Plugin ") + rendererNameString + " !" + "\n";
errors += openGLCheck + "\n";
printPluginLoadLog(errors, warnings);
return;
}
......@@ -2024,7 +2091,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( ! renderManager().rendererExists(rendererNameString) ) {
rendererInfo = renderManager().newRenderer(rendererNameString);
} else {
emit log(LOGERR,tr("Error: Renderer Plugin %1 already exists").arg(rendererNameString));
errors += tr("Error: Renderer Plugin %1 already exists") + "\n";
}
// Retrieve and store renderer information
......@@ -2051,7 +2118,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
} else {
emit log(LOGERR,tr("Error: Renderer Plugin without rendererName Function?!"));
errors += tr("Error: Renderer Plugin without rendererName Function?!") + "\n";
}
}
......@@ -2072,8 +2139,8 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
if ( openGLCheck != "" ) {
emit log(LOGERR,tr("Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString + " !");
emit log(LOGERR,openGLCheck);
errors += tr("Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString + " !" + "\n";
errors += openGLCheck + "\n";
return;
}
......@@ -2082,7 +2149,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( ! postProcessorManager().postProcessorExists(postProcessorNameString) ) {
postProcessorInfo = postProcessorManager().newPostProcessor(postProcessorNameString);
} else {
emit log(LOGERR,tr("Error: PostProcessor Plugin %1 already exists").arg(postProcessorNameString));
errors += tr("Error: PostProcessor Plugin %1 already exists").arg(postProcessorNameString) + "\n";
}
// Retrieve and store PostProcessor information
......@@ -2102,7 +2169,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
} else {
emit log(LOGERR,tr("Error: PostProcessor Plugin without postProcessorName Function?!"));
errors += tr("Error: PostProcessor Plugin without postProcessorName Function?!") + "\n";
}
}
......@@ -2214,15 +2281,21 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
//========================================================================================
//========================================================================================
info.status = PluginInfo::LOADED;
if (alreadyLoadedAt != -1)
info.errors = errors;
info.warnings = warnings;
if (alreadyLoadedAt != -1) {
plugins_[alreadyLoadedAt] = info;
}
else
plugins_.push_back(info);
printPluginLoadLog(errors, warnings);
// Initialize Plugin
if ( basePlugin ) {
if ( checkSlot(plugin,"initializePlugin()") )
......@@ -2313,6 +2386,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
}
emit log(LOGOUT,"================================================================================");
//========================================================================================
}
......@@ -760,6 +760,19 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append( "\t\t Version: \t\t" + plugins_[i].version );
aboutWidget_->OpenFlipperAbout->append( "\t\t Description: \t" + plugins_[i].description );
aboutWidget_->OpenFlipperAbout->append( "\t\t Path \t\t" + plugins_[i].path );
if ( !plugins_[i].warnings.isEmpty() ) {
aboutWidget_->OpenFlipperAbout->setTextColor(Qt::darkYellow);
aboutWidget_->OpenFlipperAbout->append( "\t\t Warnings: \t\t" + plugins_[i].warnings );
aboutWidget_->OpenFlipperAbout->setTextColor(Qt::black);
}
if ( !plugins_[i].errors.isEmpty() ) {
aboutWidget_->OpenFlipperAbout->setTextColor(Qt::darkRed);
aboutWidget_->OpenFlipperAbout->append( "\t\t Errors: \t\t" + plugins_[i].errors );
aboutWidget_->OpenFlipperAbout->setTextColor(Qt::black);
}
}
// =====================================================================================
......
......@@ -1280,6 +1280,7 @@ public:
private :
/// reference to Core plugin list
std::vector<PluginInfo>& plugins_;
......
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