From: mzn Date: Tue, 10 Dec 2013 13:35:27 +0000 (+0000) Subject: Hide "Closed" checkbox in new section widget for profiles dialog. X-Git-Tag: BR_hydro_v_0_5~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e119e0e9083810d257cee600dea369b6c761884;p=modules%2Fhydro.git Hide "Closed" checkbox in new section widget for profiles dialog. --- diff --git a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx index a155efb0..aa7d0a78 100644 --- a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx +++ b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx @@ -31,7 +31,7 @@ #include #include -CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent ) : +CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent, bool enableClosed ) : QWidget(parent) { QFrame* aFrame = new QFrame( this ); @@ -64,6 +64,10 @@ CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent ) : myIsClosed = new QCheckBox(this); aCoordLayout->addWidget(aLbl, 2, 0); aCoordLayout->addWidget(myIsClosed, 2, 1); + if ( !enableClosed ) { + aLbl->hide(); + myIsClosed->hide(); + } myBtnFrame = new QFrame( aFrame ); QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame ); diff --git a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h index 96af4385..978cc1de 100644 --- a/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h +++ b/src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h @@ -39,7 +39,7 @@ class CurveCreator_NewSectionDlg : public QWidget { Q_OBJECT public: - explicit CurveCreator_NewSectionDlg(QWidget *parent = 0); + explicit CurveCreator_NewSectionDlg(QWidget *parent = 0, bool enableClosed = true ); QString getName() const; bool isClosed() const; diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.cxx b/src/HYDROCurveCreator/CurveCreator_Widget.cxx index 5883262f..343b1c24 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Widget.cxx @@ -85,7 +85,8 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent, myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ), myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit ) { - myNewSectionEditor = new CurveCreator_NewSectionDlg( this ); + bool isToEnableClosed = !( theActionFlags & DisableClosedSection ); + myNewSectionEditor = new CurveCreator_NewSectionDlg( this, isToEnableClosed ); myNewSectionEditor->hide(); connect( myNewSectionEditor, SIGNAL(addSection()), this, SLOT(onAddNewSection()) ); connect( myNewSectionEditor, SIGNAL(modifySection()), this, SLOT(onModifySection()) ); diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.h b/src/HYDROCurveCreator/CurveCreator_Widget.h index 9243452d..57d0d907 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.h +++ b/src/HYDROCurveCreator/CurveCreator_Widget.h @@ -56,7 +56,8 @@ public: enum ActionFlags { NoFlags = 0x00000000, DisableDetectionMode = 0x00000001, - DisableNewSection = 0x00000002 + DisableNewSection = 0x00000002, + DisableClosedSection = 0x00000004 }; public: diff --git a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx index 4952ce85..f4ee9b73 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx @@ -57,7 +57,8 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr addLayout(aNameLayout); int anActionFlags = - CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode; + CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode | + CurveCreator_Widget::DisableClosedSection; myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags ); addWidget( myEditorWidget, 3 );