// Include/Exclude buttons
QFrame* aBtnsFrame = new QFrame( myPolylineFrame );
QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
- aBtnsLayout->setMargin( 5 );
+ aBtnsLayout->setMargin( 0 );
aBtnsLayout->setSpacing( 5 );
aBtnsFrame->setLayout( aBtnsLayout );
QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
aBtnsLayout->addStretch( 1 );
QGridLayout* aPolyLayout = new QGridLayout( myPolylineFrame );
- aPolyLayout->setMargin( 5 );
- aPolyLayout->setSpacing( 5 );
+ aPolyLayout->setMargin( 0 );
+ aPolyLayout->setSpacing( 10 );
aPolyLayout->addWidget( new QLabel( tr( "LAND_COVER_POLYLINES" ), myPolylineFrame ), 0, 0, 1, 2 );
aPolyLayout->addWidget( aBtnsFrame, 1, 0, 1, 1 );
aPolyLayout->addWidget( myPolylines, 1, 1, 1, 1 );
onZoneDefChanged();
}
-void HYDROGUI_LandCoverDlg::includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
+bool HYDROGUI_LandCoverDlg::includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
{
QStringList anIncludedPolylinesNames = myPolylines->getAllNames();
+ bool aSetOfPolylinesChanged = false;
foreach ( const HYDROGUI_ListModel::Object2Visible& aSelectedPolyline, theSelectedPolylines )
{
if ( !anIncludedPolylinesNames.contains( aSelectedPolyline.first->GetName() ) )
+ {
myPolylines->addObject( aSelectedPolyline );
+ aSetOfPolylinesChanged = true;
+ }
}
myPolylines->setOrderingEnabled( myPolylines->getObjects().count() > 1 );
+
+ return aSetOfPolylinesChanged;
}
-void HYDROGUI_LandCoverDlg::excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
+bool HYDROGUI_LandCoverDlg::excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
{
+ bool aSetOfPolylinesChanged = !theSelectedPolylines.isEmpty();
+
foreach ( const HYDROGUI_ListModel::Object2Visible& aSelectedPolyline, theSelectedPolylines )
myPolylines->removeObjectByName( aSelectedPolyline.first->GetName() );
myPolylines->setOrderingEnabled( myPolylines->getObjects().count() > 1 );
+
+ return aSetOfPolylinesChanged;
}
QStringList HYDROGUI_LandCoverDlg::getPolylineNames() const