Salome HOME
Fix Bug IPAL8770: There is no any warning message if to export polygonal elements...
authorenk <enk@opencascade.com>
Wed, 22 Jun 2005 06:45:14 +0000 (06:45 +0000)
committerenk <enk@opencascade.com>
Wed, 22 Jun 2005 06:45:14 +0000 (06:45 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESH_msg_en.po

index 21602a0..2c49e21 100644 (file)
@@ -307,9 +307,26 @@ namespace{
            SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
            fd->setCaption( aTitle );
            fd->setFilters( filters );
-           fd->exec();
-           aFilename = fd->selectedFile();
-           aFormat = aFilterMap[fd->selectedFilter()];
+           bool is_ok = false;
+           while(!is_ok){
+             fd->exec();
+             aFilename = fd->selectedFile();
+             aFormat = aFilterMap[fd->selectedFilter()];
+             is_ok = true;
+             if( !aFilename.isEmpty()
+                 && (aMesh->NbPolygons()>0 or aMesh->NbPolyhedrons()>0) 
+                 && aFormat==SMESH::MED_V2_1){
+               int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(),
+                                                 QObject::tr("SMESH_WRN_WARNING"),
+                                                 QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()),
+                                                 QObject::tr("SMESH_BUT_YES"),
+                                                 QObject::tr("SMESH_BUT_NO"),
+                                                 0,1,0);
+               if(aRet){
+                 is_ok = false;
+               }
+             }
+           }
            delete fd;
          }
        if ( !aFilename.isEmpty() ) {
index b49bf9f..175fbdf 100644 (file)
@@ -1210,6 +1210,12 @@ msgid "SMESH_EXPORT_UNV"
 msgstr "During export mesh with name - \"%1\" to UNV\n"
        "       pyramid's elements will be missed"
 
+msgid "SMESH_EXPORT_MED_V2_1"
+msgstr "During export mesh with name - \"%1\" to MED 2.1\n"
+       "polygons and polyhedrons elements will be missed\n"
+       "For correct export use MED 2.2\n"
+       "Are you sure want to export to MED 2.1 ?"
+
 msgid "INF_SELECT_OBJECT"
 msgstr "Select an object"