X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPipelineEditor%2FBaseQtMainWindow.cxx;h=8a9536b70ddf79140508e03bee159619b021eec3;hb=24d0c2ad34de2cbd89fed76058f2995cdf81d239;hp=e507f1926bb63128e7d013f61701eef4261344a3;hpb=bebef39d45df113f3a706279a395eba44ce9472c;p=cpPlugins.git diff --git a/lib/cpPipelineEditor/BaseQtMainWindow.cxx b/lib/cpPipelineEditor/BaseQtMainWindow.cxx index e507f19..8a9536b 100644 --- a/lib/cpPipelineEditor/BaseQtMainWindow.cxx +++ b/lib/cpPipelineEditor/BaseQtMainWindow.cxx @@ -43,22 +43,12 @@ BaseQtMainWindow( m_TreeWidget( NULL ), m_Editor( NULL ) { - // Prepare plugins interface + this->m_Interface.GuessAccesiblePlugins( ); + + // Try to load plugins from executable dir 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( ); - - } // fi + this->_LoadPluginsFromPath( info.canonicalPath( ).toStdString( ) ); // Prepare workspace this->m_Workspace.SetInterface( &( this->m_Interface ) ); @@ -193,7 +183,6 @@ _UpdateLoadedPlugins( ) } // fi this->_UnBlock( ); - this->m_Interface.SaveConfiguration( cpPlugins_CONFIG_FILE ); } // ------------------------------------------------------------------------- @@ -256,9 +245,9 @@ _InteractiveLoadPlugins( ) dlg.setDirectory( this->m_PluginsPath.c_str( ) ); std::stringstream name_filter; - std::string suffix = std::string( cpPlugins_PLUGIN_EXT ); + std::string suffix = std::string( cpPlugins_LIB_EXT ); name_filter - << "Plugins file (*." << cpPlugins_PLUGIN_EXT << ");;All files (*)"; + << "Plugins file (*." << cpPlugins_LIB_EXT << ");;All files (*)"; dlg.setNameFilter( name_filter.str( ).c_str( ) ); dlg.setDefaultSuffix( suffix.c_str( ) ); if( !( dlg.exec( ) ) ) @@ -326,30 +315,30 @@ _ExecFilter( const std::string& filter_name ) } catch( itk::ExceptionObject& err1 ) { + this->_UnBlock( ); QMessageBox::critical( this, QMessageBox::tr( "Error executing filter" ), QMessageBox::tr( err1.GetDescription( ) ) ); - this->_UnBlock( ); } catch( std::exception& err2 ) { + this->_UnBlock( ); QMessageBox::critical( this, QMessageBox::tr( "Error executing filter" ), QMessageBox::tr( err2.what( ) ) ); - this->_UnBlock( ); } catch( ... ) { + this->_UnBlock( ); QMessageBox::critical( this, QMessageBox::tr( "Error executing filter" ), QMessageBox::tr( "Unknown error" ) ); - this->_UnBlock( ); } // yrt }