{
SUIT_Study* study = activeStudy();
- if ( !checkExistingDoc() )
+ if ( !checkExistingDoc( false ) )
+ return;
+
+ QString aName = getFileName( true, QString(), getFileFilter( true ), QString(), 0 );
+ if ( aName.isNull() ) //Cancel
return;
- CAM_Application::onOpenDoc();
+ closeDoc();
+ onOpenDoc( aName );
if ( !study ) // new study will be create in THIS application
{
/*!
Check existing document.
*/
-bool LightApp_Application::checkExistingDoc()
+bool LightApp_Application::checkExistingDoc( bool closeExistingDoc )
{
bool result = true;
if( activeStudy() ) {
}
}
else if( answer == 1 ) {
- closeDoc( false );
+ if (closeExistingDoc) {
+ closeDoc( false );
+ }
} else if( answer == 2 ) {
result = false;
}
void updateVisibilityState( DataObjectList& theList,
SUIT_ViewModel* theViewModel );
- virtual bool checkExistingDoc();
+ virtual bool checkExistingDoc( bool checkExistingDoc = true );
#ifndef DISABLE_PYCONSOLE
PyConsole_Interp* getPyInterp();