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);
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();
}