]> Creatis software - cpPlugins.git/blobdiff - lib/cpPipelineEditor/BaseQtMainWindow.cxx
...
[cpPlugins.git] / lib / cpPipelineEditor / BaseQtMainWindow.cxx
index e507f1926bb63128e7d013f61701eef4261344a3..b600c0ee12002dc33e7c09d49fec0a8cc5bf2ec7 100644 (file)
@@ -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 ) );
@@ -326,30 +320,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
 }