]> Creatis software - cpPlugins.git/blobdiff - lib/cpBaseQtApplication/MainWindow.cxx
...
[cpPlugins.git] / lib / cpBaseQtApplication / MainWindow.cxx
index fcff5c2a435dcfe3ac97004fe9fa3defe582999c..37b18aa56168693a98df86b999010b239002e2db 100644 (file)
@@ -1,70 +1,39 @@
 #include <cpBaseQtApplication/MainWindow.h>
+#include <cpBaseQtApplication/Plugins/Navigator.h>
+#include <cpBaseQtApplication/Pipeline/Canvas.h>
+#include <cpExtensions/QT/ConfigurationChooser.h>
+#include <cpExtensions/QT/ActorsWidgetInterface.h>
 
-#include <cpExtensions/QT/SimpleMPRWidget.h>
-#include <cpBaseQtApplication/ActorPropertiesQDialog.h>
-#include <cpBaseQtApplication/Editor.h>
-#include <cpBaseQtApplication/PathsDialog.h>
-#include <vtkRenderer.h>
-#include <QApplication>
-#include <QColorDialog>
 #include <QDir>
 #include <QFileDialog>
-#include <QFileInfo>
-#include <QMessageBox>
-#include <QTreeWidget>
-
-// -------------------------------------------------------------------------
-bool cpBaseQtApplication::MainWindow::_TBlocker::
-eventFilter( QObject* obj, QEvent* event )
-{
-  return( true ); // -> Block all events
-  /* NOTE: this should be the correct implementation:
-     switch( event->type( ) )
-     {
-     //list event you want to prevent here ...
-     case QEvent::KeyPress:
-     case QEvent::KeyRelease:
-     case QEvent::MouseButtonRelease:
-     case QEvent::MouseButtonPress:
-     case QEvent::MouseButtonDblClick:
-     //...
-     return( true );
-     } // hctiws
-     return( this->QObject::eventFilter( obj, event ) );
-  */
-}
+#include <QInputDialog>
 
 // -------------------------------------------------------------------------
 cpBaseQtApplication::MainWindow::
 MainWindow(
   int argc, char* argv[],
-  QApplication* app,
   QWidget* parent
   )
   : Superclass( parent ),
-    m_Application( app ),
-    m_PluginsPath( "." ),
-    m_TreeWidget( NULL ),
-    m_Editor( NULL ),
-    m_MPR( NULL )
+    m_LastSaveFileName( "" ),
+    m_SingleWorkspace( false ),
+    m_BaseWindowTitle( "cpBaseQtApplication" ),
+    m_Canvas( NULL ),
+    m_Navigator( NULL ),
+    m_Viewer( NULL )
 {
-  QFileInfo e_path( argv[ 0 ] );
-  QDir r_path( "." );
-  this->m_RunPath = r_path.canonicalPath( ).toStdString( );
-  std::stringstream paths;
-  paths
-    << e_path.canonicalPath( ).toStdString( )
-    << cpPlugins_SEPARATOR
-    << this->m_RunPath;
-
-  try { this->m_Interface.AddEnvironments( this->m_RunPath ); }
-  catch( ... ) { }
-  try { this->m_Interface.OpenEnvironments( this->m_RunPath ); }
-  catch( ... ) { }
-  try { this->m_Interface.SaveEnvironments( this->m_RunPath ); }
-  catch( ... ) { }
-  this->UpdateEnvironment( );
-  this->m_Workspace.SetInterface( &( this->m_Interface ) );
+  this->m_RunPath = QDir( "." ).canonicalPath( ).toStdString( );
+  this->m_Plugins = TPlugins::New( );
+  try
+  {
+    this->m_Plugins->GuessEnvironment( this->m_RunPath );
+    this->m_Plugins->GuessPlugins( );
+  }
+  catch( std::exception& err )
+  {
+    QMessageBox::critical( this, "Error guessing plugins.", err.what( ) );
+
+  } // yrt
 }
 
 // -------------------------------------------------------------------------
@@ -74,102 +43,107 @@ cpBaseQtApplication::MainWindow::
 }
 
 // -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-UpdateEnvironment( )
