QFileInfo info( argv[ 0 ] );
if( info.exists( ) )
{
- this->m_PluginsPath = info.canonicalPath( ).toStdString( );
- this->_LoadPluginsFromPath( this->m_PluginsPath );
+ if( !( this->m_Interface.LoadConfiguration( cpPlugins_CONFIG_FILE ) ) )
+ {
+ this->m_PluginsPath = info.canonicalPath( ).toStdString( );
+ this->_LoadPluginsFromPath( this->m_PluginsPath );
+ }
+ /*
+ else
+ this->_UpdateLoadedPlugins( );
+ */
} // fi
+ QDir exec_dir( "." );
+ if( exec_dir.exists( ) )
+ this->_LoadPluginsFromPath( exec_dir.canonicalPath( ).toStdString( ) );
/* TODO
this->m_Interface = new cpPlugins::Interface( );
{
try
{
- this->m_Interface.LoadPluginFile( fIt->toStdString( ) );
+ this->m_Interface.LoadPluginFile(
+ ( dir.absolutePath( ) + QDir::separator( ) + *fIt ).toStdString( )
+ );
}
- catch( ... )
+ catch( std::exception& err )
{
// Just ignore un-loadable libraries
- }
+ } // yrt
- } // yrt
+ } // rof
this->_UpdateLoadedPlugins( );
}
"Error loading default plugins",
"No plugins loaded: remember to load some!!!"
);
+ this->_UnBlock( );
return;
} // fi
} // rof
this->_UnBlock( );
+ this->m_Interface.SaveConfiguration( cpPlugins_CONFIG_FILE );
}
// -------------------------------------------------------------------------
void PipelineEditor::
_ButtonLoadPluginsFile( )
{
- /*
QFileDialog dlg( this );
dlg.setFileMode( QFileDialog::ExistingFiles );
dlg.setDirectory( "." );
std::stringstream name_filter;
- std::string suffix = std::string( cpPlugins_PLUGIN_EXT ).substr( 1 );
-
- name_filter << "Plugins file (*" << cpPlugins_PLUGIN_EXT << ");;All files (*)";
+ std::string suffix = std::string( cpPlugins_PLUGIN_EXT );
+ name_filter
+ << "Plugins file (*." << cpPlugins_PLUGIN_EXT << ");;All files (*)";
dlg.setNameFilter( name_filter.str( ).c_str( ) );
dlg.setDefaultSuffix( suffix.c_str( ) );
QStringList names = dlg.selectedFiles( );
std::stringstream err_str;
for( auto qIt = names.begin( ); qIt != names.end( ); ++qIt )
- err_str << this->m_Interface->Load( qIt->toStdString( ) );
+ {
+ try
+ {
+ this->m_Interface.LoadPluginFile( qIt->toStdString( ) );
+ }
+ catch( std::exception& err )
+ {
+ err_str << err.what( ) << std::endl;
+
+ } // yrt
+
+ } // rof
// Show an error message
std::string err = err_str.str( );
);
// Update view
- this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath );
+ // TODO: this->m_Interface.SaveDefaultConfiguration( this->m_PluginsPath );
this->_UpdateLoadedPlugins( );
- */
}
// -------------------------------------------------------------------------
_ButtonLoadPluginsPath( )
{
/*
- QFileDialog dlg( this );
- dlg.setFileMode( QFileDialog::DirectoryOnly );
- dlg.setDirectory( "." );
- if( !( dlg.exec( ) ) )
+ QFileDialog dlg( this );
+ dlg.setFileMode( QFileDialog::DirectoryOnly );
+ dlg.setDirectory( "." );
+ if( !( dlg.exec( ) ) )
return;
- // Read
- std::string dir = dlg.selectedFiles( ).begin( )->toStdString( );
- std::string err = this->m_Interface->LoadFromFolder( dir, false );
- if( err != "" )
+ // Read
+ std::string dir = dlg.selectedFiles( ).begin( )->toStdString( );
+ std::string err = this->m_Interface->LoadFromFolder( dir, false );
+ if( err != "" )
QMessageBox::critical(
- this,
- "Error loading plugins directory",
- err.c_str( )
- );
+ this,
+ "Error loading plugins directory",
+ err.c_str( )
+ );
- // Update view
- this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath );
- this->_UpdateLoadedPlugins( );
+ // Update view
+ this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath );
+ this->_UpdateLoadedPlugins( );
*/
}
}
else if( mdata != NULL )
{
+ if( this->m_UI->Viewer->AddData( mdata, data_name ) )
+ {
+ this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
+ this->_Block( );
+ this->m_UI->Viewer->ShowData( data_name );
+ this->_UnBlock( );
+
+ } // fi
}
else
QMessageBox::critical(