Salome HOME
refs #640: correct width for non-georeferenced profile
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportLandCoverOp.cxx
index bc49f7efc7b6bc6ea51b08689e841f0494c7af17..6b026e90349e3693d935514f2b18808b5a64e80a 100644 (file)
@@ -222,8 +222,9 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected()
     erasePreview();
 
     Handle(AIS_InteractiveContext) aCtx = NULL;
-
-    if (anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces))
+    int aShapeTypeOfFile = -1;
+    int aStat = anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces, aShapeTypeOfFile);
+    if (aStat == 1)
     {
       aPanel->setPolygonNames(aPolygonsList);
 
@@ -276,7 +277,14 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected()
       aPanel->setPolygonNames(QStringList());
       aPanel->setObjectName("");
       QApplication::restoreOverrideCursor();
-      SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), "Cannot import land cover;\nThe shape type is not polygon" );
+      QString aMess = "Cannot import land cover;\n";
+      if (aStat == -1)
+        aMess += "Cannot open SHP file";
+      else if (aStat == -2)
+        aMess += "Cannot open SHX file";
+      else 
+        aMess += "The shape type of file is " + anImporter.GetShapeTypeName(aShapeTypeOfFile);
+      SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), aMess);
       commitDocOperation();
       //abort();
     }