-// Copyright (C) 2006-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2015 CEA/DEN, EDF R&D
//
// 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
_genericGui->createTools();
this->studyActivated();
- if (createSComponent()) updateObjBrowser();
+ // VSR 23/10/2014: note that this is not a good way to create SComponent from this point
+ // as initialize() method can be potentially called when there's no yet open study;
+ // this is better to do in activateModule()
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( aStudy ) {
+ bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->studyDS()->GetProperties()))->IsLocked();
+ if ( aLocked ) {
+ SUIT_MessageBox::warning ( app->desktop(), QObject::tr("WRN_WARNING"), QObject::tr("WRN_STUDY_LOCKED") );
+ }
+ else {
+ if (createSComponent()) updateObjBrowser();
+ }
+ }
// Load SALOME module catalogs
QStringList appModules;