From: Ovidiu Mircescu Date: Tue, 8 Jul 2014 12:49:49 +0000 (+0200) Subject: Avoid the modification of the composed nodes ports when in run schema mode. X-Git-Tag: V7_5_0a1~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=177fac44271f2fba21e2223fa9ec187364fcf9a0;p=modules%2Fyacs.git Avoid the modification of the composed nodes ports when in run schema mode. 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 --- diff --git a/src/genericgui/EditionForEachLoop.cxx b/src/genericgui/EditionForEachLoop.cxx index 9981fd54f..6df5f6233 100644 --- a/src/genericgui/EditionForEachLoop.cxx +++ b/src/genericgui/EditionForEachLoop.cxx @@ -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(node); if(fe) diff --git a/src/genericgui/EditionLoop.cxx b/src/genericgui/EditionLoop.cxx index bf3f5e742..4458308fe 100644 --- a/src/genericgui/EditionLoop.cxx +++ b/src/genericgui/EditionLoop.cxx @@ -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())); } diff --git a/src/genericgui/EditionSwitch.cxx b/src/genericgui/EditionSwitch.cxx index 99862b739..37feb71d6 100644 --- a/src/genericgui/EditionSwitch.cxx +++ b/src/genericgui/EditionSwitch.cxx @@ -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*))); diff --git a/src/genericgui/EditionWhile.cxx b/src/genericgui/EditionWhile.cxx index 50ade528b..1d7df1e43 100644 --- a/src/genericgui/EditionWhile.cxx +++ b/src/genericgui/EditionWhile.cxx @@ -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())); }