Salome HOME
Updated copyright comment
[modules/homard.git] / src / HOMARDGUI / MonEditBoundaryDi.cxx
index cae08250d351d9d5530b5e3a4ce703e22b88c404..b9082ef679b4d2b1437ff82e9fe422644dc0d285 100644 (file)
@@ -1,4 +1,21 @@
-using namespace std;
+// 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include "MonEditBoundaryDi.h"
 #include "MonEditListGroup.h"
@@ -10,34 +27,34 @@ using namespace std;
 #include "HomardQtCommun.h"
 #include <utilities.h>
 
+using namespace std;
 
 // -------------------------------------------------------------------------------------------------------------------------------------
 MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal,
                                       HOMARD::HOMARD_Gen_var myHomardGen,
-                                      QString caseName, QString BoundaryName):
+                                      QString caseName, QString Name):
 // -------------------------------------------------------------------------------------------------------------------------------------
 /* Constructs a MonEditBoundaryDi
     herite de MonCreateBoundaryDi
 */
-    MonCreateBoundaryDi(parent, modal, myHomardGen, caseName, BoundaryName)
+    MonCreateBoundaryDi(parent, modal, myHomardGen, caseName, Name)
 {
-    MESSAGE("Debut de Boundary pour " << BoundaryName.toStdString().c_str());
-    setWindowTitle("Edit BoundaryDi");
+    MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str());
+    setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE"));
     try
     {
-     _aBoundary=_myHomardGen->GetBoundary(CORBA::string_dup(_aBoundaryName.toStdString().c_str()));
-     if (caseName==QString("")) { _aCaseName=_aBoundary->GetCaseCreation();}
+     aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str()));
+     if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();}
      InitValEdit();
     }
     catch( SALOME::SALOME_Exception& S_ex )
     {
-        QMessageBox::information( 0, "Error",
-                  QString(CORBA::string_dup(S_ex.details.text)),
-                  QMessageBox::Ok + QMessageBox::Default );
-        return;
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                QObject::tr(CORBA::string_dup(S_ex.details.text)) );
+      return;
     }
 
-    HOMARD::ListGroupType_var maListe = _aBoundary->GetGroups();
+    HOMARD::ListGroupType_var maListe = aBoundary->GetGroups();
     for ( int i = 0; i < maListe->length(); i++ )
        _listeGroupesBoundary << QString(maListe[i]);
 
@@ -47,18 +64,18 @@ MonEditBoundaryDi::~MonEditBoundaryDi()
 // ------------------------------
 {
 }
-
 // ------------------------------
 void MonEditBoundaryDi::InitValEdit()
 // ------------------------------
 {
-      LEBoundaryName->setText(_aBoundaryName);
-      LEBoundaryName->setReadOnly(true);
+      LEName->setText(_aName);
+      LEName->setReadOnly(true);
 
-      QString aMeshFile = _aBoundary->GetMeshFile();
-      LEFileName->setText(aMeshFile);
+      QString aDataFile = aBoundary->GetDataFile();
+      LEFileName->setText(aDataFile);
       LEFileName->setReadOnly(1);
       PushFichier->setVisible(0);
+//
       adjustSize();
 }
 // ------------------------------
@@ -71,19 +88,18 @@ bool MonEditBoundaryDi::PushOnApply()
 void MonEditBoundaryDi::SetFiltrage()
 // // ------------------------------------------------------------------------
 {
-   if (!CBGroupe->isChecked()) return;
-   if (_aCaseName.toStdString().c_str() == QString()) 
-   {
-        QMessageBox::information( 0, "Error",
-                              "Case MeshFile unknowned.",
-                              QMessageBox::Ok + QMessageBox::Default );
-        return;
-   }
-   HOMARD::HOMARD_Cas_var monCas= _myHomardGen->GetCas(_aCaseName.toStdString().c_str());
-   HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups();
+  if (!CBGroupe->isChecked()) return;
+  if (_aCaseName.toStdString().c_str() == QString())
+  {
+    QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                              QObject::tr("HOM_BOUN_CASE") );
+    return;
+  }
+  HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str());
+  HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups();
 
-   MonEditListGroup *aDlg = new MonEditListGroup(NULL,this,  TRUE, HOMARD::HOMARD_Gen::_duplicate(_myHomardGen),
-                              _aCaseName, _listeGroupesBoundary) ;
-   aDlg->show();
+  MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),
+                            _aCaseName, _listeGroupesBoundary) ;
+  aDlg->show();
 }