From: eap Date: Fri, 26 Jul 2013 16:00:57 +0000 (+0000) Subject: 0022287: [CEA 912] Notebook: clicking on "update study" returns an error message X-Git-Tag: BR_hydro_v_0_3_1~98 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c2dedcc79765efce349ccb6dfd4c8018eea77bc2;p=modules%2Fgui.git 0022287: [CEA 912] Notebook: clicking on "update study" returns an error message --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index fb974086a..03eb095bb 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1918,17 +1918,17 @@ bool SalomeApp_Application::updateStudy() // 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( aList[ anIndex - 1 ] ); - else if(anIndex == 0 && aList.count() > 1) - app = dynamic_cast( aList[ 1 ] ); + SalomeApp_Application* app = this; + if( anIndex > 0 && anIndex < aList.count() ) + app = dynamic_cast( aList[ anIndex - 1 ] ); + else if(anIndex == 0 && aList.count() > 1) + app = dynamic_cast( 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 ); @@ -1942,7 +1942,7 @@ bool SalomeApp_Application::updateStudy() if( !changeDesktop ) { ok = onRestoreStudy( aDumpScript, - aStudyName, + aStudyName, isStudySaved ); } @@ -2001,7 +2001,7 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript, /*! Close the Application */ -void SalomeApp_Application::closeApplication() +void SalomeApp_Application::afterCloseDoc() { // emit signal to restore study from Python script if ( myNoteBook ) { @@ -2009,5 +2009,5 @@ void SalomeApp_Application::closeApplication() myNoteBook->getDumpedStudyName(), myNoteBook->isDumpedStudySaved() ); } - LightApp_Application::closeApplication(); + LightApp_Application::afterCloseDoc(); } diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 8df8dbb5e..94fecf146 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -132,8 +132,8 @@ public slots: 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* ); @@ -168,7 +168,7 @@ protected: bool updateStudy(); - virtual void closeApplication(); + virtual void afterCloseDoc(); private slots: void onDeleteInvalidReferences(); @@ -196,8 +196,8 @@ private: signals: void dumpedStudyClosed( const QString& theDumpScript, - const QString& theStudyName, - bool theIsStudySaved ); + const QString& theStudyName, + bool theIsStudySaved ); void notebookVarUpdated( QString theVarName ); };