]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Moved method which closes study in python console
authormpa <mpa@opencascade.com>
Tue, 23 Sep 2014 12:32:40 +0000 (16:32 +0400)
committermpa <mpa@opencascade.com>
Tue, 23 Sep 2014 12:32:40 +0000 (16:32 +0400)
src/LightApp/LightApp_Application.cxx
src/SalomeApp/SalomeApp_Study.cxx

index 29ad892fd0916fa99415958e19a425fad2f58dca..d81f07848456c9feafe76880d753158920309f13 100644 (file)
@@ -1660,11 +1660,6 @@ void LightApp_Application::onStudyClosed( SUIT_Study* s )
   emit studyClosed();
 
   activateModule( "" );
-
-#ifndef DISABLE_PYCONSOLE
-  if( pythonConsole() )
-    pythonConsole()->getInterp()->destroy();
-#endif
 }
 
 /*!Protected SLOT.On desktop activated.*/
index 70bd944cbdf7458bfc2b35f49957c6cbf107c4e3..b83431fa04af01890d8600ab013da2b84b95a623 100644 (file)
 
 #include <LightApp_Displayer.h>
 
+#ifndef DISABLE_PYCONSOLE
+  #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
+  #include <PyConsole_Console.h>
+#endif
+
 #include "utilities.h"
 
 #include "SALOMEDS_Tool.hxx"
@@ -730,6 +735,11 @@ void SalomeApp_Study::closeDocument(bool permanently)
       myStudyDS->detach( myObserver->_this() );
     if ( permanently ) {
       SalomeApp_Application::studyMgr()->Close( studyPtr );
+#ifndef DISABLE_PYCONSOLE
+      SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
+      if( app->pythonConsole() )
+        app->pythonConsole()->getInterp()->destroy();
+#endif
     }
     SALOMEDSClient_Study* aStudy = 0;
     setStudyDS( _PTR(Study)(aStudy) );