#include <CAM_Module.h>
+#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
// clear a study (delete all objects)
clearStudy();
+ // get active application
+ app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+
// load study from the temporary directory
QString command = QString( "execfile(\"%1\")" ).arg( aTmpDir + QDir::separator() + aFileName + ".py" );
if( !app )
return;
+ QList<SUIT_Application*> aList = SUIT_Session::session()->applications();
+ int anIndex = aList.indexOf( app );
+
+ if( anIndex > 0 )
+ setParent( 0 );
+
app->onCloseDoc( false );
+
+ if( anIndex > 0 && anIndex < aList.count() )
+ app = dynamic_cast<SalomeApp_Application*>( aList[ anIndex - 1 ] );
+
+ if( !app )
+ return;
+
app->onNewDoc();
+
+ app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ if( anIndex > 0 && app ) {
+ setParent( app->desktop(), Qt::Dialog );
+ show();
+ }
}