]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Bugs 153, 154.
authormzn <mzn@opencascade.com>
Thu, 5 Dec 2013 08:27:25 +0000 (08:27 +0000)
committermzn <mzn@opencascade.com>
Thu, 5 Dec 2013 08:27:25 +0000 (08:27 +0000)
src/HYDROCurveCreator/CurveCreator_Widget.cxx
src/HYDROCurveCreator/CurveCreator_Widget.h
src/HYDROGUI/HYDROGUI_ProfileDlg.cxx

index 0e7936e5e8b28e6e03f99e129fe576593149dfd6..731893a52df1200f99edd5b585b0ae271f20e306 100644 (file)
@@ -78,6 +78,7 @@
 
 CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
                                          CurveCreator_ICurve *theCurve,
+                                         const int theActionFlags,
                                          Qt::WindowFlags fl,
                                          int theLocalPointRowLimit )
 : QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
@@ -129,12 +130,14 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
   aTB->addAction(anAct);
 
   aTB->addSeparator();
-
+  
   anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"), 
                         QKeySequence(Qt::ControlModifier|Qt::Key_N) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
-  aTB->addAction(anAct);
-  aTB->addSeparator();
+  if ( !(theActionFlags & DisableNewSection) ) {
+    aTB->addAction(anAct);
+    aTB->addSeparator();
+  }
 
   anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"), 
                         QKeySequence() );
@@ -155,8 +158,10 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
   anAct->setCheckable(true);
   connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectionMode(bool)) );
   connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
-  aTB->addAction(anAct);
-
+  if ( !(theActionFlags & DisableDetectionMode) ) {
+    aTB->addAction(anAct);
+  }
+  
   anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"), 
                         QKeySequence(Qt::ControlModifier|Qt::Key_W) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
@@ -178,6 +183,7 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
                         QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
   aTB->addAction(anAct);
+  
   // TODO join
   //aTB->addSeparator();
 
index f62b5929871be06485348e134312f06506228fb4..cba56e0e018ae26fcc051f755283032ed345f5be 100644 (file)
@@ -51,9 +51,18 @@ class CurveCreator_NewSectionDlg;
 class CURVECREATOR_EXPORT CurveCreator_Widget : public QWidget
 {
   Q_OBJECT
+
+public:
+  enum ActionFlags {
+    NoFlags              = 0x00000000,
+    DisableDetectionMode = 0x00000001,
+    DisableNewSection    = 0x00000002
+  };
+
 public:
   explicit CurveCreator_Widget( QWidget* parent,
                                 CurveCreator_ICurve *theCurve,
+                                const int theActionFlags = NoFlags,
                                 Qt::WindowFlags fl=0,
                                 int theLocalPointRowLimit = 20);
 
index dc40477a815b38ed5dc367b7248b5965e6fafc0f..e05d473911d14939d1da86de28c66755cad91319 100644 (file)
@@ -51,7 +51,9 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr
 
   addLayout(aNameLayout);
 
-  myEditorWidget = new CurveCreator_Widget( this, NULL );
+  int anActionFlags = 
+    CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode;
+  myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags );
   addWidget( myEditorWidget, 3 );
 
   myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );