]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Refs #137 - UZ plane should be used in profile
authornds <nds@opencascade.com>
Mon, 30 Dec 2013 11:13:57 +0000 (11:13 +0000)
committernds <nds@opencascade.com>
Mon, 30 Dec 2013 11:13:57 +0000 (11:13 +0000)
Remove "Set Closed"/ "Unset closed" popup menu actions if the widget is created with the disable close section flag.

src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx
src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h
src/HYDROCurveCreator/CurveCreator_Widget.cxx

index aa7d0a78ea75d08c7fbdca01139a5926d3b92018..5f91246c5794f33aee93f5f243986ac7ce361493 100644 (file)
@@ -32,7 +32,7 @@
 #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 );
@@ -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();
   }
index 978cc1de0e423e09f673585035de03e784aa04c1..d37ed1176ccf79bb738a23e2a651438f26e621b4 100644 (file)
@@ -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;
 };
index aab8b1d2ce3cf46fc11e7e005e0190e4f6b9990b..b595c2217d16d73f6481aae0e861c8dc92027260 100644 (file)
@@ -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;