X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpBaseQtApplication%2FMainWindow.cxx;h=bfe8b5b9d4b5b9943b3e36080dbd4b7c543529a9;hb=8d542556415c0f37a325b1641bb51b2bc284a115;hp=0b67e49f5df7d297b19f8fd05e640b3613f321fd;hpb=2f03899acd402ac802f723c36485a121e753a6b8;p=cpPlugins.git diff --git a/lib/cpBaseQtApplication/MainWindow.cxx b/lib/cpBaseQtApplication/MainWindow.cxx index 0b67e49..bfe8b5b 100644 --- a/lib/cpBaseQtApplication/MainWindow.cxx +++ b/lib/cpBaseQtApplication/MainWindow.cxx @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -13,6 +14,8 @@ MainWindow( ) : Superclass( parent ), m_LastSaveFileName( "" ), + m_SingleWorkspace( false ), + m_BaseWindowTitle( "cpBaseQtApplication" ), m_Canvas( NULL ), m_Navigator( NULL ), m_Viewer( NULL ) @@ -216,7 +219,13 @@ _addWorkspace( const std::string& name ) { auto wIt = this->m_Workspaces.find( name ); if( wIt == this->m_Workspaces.end( ) ) + { + if( this->m_SingleWorkspace ) + this->m_Workspaces.clear( ); this->m_Workspaces[ name ] = TWorkspace::New( ); + this->setWindowTitle( ( this->m_BaseWindowTitle + name ).c_str( ) ); + + } // fi } // ------------------------------------------------------------------------- @@ -349,6 +358,8 @@ _loadWorkspace( const std::string& fname ) { 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 ) {