From 6e4fe7e7e6c0af73c1e8c3c22bc9d92f87737431 Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 26 Nov 2013 15:57:08 +0000 Subject: [PATCH] =?utf8?q?Oubli=20dans=20la=20s=C3=83=C2=A9lection=20du=20?= =?utf8?q?r=C3=83=C2=A9pertoire=20pour=20la=20poursuite?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- resources/SalomeApp.xml.in | 8 ++++--- src/HOMARDGUI/HOMARDGUI.cxx | 2 +- src/HOMARDGUI/HOMARD_msg_en.ts | 8 +++++++ src/HOMARDGUI/HOMARD_msg_fr.ts | 8 +++++++ src/HOMARDGUI/HOMARD_msg_ja.ts | 8 +++++++ src/HOMARDGUI/MonCreateCase.cxx | 4 ++-- src/HOMARDGUI/MonCreateCase.h | 2 +- src/HOMARDGUI/MonPursueIteration.cxx | 35 +++++++++++++++++++++++----- src/HOMARDGUI/MonPursueIteration.h | 2 +- 9 files changed, 63 insertions(+), 14 deletions(-) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 17159b89..a4b35d57 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -32,9 +32,11 @@
- - - + + + + +
diff --git a/src/HOMARDGUI/HOMARDGUI.cxx b/src/HOMARDGUI/HOMARDGUI.cxx index ca1d082e..4ea5c5b6 100644 --- a/src/HOMARDGUI/HOMARDGUI.cxx +++ b/src/HOMARDGUI/HOMARDGUI.cxx @@ -286,7 +286,7 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) case 1102: // Poursuite d une iteration { MESSAGE("command " << theCommandID << " activated"); - MonPursueIteration *aDlg = new MonPursueIteration( parent, true, + MonPursueIteration *aDlg = new MonPursueIteration( true, HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; aDlg->show(); break; diff --git a/src/HOMARDGUI/HOMARD_msg_en.ts b/src/HOMARDGUI/HOMARD_msg_en.ts index 77a85cf7..8386a721 100644 --- a/src/HOMARDGUI/HOMARD_msg_en.ts +++ b/src/HOMARDGUI/HOMARD_msg_en.ts @@ -207,6 +207,14 @@ HOM_CASE_DIRECTORY_4 A directory for the computation must be selected. + + HOM_START_DIRECTORY_1 + A starting directory for the pursuit must be selected. + + + HOM_START_DIRECTORY_3 + A valid directory for the pursuit must be selected. + HOM_CASE_MESH The file of the initial mesh must be selected. diff --git a/src/HOMARDGUI/HOMARD_msg_fr.ts b/src/HOMARDGUI/HOMARD_msg_fr.ts index bc77a083..db8348bc 100644 --- a/src/HOMARDGUI/HOMARD_msg_fr.ts +++ b/src/HOMARDGUI/HOMARD_msg_fr.ts @@ -263,6 +263,14 @@ HOM_CASE_DIRECTORY_4 Il faut choisir un répertoire de travail pour le calcul. + + HOM_START_DIRECTORY_1 + Il faut choisir un répertoire contenant l'itération à poursuivre. + + + HOM_START_DIRECTORY_3 + Un répertoire valide contenant l'itération à poursuivre doit être choisi. + HOM_CASE_MESH Il faut choisir le maillage initial. diff --git a/src/HOMARDGUI/HOMARD_msg_ja.ts b/src/HOMARDGUI/HOMARD_msg_ja.ts index 5a713968..e6cd5f21 100644 --- a/src/HOMARDGUI/HOMARD_msg_ja.ts +++ b/src/HOMARDGUI/HOMARD_msg_ja.ts @@ -207,6 +207,14 @@ HOM_CASE_DIRECTORY_4 HOM_CASE_DIRECTORY_4 + + HOM_START_DIRECTORY_1 + A starting directory for the pursuit must be selected. + + + HOM_START_DIRECTORY_3 + A valid directory for the pursuit must be selected. + HOM_CASE_MESH 1 つは、初期のメッシュを選択する必要があります。 diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index a38e9d85..4738ba34 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -43,7 +43,7 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0) +MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) : Ui_CreateCase(), _aCaseName(""),_aDirName(""), @@ -171,7 +171,7 @@ bool MonCreateCase::PushOnApply() } #ifndef WIN32 if (chdir(aDirName.toStdString().c_str()) != 0) -#else +#else if (_chdir(aDirName.toStdString().c_str()) != 0) #endif { diff --git a/src/HOMARDGUI/MonCreateCase.h b/src/HOMARDGUI/MonCreateCase.h index 7f3d173c..cf2bb6d9 100644 --- a/src/HOMARDGUI/MonCreateCase.h +++ b/src/HOMARDGUI/MonCreateCase.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonCreateCase : public QDialog, public Ui_CreateCase Q_OBJECT public: - MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen); + MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen ); ~MonCreateCase(); void AddBoundaryAn(QString newBoundary); diff --git a/src/HOMARDGUI/MonPursueIteration.cxx b/src/HOMARDGUI/MonPursueIteration.cxx index feb96985..6d98b287 100644 --- a/src/HOMARDGUI/MonPursueIteration.cxx +++ b/src/HOMARDGUI/MonPursueIteration.cxx @@ -38,13 +38,13 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonPursueIteration::MonPursueIteration (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen) +MonPursueIteration::MonPursueIteration ( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) : Ui_PursueIteration(), _aCaseName(""), _aDirName(""), _aDirNameStart("") { MESSAGE("Debut du constructeur de MonPursueIteration"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); @@ -69,7 +69,6 @@ MonPursueIteration::~MonPursueIteration() void MonPursueIteration::InitConnect() // ------------------------------------------------------------------------ { - connect( LECaseName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); connect( RBIteration, SIGNAL(clicked()), this, SLOT(FromIteration())); @@ -89,7 +88,7 @@ bool MonPursueIteration::PushOnApply() // -------------------------------- { MESSAGE("PushOnApply"); - +// 1. Enregistrement du repertoire du cas QString aDirName=LEDirName->text().trimmed(); if (aDirName == QString("")) { @@ -118,14 +117,35 @@ bool MonPursueIteration::PushOnApply() QObject::tr("HOM_CASE_DIRECTORY_3") ); return false; } +// 2. Enregistrement du repertoire de depart + QString aDirNameStart=LEDirNameStart->text().trimmed(); + if (aDirNameStart == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_START_DIRECTORY_1") ); + return false; + } +#ifndef WIN32 + if (chdir(aDirNameStart.toStdString().c_str()) != 0) +#else + if (_chdir(aDirNameStart.toStdString().c_str()) != 0) +#endif + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_START_DIRECTORY_3") ); + return false; + } -// Enregistrement du numero d'iteration +// 3. Enregistrement du numero d'iteration int Number ; if ( _Type == 3 ) { Number = spinBoxNumber->value() ; } -// Creation du cas +// 4. Creation du cas QString _aCaseName=LECaseName->text().trimmed(); + _aDirNameStart=aDirNameStart; + MESSAGE("_aCaseName = "<<_aCaseName.toStdString().c_str()); + MESSAGE("_aDirNameStart = "<<_aDirNameStart.toStdString().c_str()); MESSAGE("_Type = "<<_Type); switch (_Type) { @@ -183,6 +203,9 @@ bool MonPursueIteration::PushOnApply() } } + aCase->SetDirName(aDirName.toStdString().c_str()); + _aDirName=aDirName; + HOMARD_UTILS::updateObjBrowser(); return true; diff --git a/src/HOMARDGUI/MonPursueIteration.h b/src/HOMARDGUI/MonPursueIteration.h index 37480de2..a6c5d7d9 100644 --- a/src/HOMARDGUI/MonPursueIteration.h +++ b/src/HOMARDGUI/MonPursueIteration.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIterati Q_OBJECT public: - MonPursueIteration( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen); + MonPursueIteration( bool modal, HOMARD::HOMARD_Gen_var myHomardGen ); virtual ~MonPursueIteration(); protected : -- 2.39.2