]> Creatis software - cpPlugins.git/blobdiff - lib/cpBaseQtApplication/MainWindow.h
...
[cpPlugins.git] / lib / cpBaseQtApplication / MainWindow.h
index 6a7190ea653bc1b73fffa03f0c9bf3945b9b1a3e..febf21e355c3a6d672de9b82fef611df2447bb97 100644 (file)
@@ -6,6 +6,51 @@
 #include <cpPlugins/Interface.h>
 #include <cpPlugins/Workspace.h>
 
+// -------------------------------------------------------------------------
+#define cpBaseQtApplication_ConnectAction( _action_, _slot_ )           \
+  this->connect(                                                        \
+    this->m_UI->_action_, SIGNAL( triggered( ) ),                       \
+    this, SLOT( _slot_( ) )                                             \
+    )
+
+// -------------------------------------------------------------------------
+#define cpBaseQtApplication_Execute( _command_ )        \
+  this->_Block( );                                      \
+  try                                                   \
+  {                                                     \
+    _command_;                                          \
+    this->_UnBlock( );                                  \
+  }                                                     \
+  catch( itk::ExceptionObject& err1 )                   \
+  {                                                     \
+    this->_UnBlock( );                                  \
+    QMessageBox::critical(                              \
+      this,                                             \
+      QMessageBox::tr( "Error executing filter" ),      \
+      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" )                \
+      );                                                \
+  }                                                     \
+  this->_UnBlock( )
+
+
 namespace cpExtensions
 {
   namespace QT
@@ -68,6 +113,7 @@ namespace cpBaseQtApplication
     void _SaveWorkspace( const std::string& filename );
 
     void _BackgroundProperties( unsigned int i );
+    void _DataProperties( const std::string& actor );
 
   protected slots:
     void _InteractiveLoadPlugins( );