]> SALOME platform Git repositories - modules/homard.git/commitdiff
Salome HOME
Message d'erreur en cas de mauvais répertoire pour le cas en GUI
authornicolas <nicolas>
Tue, 22 Oct 2013 15:48:09 +0000 (15:48 +0000)
committernicolas <nicolas>
Tue, 22 Oct 2013 15:48:09 +0000 (15:48 +0000)
src/HOMARDGUI/HOMARD_msg_en.ts
src/HOMARDGUI/HOMARD_msg_fr.ts
src/HOMARDGUI/HOMARD_msg_ja.ts
src/HOMARDGUI/MonCreateCase.cxx
src/HOMARDGUI/MonCreateYACS.cxx
src/HOMARDGUI/MonMeshInfo.cxx
src/HOMARDGUI/MonPursueIteration.cxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Gen_i.hxx

index ffeb40f1264611ca8368390987be74fa7b60c07a..77a85cf7ceb6480601a81cd4ce5c2c6ac3e3c0d2 100644 (file)
     </message>
     <message>
         <source>HOM_CASE_DIRECTORY_2</source>
-        <translation>This directory is already used.</translation>
+        <translation>This directory is already used by the case </translation>
     </message>
     <message>
         <source>HOM_CASE_DIRECTORY_3</source>
index 22476ea75f0ac02712f1a6954f2254251ed19b74..bc77a0830af5cb68ab951009fcd6428abace911d 100644 (file)
     </message>
     <message>
         <source>HOM_CASE_DIRECTORY_2</source>
-        <translation>Ce répertoire est déjà utilisé.</translation>
+        <translation>Ce répertoire est déjà utilisé par le cas </translation>
     </message>
     <message>
         <source>HOM_CASE_DIRECTORY_3</source>
index 73a66509ff217466898f5adfccdbd5afff4fad53..00977b95a8ba9dabfdcf3167de7abbe57e4c3b08 100644 (file)
     </message>
     <message>
         <source>HOM_CASE_DIRECTORY_2</source>
-        <translation>This directory is already used.</translation>
+        <translation>This directory is already used by the case </translation>
     </message>
     <message>
         <source>HOM_CASE_DIRECTORY_3</source>
index 7f1137ef2dd132cd8cf81ced3a998eb37db2b7e2..ee6430b7f565d4317f649d475197a53430a68543 100644 (file)
@@ -154,11 +154,18 @@ bool MonCreateCase::PushOnApply()
                               QObject::tr("HOM_CASE_DIRECTORY_1") );
     return false;
   }
-  if ((aDirName != _aDirName) and (myHomardGen->VerifieDir( aDirName.toStdString().c_str()) == false))
-  {
-    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                              QObject::tr("HOM_CASE_DIRECTORY_2") );
-    return false;
+
+  if ( aDirName != _aDirName)
+  { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ;
+    if ( CaseNameDir != "" )
+    {
+      INFOS(CaseNameDir.toStdString().c_str());
+      QString texte ;
+      texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ;
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                texte );
+      return false;
+    }
   }
   if (chdir(aDirName.toStdString().c_str()) != 0)
   {
index bff7b2b8424b4d70adc91719ce8eafb21b98fa41..cd9bafc33078e8d9e4f8f9a8c892685f2046d307 100644 (file)
@@ -127,11 +127,17 @@ bool MonCreateYACS::PushOnApply()
                               QObject::tr("HOM_CASE_DIRECTORY_4") );
     return false;
   }
-  if ((aDirName != _aDirName) and (myHomardGen->VerifieDir( aDirName.toStdString().c_str()) == false))
-  {
-    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                              QObject::tr("HOM_CASE_DIRECTORY_2") );
-    return false;
+  if ( aDirName != _aDirName)
+  { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ;
+    if ( CaseNameDir != "" )
+    {
+      INFOS(CaseNameDir.toStdString().c_str());
+      QString texte ;
+      texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ;
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                texte );
+      return false;
+    }
   }
   if (chdir(aDirName.toStdString().c_str()) != 0)
   {
index 90225544a7574df286e640c34ebaaed4f4d16862..e0277bf5ef7535b12456a69740919cefcd46db4f 100644 (file)
@@ -101,11 +101,17 @@ bool MonMeshInfo::PushOnApply()
                               QObject::tr("HOM_CASE_DIRECTORY_1") );
     return false;
   }
-  if ((aDirName != _aDirName) and (myHomardGen->VerifieDir( aDirName.toStdString().c_str()) == false))
-  {
-    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                              QObject::tr("HOM_CASE_DIRECTORY_2") );
-    return false;
+  if ( aDirName != _aDirName)
+  { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ;
+    if ( CaseNameDir != "" )
+    {
+      INFOS(CaseNameDir.toStdString().c_str());
+      QString texte ;
+      texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ;
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                texte );
+      return false;
+    }
   }
   if (chdir(aDirName.toStdString().c_str()) != 0)
   {
index 357f93bfaa5d626cf699a1ca5a3f6bd9f59d76d5..91c7ac02ddd5f68d63c57d75a1f5d151d150a30a 100644 (file)
@@ -94,11 +94,17 @@ bool MonPursueIteration::PushOnApply()
                               QObject::tr("HOM_CASE_DIRECTORY_1") );
     return false;
   }
-  if ((aDirName != _aDirName) and (myHomardGen->VerifieDir( aDirName.toStdString().c_str()) == false))
-  {
-    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                              QObject::tr("HOM_CASE_DIRECTORY_2") );
-    return false;
+  if ( aDirName != _aDirName)
+  { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ;
+    if ( CaseNameDir != "" )
+    {
+      INFOS(CaseNameDir.toStdString().c_str());
+      QString texte ;
+      texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ;
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                texte );
+      return false;
+    }
   }
   if (chdir(aDirName.toStdString().c_str()) != 0)
   {
index 55645cf05050d195ec0babc884b32e154862b09d..344bf2ae26d6b3e687428bd5154d7f37a605d3be 100755 (executable)
@@ -4666,15 +4666,20 @@ void HOMARD_Gen_i::IsValidStudy( )
 }
 
 //=============================================================================
-CORBA::Boolean HOMARD_Gen_i::VerifieDir(const char* nomDir)
+char* HOMARD_Gen_i::VerifieDir(const char* nomDir)
 {
+  std::string casename = std::string("") ;
   std::map<std::string, HOMARD::HOMARD_Cas_var>::const_iterator it;
   for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin();
   it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++)
   {
-   if (std::string(nomDir) == std::string(it->second->GetDirName())) return false;
+   if (std::string(nomDir) == std::string(it->second->GetDirName()))
+   {
+     casename = std::string(it->second->GetName()) ;
+     break ;
+   }
   }
-  return true;
+  return CORBA::string_dup( casename.c_str() );
 }
 /*//=============================================================================
 void SALOMEException( std::string message )
index 53ee8a0d12b8569fc68ec61a05a589f19b0533d4..edfd2e9c51fc76fea636da02dac1038a0282c0fd 100644 (file)
@@ -178,7 +178,7 @@ public:
   void                            DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver);
   void                            DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver);
 
-  CORBA::Boolean                  VerifieDir(const char* nomDir);
+  char*                           VerifieDir(const char* nomDir);
 
   void                            PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire);
   void                            PublishFileUnderYACS(const char* NomYACS, const char* NomFich, const char* Commentaire);