]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
changed method restoreVisualState
authorsrn <srn@opencascade.com>
Mon, 6 Feb 2006 08:28:15 +0000 (08:28 +0000)
committersrn <srn@opencascade.com>
Mon, 6 Feb 2006 08:28:15 +0000 (08:28 +0000)
src/Session/Session_Session_i.cxx

index 6568e54795c1601cf41cdf26236afca6dccbad69..1a9662eea467dccda36069ff6ecb7a04ef3199bd 100755 (executable)
@@ -216,14 +216,22 @@ CORBA::Long SALOME_Session_i::GetActiveStudyId()
 
 bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
 {
+  class TEvent: public SALOME_Event {
+    int _savePoint;
+  public:
+    TEvent(int savePoint) { _savePoint = savePoint; }
+    virtual void Execute() {
+      SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy();
+      if ( study ) {
+       study->restoreState(_savePoint);
+      }
+    }
+  };
+  
   if(SUIT_Session::session() && SUIT_Session::session()->activeApplication() ) {
     SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy();
-    if(!study) {
-      SUIT_Session::session()->activeApplication()->createEmptyStudy();
-      study = SUIT_Session::session()->activeApplication()->activeStudy();
-    }
-    if(!study) return false;
-    study->restoreState(theSavePoint);
+    if(!study) SUIT_Session::session()->activeApplication()->createEmptyStudy();      
+    ProcessVoidEvent( new TEvent(theSavePoint) );
     return true;
   }