Salome HOME
LCM // Import/Export of SHP p.3
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_LandCoverMapDlg.cxx
index 0c9646378ae81b2c8231eb181e9d47127b9e547a..9c57ed8665208e78446d17ce7de922ca63bacc23 100644 (file)
@@ -74,9 +74,12 @@ HYDROGUI_LandCoverMapDlg::HYDROGUI_LandCoverMapDlg( HYDROGUI_Module* theModule,
 
   addStretch();
 
+  // Connect signals and slots
+  connect( myObjectNameEdit, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onLandCoverMapChanged() ) );
   connect( myPolylinesFaces, SIGNAL( objectSelected( const QString& ) ), this, SLOT( onPolylineFaceChanged( const QString& ) ) );
 
   updateState( true );
+
 }
 
 HYDROGUI_LandCoverMapDlg::~HYDROGUI_LandCoverMapDlg()
@@ -153,6 +156,16 @@ bool HYDROGUI_LandCoverMapDlg::isOk( const Handle(HYDROData_Entity)& theEntity )
                                         myOperationId == SplitLandCoverId ) ) );
 }
 
+void HYDROGUI_LandCoverMapDlg::onLandCoverMapChanged()
+{
+  if ( signalsBlocked() )
+    return;
+
+  reset();
+
+  emit landCoverMapChanged( getObjectName() );
+}
+
 void HYDROGUI_LandCoverMapDlg::onPolylineFaceChanged( const QString& )
 {
   updateState();
@@ -189,5 +202,9 @@ void HYDROGUI_LandCoverMapDlg::updateState( bool theInitialConfigure )
       anEmptyPolylineFaceName = getPolylineFaceName().isEmpty();
 
     setApplyEnabled( !anEmptyObjectName && !anEmptyPolylineFaceName );
+
+    // TODO:
+    //if ( myOperationId == RemoveLandCoverId || myOperationId == MergeLandCoverId ) => enable Apply,
+    //Apply and Close buttons only if at least one face (land cover) is selected in the 3d viewer
   }
 }