X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_CanvasNode.cxx;h=f2118629ad410f8d1813c0309bab76bc3952b033;hb=cbb0219fe6d6bf11f98f2306c2855fef1eaa2d44;hp=273f161e23e90f68ea200e91d5eaa7545b930e42;hpb=e4b2f8f88a294e451364a8b84d170a59dcbb5d3f;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx index 273f161..f211862 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx @@ -11,9 +11,9 @@ using namespace std; #include "SUPERVGUI_CanvasNodePrs.h" #include "SUPERVGUI_CanvasPort.h" #include "SUPERVGUI_Main.h" -#include "SUPERVGUI_Python.h" #include "SUPERVGUI.h" #include "SUPERVGUI_BrowseNodeDlg.h" +#include "SUPERVGUI_ManagePortsDlg.h" #include "SALOMEGUI_NameDlg.h" #include "SUPERVGUI_Information.h" /* @@ -22,7 +22,7 @@ using namespace std; #include */ -SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode): +SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell): QObject(theParent), myMain(theMain), myNode(theNode), @@ -74,6 +74,9 @@ SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* t } isIgnore = false; + + QCanvasItemList anIL2 = ((QCanvas*)parent())->allItems(); + cout<<" ===> 1 conatructor CanvasNode : CanvasArray has "<isEditable() && getNodeType() != SUPERV::EndLoopNode && getNodeType() != SUPERV::EndSwitchNode) { popup->insertItem(tr("MSG_RENAME"), this, SLOT(rename())); - popup->insertItem(tr("MSG_DELETE"), this, SLOT(remove())); + myDeleteItem = popup->insertItem(tr("MSG_DELETE"), this, SLOT(remove())); popup->insertSeparator(); } popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse())); @@ -163,14 +166,15 @@ QPopupMenu* SUPERVGUI_CanvasNode::getPopupMenu(QWidget* theParent) && getNodeType() != SUPERV::EndLoopNode && getNodeType() != SUPERV::MacroNode) { QPopupMenu* addPortMenu = new QPopupMenu(theParent); - addPortMenu->insertItem("Input", this, SLOT(addInputPort())); + addPortMenu->insertItem( tr( "MNU_INPUT" ), this, SLOT(addInputPort())); if (getNodeType() != SUPERV::LoopNode) - addPortMenu->insertItem("Output", this, SLOT(addOutputPort())); + addPortMenu->insertItem( tr( "MNU_OUTPUT" ), this, SLOT(addOutputPort())); popup->insertSeparator(); if ((getNodeType() != SUPERV::EndSwitchNode)) - popup->insertItem("Edit Function", this, SLOT(editFunction())); - popup->insertItem("Add Port", addPortMenu); + popup->insertItem( tr( "MNU_EDIT_FUNC" ), this, SLOT(editFunction())); + popup->insertItem( tr( "MNU_ADD_PORT" ), addPortMenu); + popup->insertItem( tr( "MNU_MANAGE_PORTS" ), this, SLOT(managePorts())); } } @@ -273,8 +277,9 @@ void SUPERVGUI_CanvasNode::sync() { //MESSAGE("===> SUPERVGUI_CanvasNode::sync() " << myNode->Name() << ", state " << myNode->State()); + const bool isExecuting = myMain->getDataflow()->IsExecuting(); //if myNode is a MacroNode then set it state to state of its subgraph - if (myNode->IsMacro() && myMain->getDataflow()->IsExecuting()) { + if ( myNode->IsMacro() && isExecuting ) { // get SubGraph from MacroNode SUPERV_Graph aMacro = SUPERV::Graph::_narrow(myNode); if (!SUPERV_isNull(aMacro)) { @@ -291,8 +296,16 @@ void SUPERVGUI_CanvasNode::sync() } } } - else - getPrs()->setState(myNode->State()); + else { + SUPERV::GraphState aState = myNode->State(); + + // asv : 18.11.04 : fix for 6170 : after execution is finished, nodes' status must be reset. + // asv : 13.12.04 : commented out setting EditingState. See 2.21. + //if ( !isExecuting && myMain->IsGUIEventLoopFinished() && (aState == SUPERV::DoneState || + // aState == SUPERV::KillState || aState == SUPERV::StopState ) ) + // aState = SUPERV::EditingState; + getPrs()->setState(aState); + } // update child ports const QObjectList* list = children(); @@ -400,6 +413,7 @@ void SUPERVGUI_CanvasNode::changeInformation() { delete aDlg; } +/* asv : 13.12.04 : The functions below are not called from anywhere, so commenting them out... void SUPERVGUI_CanvasNode::configure() { Trace("SUPERVGUI_CanvasNode::configure"); @@ -412,6 +426,7 @@ void SUPERVGUI_CanvasNode::showPython() SUPERVGUI_Python cp(myMain->getStudy()->get_PyInterp(), !myMain->isEditable()); cp.exec(); } +*/ bool SUPERVGUI_CanvasNode::isWarning() { @@ -578,3 +593,13 @@ void SUPERVGUI_CanvasNode::editFunction() delete aDlg; } } + +/** + * Called on "Edit ports" popup menu command. See SUPERVGUI_ManagePortsDlg.h + * for detailed description of the functionality + */ +void SUPERVGUI_CanvasNode::managePorts() { + SUPERVGUI_ManagePortsDlg* aDlg = new SUPERVGUI_ManagePortsDlg( this ); + aDlg->exec(); + delete aDlg; +}