From: srn Date: Mon, 6 Feb 2006 08:28:15 +0000 (+0000) Subject: changed method restoreVisualState X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=643a00634f598428c28828f423316022ede40558;p=modules%2Fgui.git changed method restoreVisualState --- diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 6568e5479..1a9662eea 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -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; }