X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_Port.cxx;h=40fbd64ba49dd5d4939065d07e0115ac3856293c;hb=f39b719fd1b306b77c02bee72ea1c432e899ee77;hp=335d05063864f6cd5d7e766bc273024b5be38768;hpb=c472be64ad2486a50e224af7c02e34eefaca9304;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_Port.cxx b/src/SUPERVGUI/SUPERVGUI_Port.cxx index 335d050..40fbd64 100644 --- a/src/SUPERVGUI/SUPERVGUI_Port.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Port.cxx @@ -70,7 +70,15 @@ SUPERVGUI_Port::SUPERVGUI_Port(QWidget* parent, SUPERVGUI_Main* m, SUPERV_Port p mySketchItem = popup->insertItem(tr("MSG_SKETCH_LINK"), this, SLOT(sketchLink())); popup->insertSeparator(); } - if (port->IsInLine()) { + //for Loop Node: enable "Delete" popup item only for the input port + if ( ( port->IsInLine() + && + ( port->Node()->Kind()!=SUPERV::EndLoopNode ) + && + !( port->Node()->Kind()==SUPERV::LoopNode && !port->IsInput() ) + ) + || + ( port->IsEndSwitch() && port->IsInput())) { myDelItem = popup->insertItem(tr("ITM_DEL_PORT"), this, SLOT(deletePort())); } connect(this, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*))); @@ -335,10 +343,16 @@ void SUPERVGUI_PortOut::updateStudy() { void SUPERVGUI_PortOut::toStudy() { Trace("SUPERVGUI_PortOut::toStudy") - if (!main->isFromStudy()) { - if (main->addStudy()) main->setAsFromStudy(true); - } - if (!main->getStudy()->getStudyDocument()->GetProperties()->IsLocked()) study = !study; + + if (main->getStudy()->getStudyDocument()->GetProperties()->IsLocked()) { + QMessageBox::warning(QAD_Application::getDesktop(), tr("WRN_WARNING"), tr("WRN_STUDY_LOCKED")); + return; + } + + if (!main->isFromStudy()) { + if (main->addStudy()) main->setAsFromStudy(true); + } + study = !study; sync(); } @@ -395,7 +409,7 @@ void SUPERVGUI_PortOut::deleteLinks() { -//*********************************************************** +// ---------------------------- // Input Port of EndSwitch Node // ---------------------------- SUPERVGUI_PortInESNode::SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* m, SUPERV_Port p) @@ -406,9 +420,9 @@ SUPERVGUI_PortInESNode::SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* bool editing = port->IsInput() && ( !port->IsLinked() ); //main->isEditable(); if ((!port->IsGate()) && editing ) { - psc = popup->insertItem(tr("MSG_SETVALUE"), this, SLOT(setInput())); + psc = popup->insertItem(tr("MSG_SETVALUE"),this, SLOT(setInput())); } - browser = popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse())); + browser = popup->insertItem(tr("MSG_BROWSE"),this, SLOT(browse())); } SUPERVGUI_PortInESNode::~SUPERVGUI_PortInESNode() {