From a85a44db1018f1d8f3f690bd765fbaa7ba233a1f Mon Sep 17 00:00:00 2001 From: asv Date: Mon, 7 Feb 2005 14:30:36 +0000 Subject: [PATCH] Fix for PAL8028: calling to Editors data model only after "OK" button was pressed in EditPorts, EditFunction, AddPort operations. Pressing Cancel does not lead to switching data models. --- src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx | 12 ++++-------- src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx index a7469ff..0104b9e 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx @@ -563,6 +563,7 @@ SUPERV_Port SUPERVGUI_CanvasNode::createInPort() } SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,true)); if (aDlg->exec()) { + myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag SUPERV_Port aPort = aNode->InPort(aDlg->getName().latin1(), aDlg->getType().latin1()); delete aDlg; @@ -582,6 +583,7 @@ SUPERV_Port SUPERVGUI_CanvasNode::createOutPort() SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,false)); if (aDlg->exec()) { + myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag SUPERV_Port aPort = aNode->OutPort(aDlg->getName().latin1(), aDlg->getType().latin1()); delete aDlg; @@ -592,8 +594,6 @@ SUPERV_Port SUPERVGUI_CanvasNode::createOutPort() } void SUPERVGUI_CanvasNode::addInputPort() { - myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag - SUPERV_Port aPort = createInPort(); if (aPort == NULL || CORBA::is_nil( aPort ) ) return; @@ -602,8 +602,6 @@ void SUPERVGUI_CanvasNode::addInputPort() { void SUPERVGUI_CanvasNode::addOutputPort() { - myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag - SUPERV_Port aPort = createOutPort(); if (aPort == NULL || CORBA::is_nil( aPort ) ) return; @@ -612,8 +610,6 @@ void SUPERVGUI_CanvasNode::addOutputPort() { void SUPERVGUI_CanvasNode::editFunction() { - myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag - if (getNodeType() == SUPERV::LoopNode) { SUPERVGUI_EditPythonDlg* aDlg = new SUPERVGUI_EditPythonDlg(true); SUPERV_LNode aLNode = getLoopNode(); @@ -621,6 +617,7 @@ void SUPERVGUI_CanvasNode::editFunction() { aDlg->setMoreFunction(aLNode->PyMore()); aDlg->setNextFunction(aLNode->PyNext()); if (aDlg->exec()) { + myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag aLNode->SetPyInit(aDlg->getInitFuncName().latin1(), (aDlg->getInitFunction()).in()); aLNode->SetPyMore(aDlg->getMoreFuncName().latin1(), (aDlg->getMoreFunction()).in()); aLNode->SetPyNext(aDlg->getNextFuncName().latin1(), (aDlg->getNextFunction()).in()); @@ -632,6 +629,7 @@ void SUPERVGUI_CanvasNode::editFunction() { SUPERV_INode aINode = getInlineNode(); aDlg->setFunction(aINode->PyFunction()); if (aDlg->exec()) { + myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag aINode->SetPyFunction(aDlg->getFuncName().latin1(), (aDlg->getFunction()).in()); } delete aDlg; @@ -650,8 +648,6 @@ void SUPERVGUI_CanvasNode::pastePort() { * for detailed description of the functionality */ void SUPERVGUI_CanvasNode::managePorts() { - myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag - SUPERVGUI_ManagePortsDlg* aDlg = new SUPERVGUI_ManagePortsDlg( this ); aDlg->exec(); delete aDlg; diff --git a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx index eb8d83c..956133d 100644 --- a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx +++ b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx @@ -295,6 +295,7 @@ SUPERVGUI_ManagePortsDlg::~SUPERVGUI_ManagePortsDlg() { * Set the ports as entered by user (order, name/type, etc.) and close the dialog */ void SUPERVGUI_ManagePortsDlg::accept() { + myNode->getMain()->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag // 1. set the ports to Engine's CNode SUPERV_INode aINode = myNode->getInlineNode(); if ( !SUPERV_isNull( aINode ) ) { -- 2.39.2