]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0022287: [CEA 912] Notebook: clicking on "update study" returns an error message
authoreap <eap@opencascade.com>
Fri, 26 Jul 2013 16:00:57 +0000 (16:00 +0000)
committereap <eap@opencascade.com>
Fri, 26 Jul 2013 16:00:57 +0000 (16:00 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index fb974086a328efb353da385fa5091d575b9f42b8..03eb095bb92515b33f4b8601911dfe85ecb0e0c4 100644 (file)
@@ -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<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 );
@@ -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();
 }
index 8df8dbb5e3af164585e4ab3dc2b1af6b93169f39..94fecf1462e97988dda380904dc0c5dd64bb0b64 100644 (file)
@@ -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 );
 
 };