X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPipelineEditor%2FBaseQtMainWindow.cxx;h=b600c0ee12002dc33e7c09d49fec0a8cc5bf2ec7;hb=e2fb8817731f6231d34941a208e46b36dad425b2;hp=cf5e41f32b07c686436283ff11e302be651892a2;hpb=a7142bafa94bd9f1d1fd9df4c11d5356676cf419;p=cpPlugins.git diff --git a/lib/cpPipelineEditor/BaseQtMainWindow.cxx b/lib/cpPipelineEditor/BaseQtMainWindow.cxx index cf5e41f..b600c0e 100644 --- a/lib/cpPipelineEditor/BaseQtMainWindow.cxx +++ b/lib/cpPipelineEditor/BaseQtMainWindow.cxx @@ -43,22 +43,16 @@ BaseQtMainWindow( m_TreeWidget( NULL ), m_Editor( NULL ) { - // Prepare plugins interface + this->m_Interface.GuessAccesiblePlugins( ); + QFileInfo info( argv[ 0 ] ); if( info.exists( ) ) { - this->m_Interface.LoadConfiguration( cpPlugins_CONFIG_FILE ); - this->_LoadPluginsFromPath( this->m_PluginsPath ); - this->m_PluginsPath = info.canonicalPath( ).toStdString( ); - - } // fi - QDir exec_dir( "." ); - if( exec_dir.exists( ) ) - { - this->_LoadPluginsFromPath( exec_dir.canonicalPath( ).toStdString( ) ); - this->m_PluginsPath = exec_dir.canonicalPath( ).toStdString( ); + auto exec_dir = info.canonicalPath( ).toStdString( ); + this->_LoadPluginsFromPath( exec_dir ); } // fi + this->_UpdateLoadedPlugins( ); // Prepare workspace this->m_Workspace.SetInterface( &( this->m_Interface ) ); @@ -319,14 +313,39 @@ void cpPipelineEditor::BaseQtMainWindow:: _ExecFilter( const std::string& filter_name ) { this->_Block( ); - std::string err = this->m_Workspace.Execute( filter_name ); - this->_UnBlock( ); - if( err != "" ) + try + { + this->m_Workspace.Execute( filter_name ); + this->_UnBlock( ); + } + catch( itk::ExceptionObject& err1 ) + { + this->_UnBlock( ); QMessageBox::critical( this, QMessageBox::tr( "Error executing filter" ), - QMessageBox::tr( err.c_str( ) ) + QMessageBox::tr( err1.GetDescription( ) ) ); + } + catch( std::exception& err2 ) + { + this->_UnBlock( ); + QMessageBox::critical( + this, + QMessageBox::tr( "Error executing filter" ), + QMessageBox::tr( err2.what( ) ) + ); + } + catch( ... ) + { + this->_UnBlock( ); + QMessageBox::critical( + this, + QMessageBox::tr( "Error executing filter" ), + QMessageBox::tr( "Unknown error" ) + ); + + } // yrt } // eof - $RCSfile$