Salome HOME
Copyright update 2022
[modules/homard.git] / src / HOMARDGUI / MonIterInfo.cxx
index ded85a6a9ca5a43608f71ca75db28c85fee2c1f4..5e8612b210f3c8c710cff71bdb3107bfea543fe1 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2022  CEA/DEN, EDF R&D
 //
 // 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 "MonIterInfo.h"
 
 #include <QFile>
@@ -29,11 +27,13 @@ using namespace std;
 #include "SalomeApp_Tools.h"
 #include "HOMARDGUI_Utils.h"
 #include "HomardQtCommun.h"
+#include "MonEditFile.h"
 #include <utilities.h>
 
+using namespace std;
 
 // -----------------------------------------------------------------------------------------
-MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString IterName)
+MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString IterName)
 // -----------------------------------------------------------------------------------------
 /* Constructs a MonIterInfo
  * Inherits from CasHomard
@@ -51,7 +51,7 @@ MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myH
     _Option(-1)
 {
     MESSAGE("appel de _duplicate");
-      _myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+      myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
       setupUi(this);
       setModal(modal);
       InitConnect();
@@ -88,7 +88,7 @@ bool MonIterInfo::PushOnApply()
   MESSAGE("PushOnApply");
 
   // Au moins une option a ete choisie
-  if ( ( _Quality == 0 ) and ( _Diametre == 0 ) and ( _Connection == 0 ) and ( _BlockSize == 0 ) and ( _Entanglement == 0 ) )
+  if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) )
   {
     QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
                               QObject::tr("HOM_MESH_INFO_1") );
@@ -96,7 +96,7 @@ bool MonIterInfo::PushOnApply()
   }
 
   // Recuperation de l'iteration
-  aIter = _myHomardGen->GetIteration(_IterName.toStdString().c_str()) ;
+  aIter = myHomardGen->GetIteration(_IterName.toStdString().c_str()) ;
 
   // Lancement de l'analyse
   try
@@ -112,31 +112,9 @@ bool MonIterInfo::PushOnApply()
 
   // Le bilan de l'analyse a afficher
   QString aFileName = aIter->GetFileInfo() ;
-// // Creation de l'objet fichier QT associe
-//   QFile file( aFileName );
-// // Ouverture
-//   bool bOpen = file.open( QIODevice::ReadOnly | QIODevice::Text ) ;
-// //
-//   if ( bOpen )
-//   {
-//      Ui_EditFile() ;
-// // Lecture
-// //    Remarque : il serait plus clair de tout lire d'un coup mais cela ne marche pas !
-// //               alors on fait ligne par ligne et on cumule en ajoutant un saut de ligne.
-//       QTextStream stream( &file );
-//       QString tout;
-//       while ( !stream.atEnd() )
-//       {
-//         tout = tout + stream.readLine() + "\n" ;
-//       }
-//       QTBEditFile->setPlainText( tout );
-//   QMessageBox::information( 0, QObject::tr("HOM_MESH_INFO_0"),
-//                                tout );
-//   }
+  MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), aFileName, 0 ) ;
+  if ( aDlg->_codret == 0 ) { aDlg->show(); }
 
-  // Message simple en attendant de savoir faire
-  QMessageBox::information( 0, QObject::tr("HOM_MESH_INFO_0"),
-                               QObject::tr("HOM_MESH_INFO_2")+aFileName );
 
   HOMARD_UTILS::updateObjBrowser();
   return true;
@@ -152,7 +130,8 @@ void MonIterInfo::PushOnOK()
 void MonIterInfo::PushOnHelp()
 //-------------------------------
 {
-  HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"));
+  std::string LanguageShort = myHomardGen->GetLanguageShort();
+  HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort.c_str()));
 }
 // ------------------------------------------------------------------------
 void MonIterInfo::SetBlockSize()