Salome HOME
Fix for the bug #45: check and warning when the same image is used in 2 arguments.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportBathymetryOp.cxx
index 8fb9c815ab706ad2d6ba76311fe57dc763f5ca54..b32945abbdb2d75092c2ee4d57ded93725fb5d0e 100644 (file)
@@ -176,7 +176,7 @@ bool HYDROGUI_ImportBathymetryOp::processApply( int& theUpdateFlags,
     module()->setObjectVisible( (size_t)aVTKMgr->getViewModel(), aBathymetryObj, true );
   }
 
-  theUpdateFlags = UF_Model | UF_VTKViewer | UF_VTK_Forced;
+  theUpdateFlags = UF_Model | UF_FitAll | UF_VTKViewer | UF_VTK_Init | UF_VTK_Forced;
   return true;
 }
 
@@ -190,7 +190,14 @@ void HYDROGUI_ImportBathymetryOp::onFileSelected()
   QString anObjectName = aPanel->getObjectName().simplified();
   if ( anObjectName.isEmpty() )
   {
-    anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_BATHYMETRY_NAME" ) );
+    anObjectName = aPanel->getFileName();
+    if ( !anObjectName.isEmpty() ) {
+        anObjectName = QFileInfo( anObjectName ).baseName();
+    }
+
+    if ( anObjectName.isEmpty() ) {
+      anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_BATHYMETRY_NAME" ) );
+    }
     aPanel->setObjectName( anObjectName );
   }
 }