#include <cpExtensions/QT/SimpleMPRWidget.h>
#include <cpBaseQtApplication/ActorPropertiesQDialog.h>
#include <cpBaseQtApplication/Editor.h>
+#include <cpBaseQtApplication/PathsDialog.h>
#include <vtkRenderer.h>
#include <QApplication>
#include <QColorDialog>
if( i.exists( ) )
{
this->m_ExecutionPath = i.canonicalPath( ).toStdString( );
- try
- {
- this->m_Interface.OpenEnvironments( this->m_ExecutionPath );
- this->m_Interface.UpdateEnvironments( this->m_ExecutionPath );
- }
+ try { this->m_Interface.AddEnvironments( this->m_ExecutionPath ); }
+ catch( ... ) { }
+ try { this->m_Interface.OpenEnvironments( this->m_ExecutionPath ); }
+ catch( ... ) { }
+ try { this->m_Interface.SaveEnvironments( this->m_ExecutionPath ); }
catch( ... ) { }
}
else
this->m_ExecutionPath = "";
+ this->UpdateEnvironment( );
this->m_Workspace.SetInterface( &( this->m_Interface ) );
}
{
try
{
- this->m_Interface.LoadEnvironment( );
+ this->m_Interface.LoadEnvironments( );
this->m_Interface.GuessPlugins( );
}
catch( std::exception& err )
this->m_Workspace.Clear( );
}
+// -------------------------------------------------------------------------
+void cpBaseQtApplication::MainWindow::
+_AddEnvironments( const std::string& environments )
+{
+ try { this->m_Interface.AddEnvironments( environments ); }
+ catch( ... ) { }
+ try { this->m_Interface.SaveEnvironments( this->m_ExecutionPath ); }
+ catch( ... ) { }
+ this->UpdateEnvironment( );
+}
+
// -------------------------------------------------------------------------
void cpBaseQtApplication::MainWindow::
_LoadPlugins( const std::string& filename )
);
}
-// -------------------------------------------------------------------------
-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( )
- );
-}
-
// -------------------------------------------------------------------------
void cpBaseQtApplication::MainWindow::
_Block( )
this->_LoadPluginsFromPath( d.selectedFiles( ).begin( )->toStdString( ) );
}
+// -------------------------------------------------------------------------
+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( )
+ );
+}
+
// -------------------------------------------------------------------------
void cpBaseQtApplication::MainWindow::
_InteractiveLoadWorkspace( )
this->_SaveWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
}
+// -------------------------------------------------------------------------
+void cpBaseQtApplication::MainWindow::
+_InteractiveAddEnviromentPaths( )
+{
+ PathsDialog dlg( this );
+ dlg.addPaths( this->m_Interface.GetPaths( ) );
+ if( dlg.exec( ) )
+ {
+ auto paths = dlg.getPaths( );
+ for( auto p = paths.begin( ); p != paths.end( ); ++p )
+ {
+ try { this->m_Interface.AddEnvironments( *p ); }
+ catch( ... ) { }
+
+ } // rof
+ this->UpdateEnvironment( );
+
+ } // fi
+}
+
// -------------------------------------------------------------------------
void cpBaseQtApplication::MainWindow::
_ExecFilter( const std::string& filter_name )