From: nds Date: Mon, 30 Dec 2013 11:13:57 +0000 (+0000) Subject: Refs #137 - UZ plane should be used in profile X-Git-Tag: BR_hydro_v_0_7~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b581642751cdf5246890c2c05c28353a7061a1e9;p=modules%2Fhydro.git Refs #137 - UZ plane should be used in profile Remove "Set Closed"/ "Unset closed" popup menu actions if the widget is created with the disable close section flag. --- diff --git a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx index aa7d0a78..5f91246c 100644 --- a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx +++ b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx @@ -32,7 +32,7 @@ #include CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent, bool enableClosed ) : - QWidget(parent) + QWidget(parent), myIsEnableClosed( enableClosed ) { QFrame* aFrame = new QFrame( this ); QVBoxLayout* aLayout = new QVBoxLayout( aFrame ); @@ -64,7 +64,7 @@ CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent, bool en myIsClosed = new QCheckBox(this); aCoordLayout->addWidget(aLbl, 2, 0); aCoordLayout->addWidget(myIsClosed, 2, 1); - if ( !enableClosed ) { + if ( !myIsEnableClosed ) { aLbl->hide(); myIsClosed->hide(); } diff --git a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h index 978cc1de..d37ed117 100644 --- a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h +++ b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h @@ -49,6 +49,7 @@ public: void setSectionName(const QString& theName ); void clear(); void setEditMode( bool isEdit ); + bool isEnableClosed() const { return myIsEnableClosed; } signals: void addSection(); @@ -64,6 +65,7 @@ private: QComboBox* myLineType; QCheckBox* myIsClosed; bool myIsEdit; + bool myIsEnableClosed; QPushButton* myAddBtn; QPushButton* myCancelBtn; }; diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.cxx b/src/HYDROCurveCreator/CurveCreator_Widget.cxx index aab8b1d2..b595c221 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Widget.cxx @@ -368,7 +368,9 @@ void CurveCreator_Widget::updateActionsStates() } 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;