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;
}
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;