From 3d988273687068a34cd617d830b44a403b4d44be Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 22 Oct 2013 15:48:09 +0000 Subject: [PATCH] =?utf8?q?Message=20d'erreur=20en=20cas=20de=20mauvais=20r?= =?utf8?q?=C3=83=C2=A9pertoire=20pour=20le=20cas=20en=20GUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/HOMARDGUI/HOMARD_msg_en.ts | 2 +- src/HOMARDGUI/HOMARD_msg_fr.ts | 2 +- src/HOMARDGUI/HOMARD_msg_ja.ts | 2 +- src/HOMARDGUI/MonCreateCase.cxx | 17 ++++++++++++----- src/HOMARDGUI/MonCreateYACS.cxx | 16 +++++++++++----- src/HOMARDGUI/MonMeshInfo.cxx | 16 +++++++++++----- src/HOMARDGUI/MonPursueIteration.cxx | 16 +++++++++++----- src/HOMARD_I/HOMARD_Gen_i.cxx | 11 ++++++++--- src/HOMARD_I/HOMARD_Gen_i.hxx | 2 +- 9 files changed, 57 insertions(+), 27 deletions(-) diff --git a/src/HOMARDGUI/HOMARD_msg_en.ts b/src/HOMARDGUI/HOMARD_msg_en.ts index ffeb40f1..77a85cf7 100644 --- a/src/HOMARDGUI/HOMARD_msg_en.ts +++ b/src/HOMARDGUI/HOMARD_msg_en.ts @@ -197,7 +197,7 @@ HOM_CASE_DIRECTORY_2 - This directory is already used. + This directory is already used by the case HOM_CASE_DIRECTORY_3 diff --git a/src/HOMARDGUI/HOMARD_msg_fr.ts b/src/HOMARDGUI/HOMARD_msg_fr.ts index 22476ea7..bc77a083 100644 --- a/src/HOMARDGUI/HOMARD_msg_fr.ts +++ b/src/HOMARDGUI/HOMARD_msg_fr.ts @@ -253,7 +253,7 @@ HOM_CASE_DIRECTORY_2 - Ce répertoire est déjà utilisé. + Ce répertoire est déjà utilisé par le cas HOM_CASE_DIRECTORY_3 diff --git a/src/HOMARDGUI/HOMARD_msg_ja.ts b/src/HOMARDGUI/HOMARD_msg_ja.ts index 73a66509..00977b95 100644 --- a/src/HOMARDGUI/HOMARD_msg_ja.ts +++ b/src/HOMARDGUI/HOMARD_msg_ja.ts @@ -253,7 +253,7 @@ HOM_CASE_DIRECTORY_2 - This directory is already used. + This directory is already used by the case HOM_CASE_DIRECTORY_3 diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index 7f1137ef..ee6430b7 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -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) { diff --git a/src/HOMARDGUI/MonCreateYACS.cxx b/src/HOMARDGUI/MonCreateYACS.cxx index bff7b2b8..cd9bafc3 100644 --- a/src/HOMARDGUI/MonCreateYACS.cxx +++ b/src/HOMARDGUI/MonCreateYACS.cxx @@ -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) { diff --git a/src/HOMARDGUI/MonMeshInfo.cxx b/src/HOMARDGUI/MonMeshInfo.cxx index 90225544..e0277bf5 100644 --- a/src/HOMARDGUI/MonMeshInfo.cxx +++ b/src/HOMARDGUI/MonMeshInfo.cxx @@ -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) { diff --git a/src/HOMARDGUI/MonPursueIteration.cxx b/src/HOMARDGUI/MonPursueIteration.cxx index 357f93bf..91c7ac02 100644 --- a/src/HOMARDGUI/MonPursueIteration.cxx +++ b/src/HOMARDGUI/MonPursueIteration.cxx @@ -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) { diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 55645cf0..344bf2ae 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -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::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 ) diff --git a/src/HOMARD_I/HOMARD_Gen_i.hxx b/src/HOMARD_I/HOMARD_Gen_i.hxx index 53ee8a0d..edfd2e9c 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.hxx +++ b/src/HOMARD_I/HOMARD_Gen_i.hxx @@ -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); -- 2.39.2