]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Avoid the modification of the composed nodes ports when in run schema mode.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 8 Jul 2014 12:49:49 +0000 (14:49 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 8 Jul 2014 12:49:49 +0000 (14:49 +0200)
When you are in run schema mode, it is no longer possible to modify:
- "nsteps" in ForLoop nodes
- "condition" in WhileLoop nodes
- "nb. branches" and "SmplsCollection" in ForEachLoop nodes
- "select" in Switch nodes

src/genericgui/EditionForEachLoop.cxx
src/genericgui/EditionLoop.cxx
src/genericgui/EditionSwitch.cxx
src/genericgui/EditionWhile.cxx

index 9981fd54fea784bdf0a9a65b14cd5b58edbbf27f..6df5f623326a8c19b7bf59593ca985fc1394330d 100644 (file)
@@ -46,6 +46,8 @@ EditionForEachLoop::EditionForEachLoop(Subject* subject,
   _wid->gridLayout1->addWidget(_formEachLoop);
   _formEachLoop->sb_nbranch->setMinimum(1);
   _formEachLoop->sb_nbranch->setMaximum(INT_MAX);
+  if (!QtGuiContext::getQtCurrent()->isEdition())
+    _formEachLoop->setEnabled (false);
   Node* node=_subjectNode->getNode();
   ForEachLoop *fe = dynamic_cast<ForEachLoop*>(node);
   if(fe)
index bf3f5e7425d96fc3e60515eed889ce24893884bf..4458308fe8412efc221d5c8ddec93636cd123e04 100644 (file)
@@ -55,6 +55,9 @@ EditionLoop::EditionLoop(Subject* subject,
 
   _formLoop->sb_nsteps->setMinimum(0);
   _formLoop->sb_nsteps->setMaximum(INT_MAX);
+  if (!QtGuiContext::getQtCurrent()->isEdition())
+    _formLoop->setEnabled (false);
+  
   connect(_formLoop->sb_nsteps, SIGNAL(editingFinished()),
           this, SLOT(onNbStepsEdited()));
 }
index 99862b739fdeb05b71166d49cfb26c72be200f15..37feb71d61afe5c507a5ef1e189c55ab189a0fab 100644 (file)
@@ -52,6 +52,8 @@ EditionSwitch::EditionSwitch(Subject* subject,
   _valueDelegate = new ValueDelegate(parent);
   _tvSwitch->tv_nodes->setItemDelegateForColumn(YValue, _valueDelegate);
   _tvSwitch->setEditableCase(true);
+  if (!QtGuiContext::getQtCurrent()->isEdition())
+    _tvSwitch->setEnabled (false);
 
   connect(_valueDelegate, SIGNAL(commitData(QWidget*)),
           this, SLOT(onCommitData(QWidget*)));
index 50ade528bc0a92605d42bb7d360d6246366429ca..1d7df1e438b90354be002d78a75899c534553fb9 100644 (file)
@@ -20,6 +20,7 @@
 #include "EditionWhile.hxx"
 #include "FormLoop.hxx"
 #include "guiObservers.hxx"
+#include "QtGuiContext.hxx"
 
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
@@ -43,6 +44,8 @@ EditionWhile::EditionWhile(Subject* subject,
   _formWhile->sb_nsteps->setMinimum(0);
   _formWhile->sb_nsteps->setMaximum(1);
   _formWhile->label->setText("Condition");
+  if (!QtGuiContext::getQtCurrent()->isEdition())
+    _formWhile->setEnabled (false);
   connect(_formWhile->sb_nsteps, SIGNAL(editingFinished()),
           this, SLOT(onConditionEdited()));
 }