Commits (6)
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
#include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh> #include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh>
#include <OpenFlipper/common/PluginStorage.hh>
#define WIDGET_HEIGHT 800 #define WIDGET_HEIGHT 800
#define WIDGET_WIDTH 800 #define WIDGET_WIDTH 800
...@@ -236,7 +238,7 @@ Core::init() { ...@@ -236,7 +238,7 @@ Core::init() {
Qt::AlignBottom | Qt::AlignLeft , Qt::white); Qt::AlignBottom | Qt::AlignLeft , Qt::white);
} }
coreWidget_ = new CoreWidget(viewModes_ , plugins_, coreSlots_); coreWidget_ = new CoreWidget(viewModes_ , coreSlots_);
spinBoxEventFilter_.registerScrollArea(coreWidget_->getToolboxScrollArea()); spinBoxEventFilter_.registerScrollArea(coreWidget_->getToolboxScrollArea());
spinBoxEventFilter_.registerScrollArea(coreWidget_->getToolboxArea()); spinBoxEventFilter_.registerScrollArea(coreWidget_->getToolboxArea());
...@@ -718,6 +720,12 @@ Core::~Core() ...@@ -718,6 +720,12 @@ Core::~Core()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
std::vector<PluginInfo>& Core::plugins() {
return PluginStorage::plugins();
};
//-----------------------------------------------------------------------------
void void
Core::slotMouseEventIdentify( QMouseEvent* _event ) Core::slotMouseEventIdentify( QMouseEvent* _event )
{ {
...@@ -1169,8 +1177,8 @@ void Core::slotExit() { ...@@ -1169,8 +1177,8 @@ void Core::slotExit() {
clearAll(); clearAll();
// Notify plugins of imminent exit. // Notify plugins of imminent exit.
for ( uint i = 0 ; i < plugins_.size() ; ++i ){ for ( uint i = 0 ; i < plugins().size() ; ++i ){
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins_[i].plugin); BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins()[i].plugin);
// Dont call exit if we cannot get the Plugin // Dont call exit if we cannot get the Plugin
if ( basePlugin ) if ( basePlugin )
...@@ -1178,7 +1186,7 @@ void Core::slotExit() { ...@@ -1178,7 +1186,7 @@ void Core::slotExit() {
} }
// Delete Plugins to actually call their destructor // Delete Plugins to actually call their destructor
for(PluginInfo p : plugins_) for(PluginInfo p : plugins())
delete p.plugin; delete p.plugin;
// close the log file to ensure everything is writeen correctly // close the log file to ensure everything is writeen correctly
...@@ -1300,9 +1308,9 @@ void Core::slotSetSlotDescription(QString _slotName, QString _slotDescrip ...@@ -1300,9 +1308,9 @@ void Core::slotSetSlotDescription(QString _slotName, QString _slotDescrip
//find plugin //find plugin
PluginInfo* pluginInfo = 0; PluginInfo* pluginInfo = 0;
for (uint i=0; i < plugins_.size(); i++) for (uint i=0; i < plugins().size(); i++)
if (plugins_[i].plugin == sender()) if (plugins()[i].plugin == sender())
pluginInfo = &plugins_[i]; pluginInfo = &plugins()[i];
if (pluginInfo == 0){ if (pluginInfo == 0){
emit log(LOGERR, tr("Unable to set slot-description. Plugin not found!")); emit log(LOGERR, tr("Unable to set slot-description. Plugin not found!"));
...@@ -1378,9 +1386,9 @@ void Core::slotGetDescription(QString _function, QString& _fnDescript ...@@ -1378,9 +1386,9 @@ void Core::slotGetDescription(QString _function, QString& _fnDescript
//find plugin //find plugin
PluginInfo* pluginInfo = 0; PluginInfo* pluginInfo = 0;
for (uint i=0; i < plugins_.size(); i++) for (uint i=0; i < plugins().size(); i++)
if (plugins_[i].rpcName == pluginName) if (plugins()[i].rpcName == pluginName)
pluginInfo = &plugins_[i]; pluginInfo = &plugins()[i];
if (pluginInfo == 0){ if (pluginInfo == 0){
emit log(LOGERR, tr("Unable to get slot-description. Plugin not found!")); emit log(LOGERR, tr("Unable to get slot-description. Plugin not found!"));
...@@ -1524,12 +1532,12 @@ void Core::writeVersionNumbers(QString _filename){ ...@@ -1524,12 +1532,12 @@ void Core::writeVersionNumbers(QString _filename){
ini.add_entry( "Core" , "VersionLinux" , OpenFlipper::Options::coreVersion() ); ini.add_entry( "Core" , "VersionLinux" , OpenFlipper::Options::coreVersion() );
//add pluginVersions //add pluginVersions
for (uint i=0; i < plugins_.size(); i++){ for (uint i=0; i < plugins().size(); i++){
if ( OpenFlipper::Options::isWindows() ) if ( OpenFlipper::Options::isWindows() )
ini.add_entry( plugins_[i].name , "VersionWindows" , plugins_[i].version ); ini.add_entry( plugins()[i].name , "VersionWindows" , plugins()[i].version );
else else
ini.add_entry( plugins_[i].name , "VersionLinux" , plugins_[i].version ); ini.add_entry( plugins()[i].name , "VersionLinux" , plugins()[i].version );
} }
ini.disconnect(); ini.disconnect();
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
#include <OpenFlipper/threads/JobInfo.hh> #include <OpenFlipper/threads/JobInfo.hh>
#include <OpenFlipper/common/FileTypes.hh>
#include <OpenFlipper/common/InformationPlugins.hh> #include <OpenFlipper/common/InformationPlugins.hh>
#include "SpinBoxEventFilter.hh" #include "SpinBoxEventFilter.hh"
...@@ -1214,17 +1213,19 @@ private slots: ...@@ -1214,17 +1213,19 @@ private slots:
//=========================================================================== //===========================================================================
public : public :
const std::vector<PluginInfo> plugins() const {return plugins_; }; std::vector<PluginInfo>& plugins();
private: private:
/// List of all loaded plugins_
std::vector<PluginInfo> plugins_;
/// Index of Plugins toolbox widget /// Index of Plugins toolbox widget
int toolboxindex_; int toolboxindex_;
/// Load all plugins from default plugin directory and from INI-File /// Load all plugins from default plugin directory and from INI-File
void loadPlugins(); void loadPlugins();
/// Print all info collected about plugin during loading
void printPluginLoadLog(const QString& errors,const QString& warnings);
private slots: private slots:
/// Show Plugins Dialog /// Show Plugins Dialog
void slotShowPlugins(); void slotShowPlugins();
......
...@@ -467,11 +467,11 @@ void connectPlugins( Core* c, const std::vector<PluginInfo>& plugins_, QString _ ...@@ -467,11 +467,11 @@ void connectPlugins( Core* c, const std::vector<PluginInfo>& plugins_, QString _
} }
void Core::slotCrossPluginConnect( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) { void Core::slotCrossPluginConnect( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) {
connectPlugins(this, plugins_, _pluginName1, _signal, _pluginName2, _slot, false); connectPlugins(this, plugins(), _pluginName1, _signal, _pluginName2, _slot, false);
} }
void Core::slotCrossPluginConnectQueued( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) { void Core::slotCrossPluginConnectQueued( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) {
connectPlugins(this, plugins_, _pluginName1, _signal, _pluginName2, _slot, true); connectPlugins(this, plugins(), _pluginName1, _signal, _pluginName2, _slot, true);
} }
//======================================================================================== //========================================================================================
......
...@@ -85,6 +85,8 @@ class PluginInfo{ ...@@ -85,6 +85,8 @@ class PluginInfo{
version(""), version(""),
path(""), path(""),
rpcName(""), rpcName(""),
errors(""),
warnings(""),
optionsWidget(0), optionsWidget(0),
buildIn(true), buildIn(true),
status(FAILED) status(FAILED)
...@@ -108,6 +110,8 @@ class PluginInfo{ ...@@ -108,6 +110,8 @@ class PluginInfo{
version(_i.version), version(_i.version),
path(_i.path), path(_i.path),
rpcName(_i.rpcName), rpcName(_i.rpcName),
errors(_i.errors),
warnings(_i.warnings),
rpcFunctions(_i.rpcFunctions), rpcFunctions(_i.rpcFunctions),
slotInfos(_i.slotInfos), slotInfos(_i.slotInfos),
keys(_i.keys), keys(_i.keys),
...@@ -141,6 +145,12 @@ class PluginInfo{ ...@@ -141,6 +145,12 @@ class PluginInfo{
/// Clean rpc name of the plugin /// Clean rpc name of the plugin
QString rpcName; QString rpcName;
/// Store errors encountered during plugin loading
QString errors;
/// Store warnings encountered during plugin loading
QString warnings;
/// List of exported rpc slots /// List of exported rpc slots
QStringList rpcFunctions; QStringList rpcFunctions;
......
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
#include <ACG/QtWidgets/QtFileDialog.hh> #include <ACG/QtWidgets/QtFileDialog.hh>
#include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh" #include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh"
#include <OpenFlipper/common/FileTypes.hh>
#include <OpenFlipper/common/PluginStorage.hh>
/** /**
* The number of plugins to load simultaneously. * The number of plugins to load simultaneously.
...@@ -547,6 +551,7 @@ void Core::loadPlugins() ...@@ -547,6 +551,7 @@ void Core::loadPlugins()
} else { } else {
emit log(LOGWARN,tr("Plugin License check failed: ")); emit log(LOGWARN,tr("Plugin License check failed: "));
std::cerr << licenseTexts.toStdString() << std::endl; std::cerr << licenseTexts.toStdString() << std::endl;
} }
...@@ -554,7 +559,7 @@ void Core::loadPlugins() ...@@ -554,7 +559,7 @@ void Core::loadPlugins()
emit pluginsInitialized(); emit pluginsInitialized();
emit log(LOGOUT,tr("Loaded %n Plugin(s)","",int(plugins_.size())) ); emit log(LOGOUT,tr("Loaded %n Plugin(s)","",int(plugins().size())) );
} }
/** @brief slot for loading Plugins /** @brief slot for loading Plugins
...@@ -652,7 +657,7 @@ void Core::slotShowPlugins(){ ...@@ -652,7 +657,7 @@ void Core::slotShowPlugins(){
while (ret == 0){ while (ret == 0){
PluginDialog* dialog = new PluginDialog(plugins_, coreWidget_); PluginDialog* dialog = new PluginDialog(plugins(), coreWidget_);
//connect signals //connect signals
connect(dialog, SIGNAL( loadPlugin() ), this, SLOT( slotLoadPlugin() )); connect(dialog, SIGNAL( loadPlugin() ), this, SLOT( slotLoadPlugin() ));
...@@ -677,9 +682,9 @@ void Core::slotBlockPlugin(const QString &_name) ...@@ -677,9 +682,9 @@ void Core::slotBlockPlugin(const QString &_name)
OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins); OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins);
} }
for (size_t i = 0; i < plugins_.size();++i) for (size_t i = 0; i < plugins().size();++i)
if (plugins_[i].name == _name) if (plugins()[i].name == _name)
plugins_[i].status = PluginInfo::BLOCKED; plugins()[i].status = PluginInfo::BLOCKED;
} }
void Core::slotUnBlockPlugin(const QString &_name) void Core::slotUnBlockPlugin(const QString &_name)
...@@ -688,9 +693,16 @@ void Core::slotUnBlockPlugin(const QString &_name) ...@@ -688,9 +693,16 @@ void Core::slotUnBlockPlugin(const QString &_name)
dontLoadPlugins.removeAll(_name); dontLoadPlugins.removeAll(_name);
OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins); OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins);
for (size_t i = 0; i < plugins_.size();++i) for (size_t i = 0; i < plugins().size();++i)
if (plugins_[i].name == _name) if (plugins()[i].name == _name)
plugins_[i].status = PluginInfo::UNLOADED; 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 /** @brief Load a Plugin with given filename
...@@ -719,6 +731,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -719,6 +731,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// This will be the reference to our plugin // This will be the reference to our plugin
QObject *plugin = 0; QObject *plugin = 0;
// Collect error and warning info
QString errors, warnings;
// Try to open the file if we did not get a plugin, // Try to open the file if we did not get a plugin,
// Otherwise use the supplied plugin pointer // Otherwise use the supplied plugin pointer
if ( _plugin == 0 ) { if ( _plugin == 0 ) {
...@@ -726,11 +742,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -726,11 +742,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
plugin = loader.instance(); plugin = loader.instance();
if ( !plugin) { 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,"================================================================================"); 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 { } else {
plugin = _plugin; plugin = _plugin;
...@@ -739,9 +760,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -739,9 +760,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// Check if a plugin has been loaded // Check if a plugin has been loaded
PluginInfo info; PluginInfo info;
int alreadyLoadedAt = -1; int alreadyLoadedAt = -1;
for (unsigned int k=0; k < plugins_.size(); k++) for (unsigned int k=0; k < plugins().size(); k++)
{ {
if (plugins_[k].path == _filename) if (plugins()[k].path == _filename)
alreadyLoadedAt = static_cast<int>(k); alreadyLoadedAt = static_cast<int>(k);
} }
info.status = PluginInfo::FAILED; info.status = PluginInfo::FAILED;
...@@ -758,6 +779,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -758,6 +779,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
info.name = basePlugin->name(); info.name = basePlugin->name();
info.rpcName = info.name.remove(" ").toLower(); info.rpcName = info.name.remove(" ").toLower();
info.description = basePlugin->description(); info.description = basePlugin->description();
info.warnings = "BLA";
QStringList additionalPlugins = OpenFlipperSettings().value("PluginControl/AdditionalPlugins", QStringList()).toStringList(); QStringList additionalPlugins = OpenFlipperSettings().value("PluginControl/AdditionalPlugins", QStringList()).toStringList();
info.buildIn = !additionalPlugins.contains(info.path); info.buildIn = !additionalPlugins.contains(info.path);
...@@ -770,29 +792,45 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -770,29 +792,45 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
//Check if plugin is already loaded //Check if plugin is already loaded
for (unsigned int k=0; k < plugins_.size(); k++){ for (unsigned int k=0; k < plugins().size(); k++){
QString name_nospace = basePlugin->name(); QString name_nospace = basePlugin->name();
name_nospace.remove(" "); name_nospace.remove(" ");
if (plugins_[k].name == name_nospace && plugins_[k].path != _filename && plugins_[k].status == PluginInfo::LOADED){ if (plugins()[k].name == name_nospace && plugins()[k].path != _filename && plugins()[k].status == PluginInfo::LOADED){
if (_silent || OpenFlipper::Options::nogui() ){ //dont load the plugin 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.*"); info.description = basePlugin->description() + tr(" *Already loaded.*");
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
}else{ //ask the user }else{ //ask the user
int ret = QMessageBox::question(coreWidget_, int ret = QMessageBox::question(coreWidget_,
tr("Plugin already loaded"), tr("Plugin already loaded"),
tr("A Plugin with the same name was already loaded from %1.\n" tr("A Plugin with the same name was already loaded from %1.\n"
"You can only load the new plugin if you unload the existing one first.\n\n" "You can only load the new plugin if you unload the existing one first.\n\n"
"Do you want to unload the existing plugin first?").arg( plugins_[k].path), "Do you want to unload the existing plugin first?").arg( plugins()[k].path),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No); QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
if (ret == QMessageBox::No) if (ret == QMessageBox::No)
{ {
emit log(LOGWARN, tr("\t\t\t Already loaded from %1.").arg( plugins_[k].path)); warnings += tr("Warning: Already loaded from %1.").arg( plugins()[k].path) + "\n";
emit log(LOGOUT,"================================================================================");
printPluginLoadLog(errors, warnings);
info.description = basePlugin->description() + tr(" *Already loaded.*"); info.description = basePlugin->description() + tr(" *Already loaded.*");
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
} }
...@@ -802,9 +840,18 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -802,9 +840,18 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames",QStringList()).toStringList(); QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames",QStringList()).toStringList();
if ( dontLoadPlugins.contains(basePlugin->name(), Qt::CaseInsensitive) ) { 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; info.status = PluginInfo::BLOCKED;
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
...@@ -823,10 +870,18 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -823,10 +870,18 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( success ) if ( success )
emit log(LOGINFO,tr("... ok. Loading plugin ")); emit log(LOGINFO,tr("... ok. Loading plugin "));
else { 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.*"); info.description = basePlugin->description() + tr(" *Plugin access denied.*");
// Abort here, as the plugin will not do anything else until correct authentication. // 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; return;
} }
} }
...@@ -845,8 +900,15 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -845,8 +900,15 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( OpenFlipper::Options::nogui() ) { if ( OpenFlipper::Options::nogui() ) {
if ( ! checkSlot( plugin , "noguiSupported()" ) ) { if ( ! checkSlot( plugin , "noguiSupported()" ) ) {
emit log(LOGWARN,tr("Running in nogui mode which is unsupported by this plugin, skipping") ); warnings += tr("Warning: Running in nogui mode which is unsupported by this plugin, skipping");
emit log(LOGOUT,"================================================================================");
printPluginLoadLog(errors, warnings);
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
...@@ -855,14 +917,29 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -855,14 +917,29 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// Check for baseInterface of old style! // Check for baseInterface of old style!
if ( checkSignal(plugin,"updated_objects(int)") ) { 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);
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
if ( checkSignal(plugin,"update_view()") ) { if ( checkSignal(plugin,"update_view()") ) {
log(LOGERR,tr("Plugin Uses old style update_view! Convert to updateView!")); errors += tr("Error: Plugin Uses old style update_view! Convert to updateView!") + "\n";
emit log(LOGOUT,"================================================================================");
printPluginLoadLog(errors, warnings);
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
...@@ -874,12 +951,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -874,12 +951,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSignal(plugin,"updatedObject(int)") && checkSignal(plugin,"updatedObject(int,const UpdateType&)") ){ 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.")); 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); connect(plugin,SIGNAL(updatedObject(int,const UpdateType&)),this,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::AutoConnection);
} else { } else {
if ( checkSignal(plugin,"updatedObject(int)") ){ if ( checkSignal(plugin,"updatedObject(int)") ){
warnings += tr("Warning: Plugin uses deprecated updatedObject.") + "\n";
log(LOGWARN,tr("Plugin uses deprecated updatedObject.")); log(LOGWARN,tr("Plugin uses deprecated updatedObject."));
connect(plugin,SIGNAL(updatedObject(int)),this,SLOT(slotObjectUpdated(int)), Qt::AutoConnection); connect(plugin,SIGNAL(updatedObject(int)),this,SLOT(slotObjectUpdated(int)), Qt::AutoConnection);
} }
...@@ -889,6 +970,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -889,6 +970,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) && checkSlot( plugin , "slotObjectUpdated(int,const UpdateType&)" ) ){ 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.")); 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); connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType&)),plugin,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
...@@ -896,6 +978,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -896,6 +978,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} else { } else {
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) ){ if ( checkSlot( plugin , "slotObjectUpdated(int)" ) ){
warnings += tr("Warning: Plugin uses deprecated slotObjectUpdated.") + "\n";
log(LOGWARN,tr("Plugin uses deprecated slotObjectUpdated.")); log(LOGWARN,tr("Plugin uses deprecated slotObjectUpdated."));
connect(this,SIGNAL(signalObjectUpdated(int)),plugin,SLOT(slotObjectUpdated(int)), Qt::DirectConnection); connect(this,SIGNAL(signalObjectUpdated(int)),plugin,SLOT(slotObjectUpdated(int)), Qt::DirectConnection);
} }
...@@ -905,9 +988,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -905,9 +988,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
if ( checkSignal(plugin,"objectPropertiesChanged(int)")) { if ( checkSignal(plugin,"objectPropertiesChanged(int)")) {
emit log (LOGERR,tr("Signal objectPropertiesChanged(int) is deprecated. " )); errors += tr("Error: Signal objectPropertiesChanged(int) is deprecated.") + "\n";
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!. ")); 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";
emit log (LOGERR,tr("Please remove this signal from your plugins!. ")); errors += tr("Error: Please remove this signal from your plugins!.") + "\n";
} }
if ( checkSlot( plugin , "slotViewChanged()" ) ) if ( checkSlot( plugin , "slotViewChanged()" ) )
...@@ -922,13 +1005,14 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -922,13 +1005,14 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSlot(plugin,"slotObjectPropertiesChanged(int)")) if ( checkSlot(plugin,"slotObjectPropertiesChanged(int)"))
connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection); connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection);
if ( checkSignal(plugin,"visibilityChanged()" ) ) if ( checkSignal(plugin,"visibilityChanged()" ) ) {
emit log (LOGERR,tr("Signal visibilityChanged() now requires objectid or -1 as argument " )); errors += tr("Error: Signal visibilityChanged() now requires objectid or -1 as argument.") + "\n";
}
if ( checkSignal(plugin,"visibilityChanged(int)") ) { if ( checkSignal(plugin,"visibilityChanged(int)") ) {
emit log (LOGERR,tr("Signal visibilityChanged(int) is deprecated! " )); errors += tr("Error: Signal visibilityChanged(int) is deprecated!") + "\n";
emit log (LOGERR,tr("If an object changes its visibility, it will call the required functions automatically." )); errors += tr("Error: If an object changes its visibility, it will call the required functions automatically.") + "\n";
emit log (LOGERR,tr("If you change a scenegraph node, call nodeVisibilityChanged(int). See docu of this function for details." )); 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)") ) if ( checkSignal(plugin,"nodeVisibilityChanged(int)") )
...@@ -938,19 +1022,21 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -938,19 +1022,21 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSlot(plugin,"slotVisibilityChanged(int)") ) if ( checkSlot(plugin,"slotVisibilityChanged(int)") )
connect(this,SIGNAL(visibilityChanged(int)),plugin,SLOT(slotVisibilityChanged(int)), Qt::DirectConnection); connect(this,SIGNAL(visibilityChanged(int)),plugin,SLOT(slotVisibilityChanged(int)), Qt::DirectConnection);
if ( checkSignal(plugin,"activeObjectChanged()" ) ) if ( checkSignal(plugin,"activeObjectChanged()" ) ) {
emit log (LOGERR,tr("Signal activeObjectChanged() is now objectSelectionChanged( int _objectId ) ") ); errors += tr("Error: Signal activeObjectChanged() is now objectSelectionChanged( int _objectId )") + "\n";
}
if ( checkSlot(plugin,"slotActiveObjectChanged()" ) ) if ( checkSlot(plugin,"slotActiveObjectChanged()" ) ) {
emit log (LOGERR,tr("Slot slotActiveObjectChanged() is now slotObjectSelectionChanged( int _objectId ) ") ); errors += tr("Error: Slot slotActiveObjectChanged() is now slotObjectSelectionChanged( int _objectId ) ") + "\n";
}
if ( checkSlot(plugin,"slotAllCleared()") ) if ( checkSlot(plugin,"slotAllCleared()") )
connect(this,SIGNAL(allCleared()),plugin,SLOT(slotAllCleared())); connect(this,SIGNAL(allCleared()),plugin,SLOT(slotAllCleared()));
if ( checkSignal(plugin,"objectSelectionChanged(int)") ) { if ( checkSignal(plugin,"objectSelectionChanged(int)") ) {
emit log (LOGERR,tr("Signal objectSelectionChanged(in) is deprecated!") ); errors += tr("Error: Signal objectSelectionChanged(in) is deprecated!") + "\n";
emit log (LOGERR,tr("If the selection for an object is changed, the core will emit the required signals itself!") ); 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)" ) ) if ( checkSlot( plugin , "slotObjectSelectionChanged(int)" ) )
...@@ -1261,8 +1347,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1261,8 +1347,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( selectionPlugin && OpenFlipper::Options::gui() ) { if ( selectionPlugin && OpenFlipper::Options::gui() ) {
supported = supported + "SelectionBase "; 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!")); 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&)") ) if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QString,QString&)") )
connect(plugin , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)), connect(plugin , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
...@@ -1270,8 +1358,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1270,8 +1358,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// =============== // ===============
if ( checkSlot(plugin,"slotAddSelectionEnvironment(QString,QString,QIcon,QString&)") ) 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!")); 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&)" ) ) if ( checkSlot( plugin , "slotAddSelectionEnvironment(QString,QString,QString,QString&)" ) )
connect(this , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)), connect(this , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
...@@ -1291,8 +1380,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1291,8 +1380,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// =============== // ===============
if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") ) 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!")); 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&)") ) if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)") )
connect(plugin , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)), connect(plugin , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
...@@ -1309,8 +1399,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1309,8 +1399,11 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// =============== // ===============
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") ) 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!")); 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&)") ) if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)), connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
...@@ -1318,8 +1411,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1318,8 +1411,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// =============== // ===============
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") ) 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!")); 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)") ) if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)), connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),
...@@ -1327,8 +1422,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1327,8 +1422,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// =============== // ===============
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") ) 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!")); 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&)" ) ) if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)), connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
...@@ -1336,8 +1433,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1336,8 +1433,10 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
// =============== // ===============
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") ) 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!")); 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)" ) ) if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)), connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)),
...@@ -1922,26 +2021,30 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1922,26 +2021,30 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSignal(plugin,"startJob(QString,QString,int,int,bool)" ) ) if ( checkSignal(plugin,"startJob(QString,QString,int,int,bool)" ) )
connect(plugin , SIGNAL(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 ); this , SLOT( slotStartJob(QString, QString,int,int,bool) ), Qt::DirectConnection );
else else {
emit log(LOGERR,"Process Interface defined but no startJob signal found!"); errors += tr("Error: Process Interface defined but no startJob signal found!") + "\n";
}
if ( checkSignal(plugin,"setJobState(QString,int)" ) ) if ( checkSignal(plugin,"setJobState(QString,int)" ) )
connect(plugin , SIGNAL(setJobState(QString,int)), connect(plugin , SIGNAL(setJobState(QString,int)),
this , SLOT( slotSetJobState(QString,int) ), Qt::QueuedConnection ); this , SLOT( slotSetJobState(QString,int) ), Qt::QueuedConnection );
else else {
emit log(LOGERR,"Process Interface defined but no setJobState signal found!"); errors += tr("Error: Process Interface defined but no setJobState signal found!") + "\n";
}
if ( checkSignal(plugin,"setJobName(QString,QString)" ) ) if ( checkSignal(plugin,"setJobName(QString,QString)" ) )
connect(plugin , SIGNAL(setJobName(QString, QString)), connect(plugin , SIGNAL(setJobName(QString, QString)),
this , SLOT( slotSetJobName(QString, QString) ), Qt::QueuedConnection ); this , SLOT( slotSetJobName(QString, QString) ), Qt::QueuedConnection );
else else {
emit log(LOGERR,"Process Interface defined but no setJobName signal found!"); errors += tr("Error: Process Interface defined but no setJobName signal found!") + "\n";
}
if ( checkSignal(plugin,"setJobDescription(QString,QString)" ) ) if ( checkSignal(plugin,"setJobDescription(QString,QString)" ) )
connect(plugin , SIGNAL(setJobDescription(QString, QString)), connect(plugin , SIGNAL(setJobDescription(QString, QString)),
this , SLOT( slotSetJobDescription(QString, QString) ), Qt::QueuedConnection ); this , SLOT( slotSetJobDescription(QString, QString) ), Qt::QueuedConnection );
else else {
emit log(LOGERR,"Process Interface defined but no setJobDescription signal found!"); errors += tr("Error: Process Interface defined but no setJobDescription signal found!") + "\n";
}
if ( checkSignal(plugin,"cancelJob(QString)" ) ) if ( checkSignal(plugin,"cancelJob(QString)" ) )
connect(plugin , SIGNAL(cancelJob(QString)), connect(plugin , SIGNAL(cancelJob(QString)),
...@@ -1950,14 +2053,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -1950,14 +2053,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSignal(plugin,"finishJob(QString)" ) ) if ( checkSignal(plugin,"finishJob(QString)" ) )
connect(plugin , SIGNAL(finishJob(QString)), connect(plugin , SIGNAL(finishJob(QString)),
this , SLOT( slotFinishJob(QString) ), Qt::QueuedConnection ); this , SLOT( slotFinishJob(QString) ), Qt::QueuedConnection );
else else {
emit log(LOGERR,"Process Interface defined but no finishJob signal found!"); errors += tr("Error: Process Interface defined but no finishJob signal found!") + "\n";
}
if ( checkSlot(plugin,"canceledJob(QString)" ) ) if ( checkSlot(plugin,"canceledJob(QString)" ) )
connect(this , SIGNAL( jobCanceled( QString ) ) , connect(this , SIGNAL( jobCanceled( QString ) ) ,
plugin , SLOT( canceledJob(QString) ),Qt::QueuedConnection); plugin , SLOT( canceledJob(QString) ),Qt::QueuedConnection);
else else {
emit log(LOGERR,"Process Interface defined but no cancel canceledJob slot found!"); errors += tr("Error: Process Interface defined but no cancel canceledJob slot found!") + "\n";
}
} }
//Check if the plugin supports RPC-Interface //Check if the plugin supports RPC-Interface
...@@ -2014,8 +2119,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2014,8 +2119,16 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ; QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
if ( openGLCheck != "" ) { if ( openGLCheck != "" ) {
emit log(LOGERR,tr("Error: Insufficient OpenGL capabilities in Renderer Plugin ") + rendererNameString + " !"); errors += tr("Error: Insufficient OpenGL capabilities in Renderer Plugin ") + rendererNameString + " !" + "\n";
emit log(LOGERR,openGLCheck); errors += openGLCheck + "\n";
printPluginLoadLog(errors, warnings);
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
...@@ -2024,7 +2137,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2024,7 +2137,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( ! renderManager().rendererExists(rendererNameString) ) { if ( ! renderManager().rendererExists(rendererNameString) ) {
rendererInfo = renderManager().newRenderer(rendererNameString); rendererInfo = renderManager().newRenderer(rendererNameString);
} else { } 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 // Retrieve and store renderer information
...@@ -2051,7 +2164,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2051,7 +2164,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
} else { } else {
emit log(LOGERR,tr("Error: Renderer Plugin without rendererName Function?!")); errors += tr("Error: Renderer Plugin without rendererName Function?!") + "\n";
} }
} }
...@@ -2072,8 +2185,14 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2072,8 +2185,14 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ; QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
if ( openGLCheck != "" ) { if ( openGLCheck != "" ) {
emit log(LOGERR,tr("Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString + " !"); errors += tr("Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString + " !" + "\n";
emit log(LOGERR,openGLCheck); errors += openGLCheck + "\n";
info.errors = errors;
info.warnings = warnings;
PluginStorage::pluginsFailed().push_back(info);
return; return;
} }
...@@ -2082,7 +2201,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2082,7 +2201,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( ! postProcessorManager().postProcessorExists(postProcessorNameString) ) { if ( ! postProcessorManager().postProcessorExists(postProcessorNameString) ) {
postProcessorInfo = postProcessorManager().newPostProcessor(postProcessorNameString); postProcessorInfo = postProcessorManager().newPostProcessor(postProcessorNameString);
} else { } 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 // Retrieve and store PostProcessor information
...@@ -2102,7 +2221,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2102,7 +2221,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
} else { } else {
emit log(LOGERR,tr("Error: PostProcessor Plugin without postProcessorName Function?!")); errors += tr("Error: PostProcessor Plugin without postProcessorName Function?!") + "\n";
} }
} }
...@@ -2214,14 +2333,20 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2214,14 +2333,20 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
//========================================================================================
//======================================================================================== //========================================================================================
info.status = PluginInfo::LOADED; info.status = PluginInfo::LOADED;
if (alreadyLoadedAt != -1) info.errors = errors;
plugins_[alreadyLoadedAt] = info; info.warnings = warnings;
if (alreadyLoadedAt != -1) {
plugins()[alreadyLoadedAt] = info;
}
else else
plugins_.push_back(info); plugins().push_back(info);
printPluginLoadLog(errors, warnings);
// Initialize Plugin // Initialize Plugin
if ( basePlugin ) { if ( basePlugin ) {
...@@ -2313,6 +2438,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic ...@@ -2313,6 +2438,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
} }
} }
emit log(LOGOUT,"================================================================================"); //========================================================================================
} }
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
void Core::slotPluginExists( QString _pluginName , bool& _exists ) { void Core::slotPluginExists( QString _pluginName , bool& _exists ) {
for ( int i = 0 ; i < (int)plugins_.size(); ++i ) { for ( int i = 0 ; i < (int)plugins().size(); ++i ) {
if ( plugins_[i].rpcName == _pluginName ) { if ( plugins()[i].rpcName == _pluginName ) {
_exists = true; _exists = true;
return; return;
} }
...@@ -82,8 +82,8 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo ...@@ -82,8 +82,8 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo
//Find plugin //Find plugin
int plugin = -1; int plugin = -1;
for ( int i = 0 ; i < (int)plugins_.size(); ++i ) { for ( int i = 0 ; i < (int)plugins().size(); ++i ) {
if ( plugins_[i].rpcName == _pluginName ) { if ( plugins()[i].rpcName == _pluginName ) {
plugin = i; plugin = i;
break; break;
} }
...@@ -94,15 +94,15 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo ...@@ -94,15 +94,15 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo
return; return;
} }
_exists = plugins_[plugin].rpcFunctions.contains(_functionName); _exists = plugins()[plugin].rpcFunctions.contains(_functionName);
} }
void Core::slotCall( QString _pluginName , QString _functionName , bool& _success ) { void Core::slotCall( QString _pluginName , QString _functionName , bool& _success ) {
//Find plugin //Find plugin
int plugin = -1; int plugin = -1;
for ( int i = 0 ; i < (int)plugins_.size(); ++i ) { for ( int i = 0 ; i < (int)plugins().size(); ++i ) {
if ( plugins_[i].rpcName == _pluginName ) { if ( plugins()[i].rpcName == _pluginName ) {
plugin = i; plugin = i;
break; break;
} }
...@@ -114,7 +114,7 @@ void Core::slotCall( QString _pluginName , QString _functionName , bool& _succes ...@@ -114,7 +114,7 @@ void Core::slotCall( QString _pluginName , QString _functionName , bool& _succes
return; return;
} }
if ( !plugins_[plugin].rpcFunctions.contains(_functionName) ) { if ( !plugins()[plugin].rpcFunctions.contains(_functionName) ) {
_success = false; _success = false;
emit log(LOGERR, tr("Unable to call function from Plugin : ") + _pluginName); emit log(LOGERR, tr("Unable to call function from Plugin : ") + _pluginName);
emit log(LOGERR, tr("Function ") + _functionName + tr(" not found!")); emit log(LOGERR, tr("Function ") + _functionName + tr(" not found!"));
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
//#include <ObjectTypes/Light/Light.hh> //#include <ObjectTypes/Light/Light.hh>
#include <OpenFlipper/common/FileTypes.hh>
/// Save Settings (slot is called from CoreWidget's File-Menu) /// Save Settings (slot is called from CoreWidget's File-Menu)
void Core::saveSettings(){ void Core::saveSettings(){
......
...@@ -231,13 +231,13 @@ void Core::setToolBoxSide(QString _side) { ...@@ -231,13 +231,13 @@ void Core::setToolBoxSide(QString _side) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
QWidget *Core::getToolbox(QString _pluginName, QString _toolboxName) { QWidget *Core::getToolbox(QString _pluginName, QString _toolboxName) {
std::vector<PluginInfo>::const_iterator pluginIt = plugins_.end(); std::vector<PluginInfo>::const_iterator pluginIt = plugins().end();
for (std::vector<PluginInfo>::const_iterator it = plugins_.begin(), it_end = plugins_.end(); it != it_end; ++it) { for (std::vector<PluginInfo>::const_iterator it = plugins().begin(), it_end = plugins().end(); it != it_end; ++it) {
if (it->name == _pluginName) { if (it->name == _pluginName) {
pluginIt = it; pluginIt = it;
} }
} }
if (pluginIt == plugins_.end()) return 0; if (pluginIt == plugins().end()) return 0;
for (std::vector<std::pair<QString , QWidget*> >::const_iterator it = pluginIt->toolboxWidgets.begin(), it_end = pluginIt->toolboxWidgets.end(); for (std::vector<std::pair<QString , QWidget*> >::const_iterator it = pluginIt->toolboxWidgets.begin(), it_end = pluginIt->toolboxWidgets.end();
it != it_end; ++it) { it != it_end; ++it) {
...@@ -266,8 +266,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon, ...@@ -266,8 +266,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
int id = -1; int id = -1;
// Find the plugin which added this Toolbox // Find the plugin which added this Toolbox
for ( uint i = 0 ; i < plugins_.size(); ++i ) { for ( uint i = 0 ; i < plugins().size(); ++i ) {
if ( plugins_[i].plugin == sender() ) { if ( plugins()[i].plugin == sender() ) {
id = i; id = i;
break; break;
} }
...@@ -275,8 +275,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon, ...@@ -275,8 +275,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
// Find the scripting plugin because we assign this toolBox to it as we did not find the original sender // Find the scripting plugin because we assign this toolBox to it as we did not find the original sender
if ( id == -1 ) { if ( id == -1 ) {
for ( uint i = 0 ; i < plugins_.size(); ++i ) { for ( uint i = 0 ; i < plugins().size(); ++i ) {
if ( plugins_[i].name == "Scripting" ) { if ( plugins()[i].name == "Scripting" ) {
id = i; id = i;
break; break;
} }
...@@ -290,9 +290,9 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon, ...@@ -290,9 +290,9 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
} }
spinBoxEventFilter_.hookUpToWidgetTree(_widget); spinBoxEventFilter_.hookUpToWidgetTree(_widget);
plugins_[id].toolboxWidgets.push_back( std::pair< QString,QWidget* >( _name , _widget) ); plugins()[id].toolboxWidgets.push_back( std::pair< QString,QWidget* >( _name , _widget) );
plugins_[id].toolboxIcons.push_back( _icon ); plugins()[id].toolboxIcons.push_back( _icon );
plugins_[id].headerAreaWidgets.push_back( std::pair< QString,QWidget* >( _name , _headerAreaWidget) ); plugins()[id].headerAreaWidgets.push_back( std::pair< QString,QWidget* >( _name , _headerAreaWidget) );
// add widget name to viewMode 'all' // add widget name to viewMode 'all'
if ( !viewModes_[0]->visibleToolboxes.contains(_name) ){ if ( !viewModes_[0]->visibleToolboxes.contains(_name) ){
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
/** /**
* \file FileTypes.cc * \file FileTypes.cc
* This File contains the management of file plugins. * This File contains the file type management vectors
*/ */
...@@ -66,14 +66,12 @@ ...@@ -66,14 +66,12 @@
#include <OpenFlipper/common/FileTypes.hh> #include <OpenFlipper/common/FileTypes.hh>
// Stores information about file types supported by the file plugins.
static std::vector<fileTypes> supportedTypes_; static std::vector<fileTypes> supportedTypes_;
std::vector<fileTypes>& supportedTypes() { std::vector<fileTypes>& supportedTypes() {
return supportedTypes_; return supportedTypes_;
} }
//============================================================================= //=============================================================================
//============================================================================= //=============================================================================
...@@ -58,12 +58,11 @@ ...@@ -58,12 +58,11 @@
/** /**
* \file FileTypes.hh * \file FileTypes.hh
* This File contains the management of file plugins. * This File contains the file type management vectors
*/ */
#ifndef FILETYPES_HH #pragma once
#define FILETYPES_HH
#include <QString> #include <QString>
#include <OpenFlipper/common/GlobalDefines.hh> #include <OpenFlipper/common/GlobalDefines.hh>
...@@ -84,10 +83,8 @@ struct fileTypes { ...@@ -84,10 +83,8 @@ struct fileTypes {
// Get vector of supported types // Get vector of supported types
DLLEXPORT DLLEXPORT
std::vector<fileTypes>& std::vector<fileTypes>& supportedTypes();
supportedTypes();
//============================================================================= //=============================================================================
#endif // FILETYPES_HH defined
//============================================================================= //=============================================================================
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
//
//=============================================================================
/**
* \file PluginStorage.cc
* This File contains the management of plugins.
*/
//== INCLUDES =================================================================
#include <OpenFlipper/common/PluginStorage.hh>
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_;
}
}
//=============================================================================
//=============================================================================
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
//
//=============================================================================
/**
* \file PluginStorage.hh
* This File contains the management vector for the plugins.
*/
#pragma once
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/Core/PluginInfo.hh>
//== INCLUDES =================================================================
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();
}
//=============================================================================
//=============================================================================
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>653</width> <width>994</width>
<height>699</height> <height>699</height>
</rect> </rect>
</property> </property>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:11pt;&quot;&gt;%1 is developed by:&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:11pt;&quot;&gt;%1 is developed by:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;&quot;&gt;Department of Computer Science VIII&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;&quot;&gt;Department of Computer Science VIII&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;&quot;&gt;Aachen University of Technology (RWTH)&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;&quot;&gt;Aachen University of Technology (RWTH)&lt;/span&gt;&lt;/p&gt;
......
...@@ -61,8 +61,10 @@ ...@@ -61,8 +61,10 @@
#include <common/glew_wrappers.hh> #include <common/glew_wrappers.hh>
#include "CoreWidget.hh" #include "CoreWidget.hh"
#include <OpenFlipper/common/PluginStorage.hh>
#include <OpenFlipper/common/FileTypes.hh> #include <OpenFlipper/common/FileTypes.hh>
#include <QGLFormat> #include <QGLFormat>
#ifndef WIN32 #ifndef WIN32
...@@ -744,6 +746,69 @@ void CoreWidget::showAboutWidget( ) { ...@@ -744,6 +746,69 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append( "\t\t Save: " + supportedTypes()[i].saveFilters ); aboutWidget_->OpenFlipperAbout->append( "\t\t Save: " + supportedTypes()[i].saveFilters );
} }
// =====================================================================================
// List all Plugins
// =====================================================================================
aboutWidget_->OpenFlipperAbout->append("\n");
aboutWidget_->OpenFlipperAbout->setCurrentFont(boldFont);
aboutWidget_->OpenFlipperAbout->append(tr("Loaded Plugins:"));
aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont);
for ( uint i = 0 ; i < plugins().size() ; ++i ) {
aboutWidget_->OpenFlipperAbout->setCurrentFont(boldFont);
aboutWidget_->OpenFlipperAbout->append( "\t" + plugins()[i].name );
aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont);
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);
}
}
// =====================================================================================
// 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 );