From f5ceb4e6e1b1e84da4b2f9dc1ed4920404b9904a Mon Sep 17 00:00:00 2001 From: mkr Date: Wed, 29 Dec 2004 13:35:39 +0000 Subject: [PATCH] Point 2.3 of "SUPERVISOR: Current state - bugs/improvements": disable popup menu items "Copy Node" and "Paste Port" if Loop or Switch node has been copied and then delete before paste operation. --- src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx index f3be039..7fe0df8 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx @@ -87,7 +87,24 @@ void SUPERVGUI_CanvasStartNode::remove() SUPERVGUI_Canvas* aCanvas = getMain()->getCanvas(); setDestroyed(); - if (myCoupled) myCoupled->setDestroyed(); + if (myCoupled) { + + //set myCopyPort from Main object to empty if engine of this port is deleted + //check if any port of this deleted node has been copied + if (!SUPERV_isNull(getMain()->getCopyPort()) || getMain()->getCopyPort()) + if ((QString(getEngine()->Name())).compare(QString(getMain()->getCopyPort()->Node()->Name())) == 0 + || + (QString(myCoupled->getEngine()->Name())).compare(QString(getMain()->getCopyPort()->Node()->Name())) == 0) + getMain()->setCopyPort(NULL); + + myCoupled->setDestroyed(); + } + + //set myCopyNode from Main object to empty if engine of this node is deleted + //check if myCopyNode and this node engine is equal + if (!SUPERV_isNull(getMain()->getCopyNode()) || getMain()->getCopyNode()) + if ((QString(getEngine()->Name())).compare(QString(getMain()->getCopyNode()->Name())) == 0) + getMain()->setCopyNode(NULL); getEngine()->destroy(); @@ -341,7 +358,7 @@ void SUPERVGUI_CanvasCellNode::sync() { } } -/*bool SUPERVGUI_CanvasCellNode::setNodeName(QString aName) +/*bool SUPERVGUI_CanvasCellNode::setNodeName(QString aName) { bool result = SUPERVGUI_CanvasNode::setNodeName(aName); if (result && myPairCell) { @@ -353,7 +370,7 @@ void SUPERVGUI_CanvasCellNode::sync() { else { QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_RENAMENODE" ) ); } - } + } return result; }*/ -- 2.39.2