From 9e119e0e9083810d257cee600dea369b6c761884 Mon Sep 17 00:00:00 2001 From: mzn Date: Tue, 10 Dec 2013 13:35:27 +0000 Subject: [PATCH] Hide "Closed" checkbox in new section widget for profiles dialog. --- src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx | 6 +++++- src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h | 2 +- src/HYDROCurveCreator/CurveCreator_Widget.cxx | 3 ++- src/HYDROCurveCreator/CurveCreator_Widget.h | 3 ++- src/HYDROGUI/HYDROGUI_ProfileDlg.cxx | 3 ++- 5 files changed, 12 insertions(+), 5 deletions(-) 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 ); -- 2.39.2