]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Point 2.3 of "SUPERVISOR: Current state - bugs/improvements":
authormkr <mkr@opencascade.com>
Wed, 29 Dec 2004 13:35:39 +0000 (13:35 +0000)
committermkr <mkr@opencascade.com>
Wed, 29 Dec 2004 13:35:39 +0000 (13:35 +0000)
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

index f3be039fbade99b350db1968e8cbd2dffb4c6f3e..7fe0df8492bcc76ec1162a282a50a7161a21ff3f 100644 (file)
@@ -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;
 }*/