+cpBaseQtApplication::MainWindow::
+TWorkspace* cpBaseQtApplication::MainWindow::
+workspace( const std::string& wname )
 {
-  try
-  {
-    this->m_Interface.LoadEnvironments( );
-    this->m_Interface.GuessPlugins( );
-  }
-  catch( std::exception& err )
-  {
-    QMessageBox::critical(
-      this, "Error loading required libraries", err.what( )
-      );
-    return;
+  auto wIt = this->m_Workspaces.find( wname );
+  if( wIt != this->m_Workspaces.end( ) )
+    return( wIt->second.GetPointer( ) );
+  else
+    return( NULL );
+}
 
-  } // yrt
+// -------------------------------------------------------------------------
+const cpBaseQtApplication::MainWindow::
+TWorkspace* cpBaseQtApplication::MainWindow::
+workspace( const std::string& wname ) const
+{
+  auto wIt = this->m_Workspaces.find( wname );
+  if( wIt != this->m_Workspaces.end( ) )
+    return( wIt->second.GetPointer( ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+cpBaseQtApplication::Pipeline::Canvas*
+cpBaseQtApplication::MainWindow::
+canvas( )
+{
+  return( this->m_Canvas );
+}
+
+// -------------------------------------------------------------------------
+const cpBaseQtApplication::Pipeline::Canvas*
+cpBaseQtApplication::MainWindow::
+canvas( ) const
+{
+  return( this->m_Canvas );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_Configure(
-  QTreeWidget* tree,
-  cpExtensions::QT::SimpleMPRWidget* mpr,
-  cpBaseQtApplication::Editor* editor
-  )
+setCanvas( cpBaseQtApplication::Pipeline::Canvas* c )
 {
-  this->m_TreeWidget = tree;
-  this->_UpdateLoadedPlugins( );
-  this->m_Editor = editor;
-  this->m_MPR = mpr;
-  if( this->m_Editor != NULL )
-  {
-    this->m_Editor->setWorkspace( &( this->m_Workspace ) );
+  this->m_Canvas = c;
+}
 
-    // Slots <-> signals
-    this->connect(
-      this->m_Editor,
-      SIGNAL( execFilter( const std::string& ) ),
-      this,
-      SLOT( _ExecFilter( const std::string& ) )
-      );
-    this->connect(
-      this->m_Editor,
-      SIGNAL( showFilterOutput( const std::string&, const std::string& ) ),
-      this,
-      SLOT( _ShowData( const std::string&, const std::string& ) )
-      );
-    this->connect(
-      this->m_Editor,
-      SIGNAL( hideFilterOutput( const std::string&, const std::string& ) ),
-      this,
-      SLOT( _HideData( const std::string&, const std::string& ) )
-      );
-    this->connect(
-      this->m_Editor,
-      SIGNAL( visualPropertiesFilterOutput( const std::string&, const std::string& ) ),
-      this,
-      SLOT( _DataProperties( const std::string&, const std::string& ) )
-      );
+// -------------------------------------------------------------------------
+cpBaseQtApplication::Plugins::Navigator*
+cpBaseQtApplication::MainWindow::
+navigator( )
+{
+  return( this->m_Navigator );
+}
 
-  } // fi
-  if( this->m_MPR != NULL )
-    this->m_Workspace.SetMPRViewer( this->m_MPR );
-  this->_ClearWorkspace( );
+// -------------------------------------------------------------------------
+const cpBaseQtApplication::Plugins::Navigator*
+cpBaseQtApplication::MainWindow::
+navigator( ) const
+{
+  return( this->m_Navigator );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_ClearWorkspace( )
+setNavigator( cpBaseQtApplication::Plugins::Navigator* n )
+{
+  this->m_Navigator = n;
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::ActorsWidgetInterface*
+cpBaseQtApplication::MainWindow::
+viewer( )
 {
-  if( this->m_Editor != NULL )
-    this->m_Editor->clear( );
-  if( this->m_MPR != NULL )
-    this->m_MPR->Clear( );
-  this->m_Workspace.Clear( );
+  return( this->m_Viewer );
+}
+
+// -------------------------------------------------------------------------
+const cpExtensions::QT::ActorsWidgetInterface*
+cpBaseQtApplication::MainWindow::
+viewer( ) const
+{
+  return( this->m_Viewer );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_AddEnvironments( const std::string& environments )
+setViewer( cpExtensions::QT::ActorsWidgetInterface* v )
 {
-  try { this->m_Interface.AddEnvironments( environments ); }
-  catch( ... ) { }
-  try { this->m_Interface.SaveEnvironments( this->m_RunPath ); }
-  catch( ... ) { }
-  this->UpdateEnvironment( );
+  this->m_Viewer = v;
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_LoadPlugins( const std::string& filename )
+_loadPlugins( const std::string& filename )
 {
   try
   {
-    this->m_Interface.LoadFile( filename );
-    this->_UpdateLoadedPlugins( );
+    this->m_Plugins->LoadPluginsFile( filename );
+    if( this->m_Navigator != NULL )
+      this->m_Navigator->Update( );
   }
   catch( std::exception& err )
   {
@@ -184,12 +158,33 @@ _LoadPlugins( const std::string& filename )
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_LoadPluginsFromPath( const std::string& path )
+_loadPlugins( )
+{
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::ExistingFiles );
+
+  std::stringstream filter;
+  std::string suffix = std::string( cpPlugins_LIB_EXT );
+  filter << "Plugins file (*" << cpPlugins_LIB_EXT << ");;All files (*)";
+  dlg.setNameFilter( filter.str( ).c_str( ) );
+  dlg.setDefaultSuffix( suffix.c_str( ) );
+  if( !( dlg.exec( ) ) )
+    return;
+  QStringList names = dlg.selectedFiles( );
+  for( auto qIt = names.begin( ); qIt != names.end( ); ++qIt )
+    this->_loadPlugins( qIt->toStdString( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpBaseQtApplication::MainWindow::
+_loadPluginsFromPath( const std::string& path )
 {
   try
   {
-    this->m_Interface.LoadDirectory( path );
-    this->_UpdateLoadedPlugins( );
+    this->m_Plugins->LoadPluginsDirectory( path );
+    this->m_Plugins->SaveEnvironment( this->m_RunPath );
+    if( this->m_Navigator != NULL )
+      this->m_Navigator->Update( );
   }
   catch( std::exception& err )
   {
@@ -204,308 +199,186 @@ _LoadPluginsFromPath( const std::string& path )
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_UpdateLoadedPlugins( )
+_loadPluginsFromPath( )
 {
-  if( this->m_TreeWidget == NULL )
+  QFileDialog d( this );
+  d.setFileMode( QFileDialog::DirectoryOnly );
+  if( !( d.exec( ) ) )
     return;
-  this->_Block( );
-  auto categories = this->m_Interface.GetCategories( );
-  unsigned int filter_count = 0;
-  for( auto cIt = categories.begin( ); cIt != categories.end( ); ++cIt )
-  {
-    // Create or get category
-    QList< QTreeWidgetItem* > cat_items =
-      this->m_TreeWidget->findItems(
-        cIt->c_str( ), Qt::MatchExactly | Qt::MatchRecursive
-        );
-    QTreeWidgetItem* cat = NULL;
-    if( cat_items.size( ) == 0 )
-    {
-      cat = new QTreeWidgetItem(
-        ( QTreeWidgetItem* )( NULL ), QStringList( cIt->c_str( ) )
-        );
-      this->m_TreeWidget->addTopLevelItem( cat );
-    }
-    else
-      cat = cat_items[ 0 ];
-
-    // Create filters
-    auto filters = this->m_Interface.GetFilters( *cIt );
-    filter_count += filters.size( );
-    for( auto fIt = filters.begin( ); fIt != filters.end( ); ++fIt )
-    {
-      QList< QTreeWidgetItem* > filter_items =
-        this->m_TreeWidget->findItems(
-          fIt->c_str( ), Qt::MatchExactly | Qt::MatchRecursive
-          );
-      auto fiIt = filter_items.begin( );
-      auto found_fiIt = filter_items.end( );
-      for( ; fiIt != filter_items.end( ); ++fiIt )
-        if( ( *fiIt )->parent( ) == cat )
-          found_fiIt = fiIt;
-
-      // Add filter
-      if( found_fiIt == filter_items.end( ) )
-        QTreeWidgetItem* filter = new QTreeWidgetItem(
-          cat, QStringList( fIt->c_str( ) )
-          );
-
-    } // rof
-
-  } // rof
-  this->m_TreeWidget->expandAll( );
-  this->_UnBlock( );
-
-  if( filter_count == 0 )
-    QMessageBox::critical(
-      this,
-      "Error loading default plugins",
-      "No plugins loaded: remember to load some!!!"
-      );
-}
-
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_Block( )
-{
-  this->m_Application->setOverrideCursor( Qt::WaitCursor );
-  this->m_Application->installEventFilter( &( this->m_Blocker ) );
+  this->_loadPluginsFromPath( d.selectedFiles( ).begin( )->toStdString( ) );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_UnBlock( )
+_clearWorkspaces( )
 {
-  while( this->m_Application->overrideCursor( ) )
-    this->m_Application->restoreOverrideCursor( );
-  this->m_Application->removeEventFilter( &( this->m_Blocker ) );
+  this->m_Workspaces.clear( );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_LoadWorkspace( const std::string& filename )
+_addWorkspace( const std::string& name )
 {
-  this->_ClearWorkspace( );
-  std::string err = this->m_Workspace.LoadWorkspace( filename );
-  if( err != "" )
+  auto wIt = this->m_Workspaces.find( name );
+  if( wIt == this->m_Workspaces.end( ) )
   {
-    QMessageBox::critical(
-      this,
-      QMessageBox::tr( "Error loading workspace" ),
-      QMessageBox::tr( err.c_str( ) )
-      );
-  }
-  else
-  {
-    if( this->m_Editor != NULL )
-      this->m_Editor->redrawWorkspace( );
+    if( this->m_SingleWorkspace )
+      this->m_Workspaces.clear( );
+    this->m_Workspaces[ name ] = TWorkspace::New( );
+    if( this->m_Canvas != NULL )
+      this->m_Canvas->setWorkspace( this->m_Workspaces[ name ] );
+    this->setWindowTitle( ( this->m_BaseWindowTitle + name ).c_str( ) );
 
   } // fi
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_SaveWorkspace( const std::string& filename )
+_addWorkspace( )
 {
-  std::string err = this->m_Workspace.SaveWorkspace( filename );
-  if( err != "" )
-    QMessageBox::critical(
-      this,
-      QMessageBox::tr( "Error saving workspace" ),
-      QMessageBox::tr( err.c_str( ) )
+  bool ok;
+  QString text =
+    QInputDialog::getText(
+      this, "Creating a new workspace...",
+      "New workspace name: ",
+      QLineEdit::Normal,
+      "new_workspace",
+      &ok
       );
+  if( ok && !text.isEmpty( ) )
+    this->_addWorkspace( text.toStdString( ) );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_BackgroundProperties( unsigned int i )
+_saveWorkspace( const std::string& wname, const std::string& fname )
 {
-  if( this->m_MPR == NULL )
-    return;
-
-  QColor color =
-    QColorDialog::getColor(
-      QColor( 0, 0, 0 ),
-      this,
-      "Select Color",
-      QColorDialog::DontUseNativeDialog
-      );
-  if( color.isValid( ) )
+  auto wIt = this->m_Workspaces.find( wname );
+  if( wIt != this->m_Workspaces.end( ) )
   {
-    double r = double( color.red( ) ) / double( 255 );
-    double g = double( color.green( ) ) / double( 255 );
-    double b = double( color.blue( ) ) / double( 255 );
-    if( i >= 4 )
+    try
     {
-      unsigned int maxId = ( i == 4 )? 3: 4;
-      for( unsigned int j = 0; j < maxId; ++j )
-      {
-        auto ren = this->m_MPR->GetRenderer( j );
-        if( ren != NULL )
-        {
-          ren->SetBackground( r, g, b );
-          ren->Render( );
-
-        } // fi
-
-      } // rof
+      wIt->second->Save( fname );
+      this->m_LastSaveFileName = fname;
     }
-    else
+    catch( std::exception& err )
     {
-      auto ren = this->m_MPR->GetRenderer( i );
-      if( ren != NULL )
-      {
-        ren->SetBackground( r, g, b );
-        ren->Render( );
-
-      } // fi
-
-    } // fi
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_DataProperties( const std::string& actor )
-{
-  if( this->m_MPR == NULL )
-    return;
-  this->_Block( );
-  auto actors = this->m_MPR->GetActors( actor );
-  auto dlg = new cpBaseQtApplication::ActorPropertiesQDialog( NULL );
-  for( auto i = actors.begin( ); i != actors.end( ); ++i )
-    dlg->addActor( *i );
-  dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 0 ) );
-  dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 1 ) );
-  dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 2 ) );
-  dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 3 ) );
-  this->_UnBlock( );
-  dlg->exec( );
-}
-
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_ShowData( const std::string& filter_name, const std::string& output_name )
-{
-  if( this->m_MPR == NULL )
-    return;
-
-  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
-  if( output != NULL )
-  {
-    this->_Block( );
-    auto actor = output->GetVTKActor( );
-    if( actor != NULL )
-    {
-      this->m_MPR->AddActor(
-        actor, output_name + std::string( "@" ) + filter_name
-        );
-      this->_UnBlock( );
-    }
-    else
-    {
-      this->_UnBlock( );
       QMessageBox::critical(
         this,
-        QMessageBox::tr( "Error showing data" ),
-        QMessageBox::tr( "Unknown VTK conversion." )
+        QMessageBox::tr( "Error saving workspace" ),
+        QMessageBox::tr( err.what( ) )
         );
 
-    } // fi
+    } // yrt
   }
   else
     QMessageBox::critical(
       this,
-      QMessageBox::tr( "Error showing data" ),
-      QMessageBox::tr( "Unknown port name." )
+      "Error saving workspace",
+      (
+        std::string( "Workspace \"" ) + wname +
+        std::string( "\" does not exist." )
+        ).c_str( )
       );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_HideData( const std::string& filter, const std::string& output )
-{
-  std::cout << "MainWindow::HideData" << std::endl;
-  /* TODO
-   */
-}
-
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_DataProperties(
-  const std::string& filter_name, const std::string& output_name
-  )
+_saveWorkspace( const std::string& wname, bool force )
 {
-  if( this->m_MPR == NULL )
-    return;
-
-  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
-  if( output != NULL )
-    this->_DataProperties( output_name + std::string( "@" ) + filter_name );
+  auto wIt = this->m_Workspaces.find( wname );
+  if( wIt != this->m_Workspaces.end( ) )
+  {
+    if( this->m_LastSaveFileName == "" || force )
+    {
+      QFileDialog dlg( this );
+      dlg.setFileMode( QFileDialog::AnyFile );
+      dlg.setDirectory( "." );
+      dlg.setAcceptMode( QFileDialog::AcceptSave );
+      dlg.setNameFilter(
+        QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
+        );
+      dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
+      dlg.setWindowTitle(
+        (
+          std::string( "Saving \"" ) + wIt->first + std::string( "\"..." )
+          ).c_str( )
+        );
+      if( dlg.exec( ) )
+        this->_saveWorkspace(
+          wIt->first, dlg.selectedFiles( ).begin( )->toStdString( )
+          );
+    }
+    else
+      this->_saveWorkspace( wIt->first, this->m_LastSaveFileName );
+  }
   else
     QMessageBox::critical(
       this,
-      QMessageBox::tr( "Error showing data" ),
-      QMessageBox::tr( "Unknown port name." )
+      "Error saving workspace",
+      (
+        std::string( "Workspace \"" ) + wname +
+        std::string( "\" does not exist." )
+        ).c_str( )
       );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_InteractiveLoadPlugins( )
+_saveWorkspace( )
 {
-  QFileDialog dlg( this );
-  dlg.setFileMode( QFileDialog::ExistingFiles );
-  dlg.setDirectory( this->m_PluginsPath.c_str( ) );
+  for(
+    auto wIt = this->m_Workspaces.begin( );
+    wIt != this->m_Workspaces.end( );
+    ++wIt
+    )
+  {
+    QFileDialog dlg( this );
+    dlg.setFileMode( QFileDialog::AnyFile );
+    dlg.setDirectory( "." );
+    dlg.setAcceptMode( QFileDialog::AcceptSave );
+    dlg.setNameFilter(
+      QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
+      );
+    dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
+    dlg.setWindowTitle(
+      (
+        std::string( "Saving \"" ) + wIt->first + std::string( "\"..." )
+        ).c_str( )
+      );
+    if( dlg.exec( ) )
+      this->_saveWorkspace(
+        wIt->first, dlg.selectedFiles( ).begin( )->toStdString( )
+        );
 
-  std::stringstream filter;
-  std::string suffix = std::string( cpPlugins_LIB_EXT );
-  filter << "Plugins file (*." << cpPlugins_LIB_EXT << ");;All files (*)";
-  dlg.setNameFilter( filter.str( ).c_str( ) );
-  dlg.setDefaultSuffix( suffix.c_str( ) );
-  if( !( dlg.exec( ) ) )
-    return;
-  QStringList names = dlg.selectedFiles( );
-  for( auto qIt = names.begin( ); qIt != names.end( ); ++qIt )
-    this->_LoadPlugins( qIt->toStdString( ) );
+  } // rof
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_InteractiveLoadPluginsFromPath( )
+_loadWorkspace( const std::string& fname )
 {
-  QFileDialog d( this );
-  d.setFileMode( QFileDialog::DirectoryOnly );
-  d.setDirectory( this->m_PluginsPath.c_str( ) );
-  if( !( d.exec( ) ) )
-    return;
-  this->_LoadPluginsFromPath( d.selectedFiles( ).begin( )->toStdString( ) );
-}
+  try
+  {
+    this->_addWorkspace( fname );
+    this->m_Workspaces[ fname ]->Load( fname );
+    if( this->m_Canvas != NULL )
+      this->m_Canvas->setWorkspace( this->m_Workspaces[ fname ] );
+  }
+  catch( std::exception& err )
+  {
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error loading workspace" ),
+      QMessageBox::tr( err.what( ) )
+      );
 
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_ShowPlugins( )
-{
-  auto paths = this->m_Interface.GetPaths( );
-  auto plugins = this->m_Interface.GetPlugins( );
-  std::stringstream info;
-  info << "-----   PATHS   -----" << std::endl;
-  for( auto i = paths.begin( ); i != paths.end( ); ++i )
-    info << "   " << *i << std::endl;
-  info << std::endl << "-----  PLUGINS  -----" << std::endl;
-  for( auto i = plugins.begin( ); i != plugins.end( ); ++i )
-    info << "   " << *i << std::endl;
-  QMessageBox::information(
-    this,
-    "Loaded libraries and plugins information",
-    info.str( ).c_str( )
-    );
+  } // yrt
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_InteractiveLoadWorkspace( )
+_loadWorkspace( )
 {
   QFileDialog dlg( this );
   dlg.setFileMode( QFileDialog::ExistingFile );
@@ -516,49 +389,24 @@ _InteractiveLoadWorkspace( )
   dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
   if( !( dlg.exec( ) ) )
     return;
-  this->_LoadWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
-}
-
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_InteractiveSaveWorkspace( )
-{
-  QFileDialog dlg( this );
-  dlg.setFileMode( QFileDialog::AnyFile );
-  dlg.setDirectory( "." );
-  dlg.setAcceptMode( QFileDialog::AcceptSave );
-  dlg.setNameFilter(
-    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
-    );
-  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
-  if( !( dlg.exec( ) ) )
-    return;
-  this->_SaveWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
+  this->_loadWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
 }
 
 // -------------------------------------------------------------------------
 void cpBaseQtApplication::MainWindow::
-_InteractiveAddEnviromentPaths( )
+_actorsProperties( )
 {
-  PathsDialog dlg( this );
-  dlg.addPaths( this->m_Interface.GetPaths( ) );
-  if( dlg.exec( ) )
+  auto data =
+    dynamic_cast< cpExtensions::QT::ActorsWidgetInterface* >(
+      this->m_Viewer
+      );
+  if( data != NULL )
   {
-    auto paths = dlg.getPaths( );
-    std::stringstream envs;
-    for( auto p = paths.begin( ); p != paths.end( ); ++p )
-      envs << *p << cpPlugins_SEPARATOR;
-    this->_AddEnvironments( envs.str( ) );
-    this->UpdateEnvironment( );
+    auto dlg = new cpExtensions::QT::ConfigurationChooser( this );
+    dlg->setData( data );
+    dlg->exec( );
 
   } // fi
 }
 
-// -------------------------------------------------------------------------
-void cpBaseQtApplication::MainWindow::
-_ExecFilter( const std::string& filter_name )
-{
-  cpBaseQtApplication_Execute( this->m_Workspace.Execute( filter_name ) );
-}
-
 // eof - $RCSfile$