X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/0d3590739ff5a4ca9e87c052ac142f5d1d3a68ab..624231601a0f5daea9b8809993ad3503beafce4f:/GroupItem.cpp diff --git a/GroupItem.cpp b/GroupItem.cpp index c965452..e219f4c 100644 --- a/GroupItem.cpp +++ b/GroupItem.cpp @@ -383,12 +383,7 @@ void GroupItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { dispatcher->setCurrentGroupWidget(getScene()->getGroupWidget()); - /* NOTE : commneted because group interface are normally - created and the connected directly to a block within - the group. Furthermore, there can be a single connection - from a groupe interface. - - if ((mode == GroupScene::AddConnection) && (params->cursorState == Parameters::CursorOnInterface)) { + if ((refBlock->isTopGroupBlock()) && (mode == GroupScene::AddConnection) && (params->cursorState == Parameters::CursorOnInterface)) { InterfaceItem *inter = getInterfaceFromCursor(x,y); if (inter != NULL) { @@ -406,9 +401,8 @@ void GroupItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { } } } - } - */ - if (mode == GroupScene::ItemEdition) { + } + else if (mode == GroupScene::ItemEdition) { if (params->cursorState == Parameters::CursorOnInterface) { InterfaceItem *inter = getInterfaceFromCursor(x,y); @@ -433,12 +427,7 @@ void GroupItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { int mode = getScene()->getEditionMode(); - /* NOTE : commneted because group interface are normally - created and the connected directly to a block within - the group. Furthermore, there can be a single connection - from a groupe interface. - - if (mode == GroupScene::AddConnection) { + if ((refBlock->isTopGroupBlock()) && (mode == GroupScene::AddConnection)) { if (params->editState == Parameters::EditStartConnection) { params->setEditState(Parameters::EditStartConnection); @@ -456,7 +445,7 @@ void GroupItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { else if (params->editState == Parameters::EditCloseConnection) { InterfaceItem* iface1 = getScene()->getSelectedInterface(1); InterfaceItem* iface2 = getScene()->getSelectedInterface(2); - bool ok = dispatcher->connect(iface1,iface2); + bool ok = dispatcher->createConnectionItem(iface1,iface2); if (ok) { iface1->selected = false; update(iface1->boundingRect()); @@ -465,9 +454,8 @@ void GroupItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { params->setEditState(Parameters::EditNoOperation); } } - } - */ - if (mode == GroupScene::ItemEdition) { + } + else if (mode == GroupScene::ItemEdition) { currentInterface = NULL; setFlag(ItemIsMovable, true); params->editState = Parameters::EditNoOperation;