X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPipelineEditor%2FBaseQtMainWindow.cxx;h=e507f1926bb63128e7d013f61701eef4261344a3;hb=bebef39d45df113f3a706279a395eba44ce9472c;hp=24953f02e7270e92ebb0445859b2f49626719209;hpb=25bbcded53b31313762477b2f8dde29b5a845a34;p=cpPlugins.git diff --git a/lib/cpPipelineEditor/BaseQtMainWindow.cxx b/lib/cpPipelineEditor/BaseQtMainWindow.cxx index 24953f0..e507f19 100644 --- a/lib/cpPipelineEditor/BaseQtMainWindow.cxx +++ b/lib/cpPipelineEditor/BaseQtMainWindow.cxx @@ -1,6 +1,4 @@ -#include - -#ifdef cpPlugins_QT4 +#include #include #include @@ -12,7 +10,7 @@ #include // ------------------------------------------------------------------------- -bool cpPlugins::BaseQtMainWindow::_TBlocker:: +bool cpPipelineEditor::BaseQtMainWindow::_TBlocker:: eventFilter( QObject* obj, QEvent* event ) { return( true ); // -> Block all events @@ -33,7 +31,7 @@ eventFilter( QObject* obj, QEvent* event ) } // ------------------------------------------------------------------------- -cpPlugins::BaseQtMainWindow:: +cpPipelineEditor::BaseQtMainWindow:: BaseQtMainWindow( int argc, char* argv[], QApplication* app, @@ -67,14 +65,14 @@ BaseQtMainWindow( } // ------------------------------------------------------------------------- -cpPlugins::BaseQtMainWindow:: +cpPipelineEditor::BaseQtMainWindow:: ~BaseQtMainWindow( ) { this->m_Interface.UnloadAll( ); } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _Configure( QTreeWidget* tree, cpExtensions::QT::SimpleMPRWidget* mpr, @@ -92,7 +90,7 @@ _Configure( } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _LoadPlugins( const std::string& filename ) { try @@ -112,7 +110,7 @@ _LoadPlugins( const std::string& filename ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _LoadPluginsFromPath( const std::string& path ) { try @@ -132,7 +130,7 @@ _LoadPluginsFromPath( const std::string& path ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _UpdateLoadedPlugins( ) { this->_Block( ); @@ -199,7 +197,7 @@ _UpdateLoadedPlugins( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _Block( ) { this->m_Application->setOverrideCursor( Qt::WaitCursor ); @@ -207,7 +205,7 @@ _Block( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _UnBlock( ) { while( this->m_Application->overrideCursor( ) ) @@ -216,7 +214,7 @@ _UnBlock( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _LoadWorkspace( const std::string& filename ) { std::string err = this->m_Workspace.LoadWorkspace( filename ); @@ -237,7 +235,7 @@ _LoadWorkspace( const std::string& filename ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _SaveWorkspace( const std::string& filename ) { std::string err = this->m_Workspace.SaveWorkspace( filename ); @@ -250,7 +248,7 @@ _SaveWorkspace( const std::string& filename ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _InteractiveLoadPlugins( ) { QFileDialog dlg( this ); @@ -272,7 +270,7 @@ _InteractiveLoadPlugins( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _InteractiveLoadPluginsFromPath( ) { QFileDialog dlg( this ); @@ -284,7 +282,7 @@ _InteractiveLoadPluginsFromPath( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _InteractiveLoadWorkspace( ) { QFileDialog dlg( this ); @@ -300,7 +298,7 @@ _InteractiveLoadWorkspace( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +void cpPipelineEditor::BaseQtMainWindow:: _InteractiveSaveWorkspace( ) { QFileDialog dlg( this ); @@ -317,20 +315,43 @@ _InteractiveSaveWorkspace( ) } // ------------------------------------------------------------------------- -void cpPlugins::BaseQtMainWindow:: +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 ) + { QMessageBox::critical( this, QMessageBox::tr( "Error executing filter" ), - QMessageBox::tr( err.c_str( ) ) + QMessageBox::tr( err1.GetDescription( ) ) ); -} + this->_UnBlock( ); + } + catch( std::exception& err2 ) + { + QMessageBox::critical( + this, + QMessageBox::tr( "Error executing filter" ), + QMessageBox::tr( err2.what( ) ) + ); + this->_UnBlock( ); + } + catch( ... ) + { + QMessageBox::critical( + this, + QMessageBox::tr( "Error executing filter" ), + QMessageBox::tr( "Unknown error" ) + ); + this->_UnBlock( ); -#endif // cpPlugins_QT4 + } // yrt +} // eof - $RCSfile$