#include <QPushButton>
CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent, bool enableClosed ) :
- QWidget(parent)
+ QWidget(parent), myIsEnableClosed( enableClosed )
{
QFrame* aFrame = new QFrame( this );
QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
myIsClosed = new QCheckBox(this);
aCoordLayout->addWidget(aLbl, 2, 0);
aCoordLayout->addWidget(myIsClosed, 2, 1);
- if ( !enableClosed ) {
+ if ( !myIsEnableClosed ) {
aLbl->hide();
myIsClosed->hide();
}
void setSectionName(const QString& theName );
void clear();
void setEditMode( bool isEdit );
+ bool isEnableClosed() const { return myIsEnableClosed; }
signals:
void addSection();
QComboBox* myLineType;
QCheckBox* myIsClosed;
bool myIsEdit;
+ bool myIsEnableClosed;
QPushButton* myAddBtn;
QPushButton* myCancelBtn;
};
}
break;
case ModificationMode: {
- anEnabledAct << CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID << SET_SECTIONS_POLYLINE_ID << SET_SECTIONS_SPLINE_ID;
+ if ( myNewSectionEditor->isEnableClosed() )
+ anEnabledAct << CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID;
+ anEnabledAct << SET_SECTIONS_POLYLINE_ID << SET_SECTIONS_SPLINE_ID;
int aSectCnt = myCurve->getNbSections();
if( aSectCnt > 0 )
anEnabledAct << CLEAR_ALL_ID;