Salome HOME
Update Help for VISU module.
[modules/visu.git] / src / VISUGUI / VisuGUI_Tools.cxx
index 191964a2a94d8f6fff9665dc582d373e6d862c38..83eab7448da805b5fd5b2f614c54af15ac54f798 100644 (file)
@@ -102,7 +102,18 @@ namespace VISU
   CheckLock( _PTR(Study) theStudy )
   {
     if(IsStudyLocked(theStudy))
-      throw std::runtime_error(QObject::tr("WRN_STUDY_LOCKED").latin1());
+      {
+       SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
+         (SUIT_Session::session()->activeApplication());
+       if (anApp)
+         {
+           SUIT_MessageBox::warn1(anApp->desktop(),
+                                   QObject::tr("WRN_VISU_WARNING"),
+                                   QObject::tr("WRN_STUDY_LOCKED"),
+                                   QObject::tr("BUT_OK"));
+           return true;
+         }
+      }
     return false;
   }
 
@@ -399,9 +410,6 @@ namespace VISU
       _PTR(SObject) aChildSObject = aChildIter->Value();
       
       CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
-      VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(aChildObj);
-      if( !CORBA::is_nil( aRemovableObject ) ) 
-       study->deleteReferencesTo( aChildSObject );
       ErasePrs(theModule, aChildObj);
     }
 
@@ -411,7 +419,6 @@ namespace VISU
 
       VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj);
       if (!CORBA::is_nil(aRemovableObject)) {
-       study->deleteReferencesTo( theSObject );
         aRemovableObject->RemoveFromStudy();
       }
     } else {
@@ -651,7 +658,7 @@ namespace VISU
       else
       {
        SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate );
-       return dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() );
+       return aViewManager ? dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() ) : 0;
       }
     }
     return NULL;