// 1) Application is not the first application in the session
// 2) Application is the first application in session but not the only.
bool changeDesktop = ((anIndex > 0) || (anIndex == 0 && aList.count() > 1));
+ if( changeDesktop ) {
- SalomeApp_Application* app;
- if( anIndex > 0 && anIndex < aList.count() )
- app = dynamic_cast<SalomeApp_Application*>( aList[ anIndex - 1 ] );
- else if(anIndex == 0 && aList.count() > 1)
- app = dynamic_cast<SalomeApp_Application*>( aList[ 1 ] );
+ SalomeApp_Application* app = this;
+ if( anIndex > 0 && anIndex < aList.count() )
+ app = dynamic_cast<SalomeApp_Application*>( aList[ anIndex - 1 ] );
+ else if(anIndex == 0 && aList.count() > 1)
+ app = dynamic_cast<SalomeApp_Application*>( aList[ 1 ] );
- if( !app )
- return false;
+ if( !app )
+ return false;
- if( changeDesktop ) {
// creation a new study and restoring will be done in another application
connect( this, SIGNAL( dumpedStudyClosed( const QString&, const QString&, bool ) ),
app, SLOT( onRestoreStudy( const QString&, const QString&, bool ) ), Qt::UniqueConnection );
if( !changeDesktop ) {
ok = onRestoreStudy( aDumpScript,
- aStudyName,
+ aStudyName,
isStudySaved );
}
/*!
Close the Application
*/
-void SalomeApp_Application::closeApplication()
+void SalomeApp_Application::afterCloseDoc()
{
// emit signal to restore study from Python script
if ( myNoteBook ) {
myNoteBook->getDumpedStudyName(),
myNoteBook->isDumpedStudySaved() );
}
- LightApp_Application::closeApplication();
+ LightApp_Application::afterCloseDoc();
}
void onSaveGUIState();// called from VISU
void onUpdateStudy(); // called from NoteBook
bool onRestoreStudy( const QString& theDumpScript,
- const QString& theStudyName,
- bool theIsStudySaved );
+ const QString& theStudyName,
+ bool theIsStudySaved );
protected slots:
void onStudyCreated( SUIT_Study* );
bool updateStudy();
- virtual void closeApplication();
+ virtual void afterCloseDoc();
private slots:
void onDeleteInvalidReferences();
signals:
void dumpedStudyClosed( const QString& theDumpScript,
- const QString& theStudyName,
- bool theIsStudySaved );
+ const QString& theStudyName,
+ bool theIsStudySaved );
void notebookVarUpdated( QString theVarName );
};