Salome HOME
remove traces
[modules/gui.git] / src / SalomeApp / SalomeApp_VisualState.cxx
index a28e5422820291fd37a553023eb473fae55d6cfd..8dd15089a2805909387379f6a5743f3dad53a8d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -178,9 +178,11 @@ int SalomeApp_VisualState::storeState()
     module = itM.next();
     if ( !module ) continue;
 
-    if ( SalomeApp_Module* sModule = dynamic_cast<SalomeApp_Module*>( module ) ) {
-      ip->append( "AP_MODULES_LIST", sModule->moduleName().toStdString() );
-      sModule->storeVisualParameters( savePoint );
+
+    if ( LightApp_Module* lModule = dynamic_cast<LightApp_Module*>( module ) ) {
+      ip->append( "AP_MODULES_LIST", lModule->moduleName().toStdString() );
+      if ( SalomeApp_Module* sModule = dynamic_cast<SalomeApp_Module*>( module ) )
+        sModule->storeVisualParameters( savePoint );
     }
   }
 
@@ -264,6 +266,8 @@ void SalomeApp_VisualState::restoreState(int savePoint)
     }
   }
 
+  qApp->processEvents( QEventLoop::ExcludeUserInputEvents, 5000 );
+
   // restore modules' visual parameters
   std::vector<std::string> v = ip->getValues( "AP_MODULES_LIST" );
   for ( int i = 0; i < v.size(); i++ )
@@ -305,7 +309,7 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   // so the same views will get the same names.
   nameViewWindows( lst );
 
-  qApp->processEvents();
+  qApp->processEvents( QEventLoop::ExcludeUserInputEvents, 5000 );
 
   // restore workstack parameters.  should be done after module's restoreVisualParameters(), because
   // some modules can create their own viewers (like VISU creates GaussViewers)