Salome HOME
Merge branch 'BR_v14_rc' of ssh://git.salome-platform.org/modules/hydro into BR_v14_rc
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportLandCoverOp.cxx
index ef7756b15720b2be003a86871067a96a3eca9395..bc49f7efc7b6bc6ea51b08689e841f0494c7af17 100644 (file)
@@ -215,18 +215,17 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected()
     TopTools_SequenceOfShape aFaces;
     HYDROData_ShapeFile anImporter;
 
-    if (anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces))
-    {
-      aPanel->setPolygonNames(aPolygonsList);
+    SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
+    if ( !aStudy )
+      return;
 
-      SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
-      if ( !aStudy ) {
-        return;
-      }
+    erasePreview();
 
-      erasePreview();
+    Handle(AIS_InteractiveContext) aCtx = NULL;
 
-      Handle(AIS_InteractiveContext) aCtx = NULL;
+    if (anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces))
+    {
+      aPanel->setPolygonNames(aPolygonsList);
 
       LightApp_Application* anApp = module()->getApp();
       if ( !getPreviewManager() )
@@ -273,10 +272,13 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected()
     }
     else
     {
-      SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), "Cannot import land cover;\nThe shape type is not polygon" );
-        
+      erasePreview();
+      aPanel->setPolygonNames(QStringList());
+      aPanel->setObjectName("");
       QApplication::restoreOverrideCursor();
-      abort();
+      SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), "Cannot import land cover;\nThe shape type is not polygon" );
+      commitDocOperation();
+      //abort();
     }
     anImporter.Free();