]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Hide "Closed" checkbox in new section widget for profiles dialog.
authormzn <mzn@opencascade.com>
Tue, 10 Dec 2013 13:35:27 +0000 (13:35 +0000)
committermzn <mzn@opencascade.com>
Tue, 10 Dec 2013 13:35:27 +0000 (13:35 +0000)
src/HYDROCurveCreator/CurveCreator_NewSectionDlg.cxx
src/HYDROCurveCreator/CurveCreator_NewSectionDlg.h
src/HYDROCurveCreator/CurveCreator_Widget.cxx
src/HYDROCurveCreator/CurveCreator_Widget.h
src/HYDROGUI/HYDROGUI_ProfileDlg.cxx

index a155efb069177e519927878e86b7040463d3ef11..aa7d0a78ea75d08c7fbdca01139a5926d3b92018 100644 (file)
@@ -31,7 +31,7 @@
 #include <QDialogButtonBox>
 #include <QPushButton>
 
-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 );
index 96af4385486635a64456846215f2ed5d0007d9ab..978cc1de0e423e09f673585035de03e784aa04c1 100644 (file)
@@ -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;
index 5883262f41a3640b332d8c19eb2ab8912f6abcfc..343b1c248243abe9674381f6642121faa7d4ef46 100644 (file)
@@ -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()) );
index 9243452dbac2606c9df53fea95263ec7070525ef..57d0d9079bb0256e62c2ed049a59e728e85734e9 100644 (file)
@@ -56,7 +56,8 @@ public:
   enum ActionFlags {
     NoFlags              = 0x00000000,
     DisableDetectionMode = 0x00000001,
-    DisableNewSection    = 0x00000002
+    DisableNewSection    = 0x00000002,
+    DisableClosedSection = 0x00000004
   };
 
 public:
index 4952ce856ee8d8151e64165914d2bfda6b3d5497..f4ee9b73130a752c7204518e7ea6e49e96a9210c 100644 (file)
@@ -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 );