Salome HOME
Updated copyright comment
[modules/homard.git] / src / HOMARDGUI / MonCreateIteration.cxx
index ba7ece292530f34a8ff24d5909902b74cbb373ed..c2fe2b0345f58bb0900756a152feabed163bb25e 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2024  CEA, EDF
 //
 // 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
@@ -17,8 +17,6 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-using namespace std;
-
 #include "MonCreateIteration.h"
 #include "MonCreateHypothesis.h"
 #include "MonEditHypothesis.h"
@@ -31,6 +29,8 @@ using namespace std;
 #include "HomardQtCommun.h"
 #include <utilities.h>
 
+using namespace std;
+
 // -----------------------------------------------------------------------------------------------------
 MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal,
                                        HOMARD::HOMARD_Gen_var myHomardGen0, QString IterParentName ):
@@ -39,7 +39,7 @@ MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal,
  * Inherits from CasHomard
  * Sets attributes to default values
  */
-    QDialog(0),
+    QScrollArea(0),
     Ui_CreateIteration(),
     _Name(""),
     _IterParentName(IterParentName),
@@ -48,16 +48,17 @@ MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal,
       MESSAGE("Constructeur");
       myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
       setupUi(this);
-      setModal(modal);
+      if ( modal ) { setWindowModality(Qt::WindowModal); }
+      else         { setWindowModality(Qt::NonModal); }
       InitConnect();
 
       SetNewName();
       GetHypotheses();
-      if (_IterParentName != QString(""))
-         { SetIterParentName(); }
-      else
-         {setModal(false); /* permet selection de l iteration dans l arbre d etude */}
+      if (_IterParentName != QString("")) { SetIterParentName(); }
+      else                                { setWindowModality(Qt::NonModal) ; /* permet selection de l'iteration dans l arbre d etude */}
       SetTSNo();
+//
+      adjustSize();
     }
 // ------------------------------------------------------------------------
 MonCreateIteration::~MonCreateIteration()
@@ -97,7 +98,7 @@ bool MonCreateIteration::PushOnApply()
 // ------------------------------------------------------------------------
 // Appele lorsque l'un des boutons Ok ou Apply est presse
 {
-  MESSAGE("MonCreateIteration::PushOnApply");
+  MESSAGE("PushOnApply");
 //
   QString aName = LEName->text().trimmed();
   if ( aName == QString (""))
@@ -130,7 +131,7 @@ bool MonCreateIteration::PushOnApply()
   HOMARD::HOMARD_Hypothesis_var _myHypothesis = myHomardGen->GetHypothesis(monHypoName.toStdString().c_str());
   HOMARD::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef());
   int TypeAdap = ListTypes[0];
-  if ( TypeAdap == 1 and LEFieldFile->text().trimmed() == QString("") )
+  if ( TypeAdap == 1 && LEFieldFile->text().trimmed() == QString("") )
   {
     QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
                               QObject::tr("HOM_ITER_FIELD_FILE") );
@@ -189,7 +190,8 @@ void MonCreateIteration::PushOnOK()
 void MonCreateIteration::PushOnHelp()
 // ------------------------------------------------------------------------
 {
-  HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""));
+  std::string LanguageShort = myHomardGen->GetLanguageShort();
+  HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort.c_str()));
 }
 // ------------------------------------------------------------------------
 void MonCreateIteration::SetIterParentName()
@@ -226,9 +228,9 @@ void MonCreateIteration::SetNewName()
     {
       if ( aName ==  QString((MyObjects)[i]))
       {
-          num=num+1;
-          aName="";
-          break;
+        num ++ ;
+        aName = "" ;
+        break ;
       }
    }
   }
@@ -247,7 +249,7 @@ void MonCreateIteration::PushHypoEdit()
     return;
   }
   QString aFieldFile=LEFieldFile->text().trimmed();
-  MonEditHypothesis *HypoDlg = new MonEditHypothesis(this,TRUE, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),CBHypothese->currentText(), _CaseName, aFieldFile) ;
+  MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),CBHypothese->currentText(), _CaseName, aFieldFile) ;
   HypoDlg->show();
 }
 
@@ -275,7 +277,7 @@ void MonCreateIteration::PushHypoNew()
     _CaseName = aIterParent->GetCaseName();
   }
   QString aFieldFile=LEFieldFile->text().trimmed();
-  MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this,TRUE,HOMARD::HOMARD_Gen::_duplicate(myHomardGen),QString(""),_CaseName, aFieldFile) ;
+  MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), QString(""), _CaseName, aFieldFile) ;
   HypoDlg->show();
 }
 // ------------------------------------------------------------------------
@@ -283,7 +285,7 @@ void MonCreateIteration::SetFieldFile()
 // ------------------------------------------------------------------------
 {
   QString fileName0 = LEFieldFile->text().trimmed();
-  QString fileName = HOMARD_QT_COMMUN::PushNomFichier(false);
+  QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ;
   if (fileName.isEmpty()) fileName = fileName0 ;
   LEFieldFile->setText(fileName);
   raise();
@@ -301,7 +303,7 @@ void MonCreateIteration::SetTSNo()
   TimeStep->setVisible(0);
   SpinBox_TimeStep->setVisible(0);
   SpinBox_TimeStep->setValue(-1);
-
+//
   adjustSize();
 }
 // ------------------------------------------------------------------------
@@ -316,7 +318,7 @@ void MonCreateIteration::SetTSLast()
   TimeStep->setVisible(0);
   SpinBox_TimeStep->setVisible(0);
   SpinBox_TimeStep->setValue(-2);
-
+//
   adjustSize();
 }
 // ------------------------------------------------------------------------
@@ -331,7 +333,7 @@ void MonCreateIteration::SetTSChosen()
   TimeStep->setVisible(1);
   SpinBox_TimeStep->setVisible(1);
   SpinBox_TimeStep->setValue(0);
-
+//
   adjustSize();
 }