Salome HOME
Merge branch merge_1_2_d
authorjrt <jrt>
Thu, 29 Jan 2004 17:33:20 +0000 (17:33 +0000)
committerjrt <jrt>
Thu, 29 Jan 2004 17:33:20 +0000 (17:33 +0000)
src/SMESHGUI/SMESHGUI_StudyAPI.cxx
src/SMESHGUI/SMESHGUI_Swig.cxx
src/SMESH_I/SMESH_Gen_i.cxx

index 6c5fdc5d673c94a37a5e7e035a205fe5a4ac5f52..42e2724d937d2d3b41cb927201cb1a150f50d5b6 100644 (file)
@@ -89,10 +89,10 @@ SMESHGUI_StudyAPI::SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy,
 
   // NRI : Temporary added
   if ( myStudy->GetProperties()->IsLocked() ) {
-    QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(),
-                           QObject::tr("WARNING"), 
-                           QObject::tr("WRN_STUDY_LOCKED"),
-                           QObject::tr("BUT_OK") );
+//    QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(),
+//                         QObject::tr("WARNING"), 
+//                         QObject::tr("WRN_STUDY_LOCKED"),
+//                         QObject::tr("BUT_OK") );
     
     return;
   }
index 67bdff519b1bde4f31037c06bae51164a8434367..2eace0798fe7e606fb17d09624b7130345aeee14 100644 (file)
@@ -91,6 +91,8 @@ void SMESH_Swig::Init(int studyID)
   SALOMEDS::SComponent_var father = myStudy->FindComponent("MESH");
   
   if (father->_is_nil()) {
+    bool aLocked = myStudy->GetProperties()->IsLocked();
+    if (aLocked) myStudy->GetProperties()->SetLocked(false);
     father = myStudyBuilder->NewComponent("MESH");
     anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
     aName = SALOMEDS::AttributeName::_narrow(anAttr);
@@ -99,10 +101,9 @@ void SMESH_Swig::Init(int studyID)
     anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
     aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
     aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
+    myStudyBuilder->DefineComponentInstance(father, CompMesh );
+    if (aLocked) myStudy->GetProperties()->SetLocked(true);
   }
-  myStudyBuilder->DefineComponentInstance(father, CompMesh );
-  mySComponentMesh = SALOMEDS::SComponent::_narrow( father );
-
   // Tags definition 
   Tag_HypothesisRoot  = 1;
   Tag_AlgorithmsRoot  = 2;
index d9c404cd93a4b90b4425cbecf6cb4fc7b82a0e42..b55ed358bd435e495cc3ccc3d447b8254b031c0d 100644 (file)
@@ -425,13 +425,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
   SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames;
   aFileSeq->length(NUM_TMP_FILES);
 
-  TCollection_AsciiString aStudyName(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
+  TCollection_AsciiString aStudyName("");
 
   // Set names of temporary files
-  TCollection_AsciiString filename = aStudyName + TCollection_AsciiString("SMESH.hdf");
-  TCollection_AsciiString hypofile = aStudyName + TCollection_AsciiString("SMESH_Hypo.txt");
-  TCollection_AsciiString algofile = aStudyName + TCollection_AsciiString("SMESH_Algo.txt");
-  TCollection_AsciiString meshfile = aStudyName + TCollection_AsciiString("SMESH_Mesh.med");
+  TCollection_AsciiString filename = aStudyName + TCollection_AsciiString("_SMESH.hdf");
+  TCollection_AsciiString hypofile = aStudyName + TCollection_AsciiString("_SMESH_Hypo.txt");
+  TCollection_AsciiString algofile = aStudyName + TCollection_AsciiString("_SMESH_Algo.txt");
+  TCollection_AsciiString meshfile = aStudyName + TCollection_AsciiString("_SMESH_Mesh.med");
   aFileSeq[0] = CORBA::string_dup(filename.ToCString());
   aFileSeq[1] = CORBA::string_dup(hypofile.ToCString());
   aFileSeq[2] = CORBA::string_dup(algofile.ToCString());
@@ -848,7 +848,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
   aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.ToCString(), aFileSeq.in(), isMultiFile);
 
   // Remove temporary files and directory
-  if (isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.ToCString(), aFileSeq.in(), true);
+  if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.ToCString(), aFileSeq.in(), true);
 
   MESSAGE("End SMESH_Gen_i::Save");
 
@@ -883,11 +883,14 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
                                                                            tmpDir.ToCString(),
                                                                           isMultiFile);
 
+  TCollection_AsciiString aStudyName("");
+  if (isMultiFile) aStudyName = (SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
+
   // Set names of temporary files
-  TCollection_AsciiString filename = tmpDir + aFileSeq[0];//"SMESH.hdf";
-  TCollection_AsciiString hypofile = tmpDir + aFileSeq[1];//"SMESH_Hypo.txt";
-  TCollection_AsciiString algofile = tmpDir + aFileSeq[2];//"SMESH_Algo.txt";
-  TCollection_AsciiString meshfile = tmpDir + aFileSeq[3];//"SMESH_Mesh.med";
+  TCollection_AsciiString filename = tmpDir + aStudyName + TCollection_AsciiString("_SMESH.hdf");
+  TCollection_AsciiString hypofile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Hypo.txt");
+  TCollection_AsciiString algofile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Algo.txt");
+  TCollection_AsciiString meshfile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Mesh.med");
 
   SALOMEDS::Study_var Study = theComponent->GetStudy(); 
   int studyId = Study->StudyId();