long GNEConnectorFrame::onCmdClearSelectedConnections(FXObject*, FXSelector, void*) { onCmdCancel(0, 0, 0); myViewNet->getUndoList()->p_begin("clear connections from selected lanes, edges and junctions"); const std::set<GUIGlID> ids = gSelected.getSelected(); for (std::set<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) { GUIGlID id = *it; GUIGlObject* object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(id); if (object) { switch (object->getType()) { case GLO_JUNCTION: { GNEJunction* junction = dynamic_cast<GNEJunction*>(object); junction->setLogicValid(false, myViewNet->getUndoList()); // clear connections junction->setLogicValid(false, myViewNet->getUndoList(), GNEAttributeCarrier::MODIFIED); // prevent re-guessing break; } case GLO_EDGE: { const GNEEdge::LaneVector& lanes = dynamic_cast<GNEEdge*>(object)->getLanes(); for (GNEEdge::LaneVector::const_iterator l_it = lanes.begin(); l_it != lanes.end(); ++l_it) { removeConnections(*l_it); } break; } case GLO_LANE: removeConnections(dynamic_cast<GNELane*>(object)); break; default: break; } } } myViewNet->getUndoList()->p_end(); return 1; }
void SMTableStyle::setCurrentDoc(ScribusDoc *doc) { m_doc = doc; if (!m_doc) { removeConnections(); m_selection.clear(); m_cachedStyles.clear(); } if (m_doc) { if (m_page) { m_page->fillBackgroundColorCombo(m_doc->PageColors); } } else { removeConnections(); m_selection.clear(); m_cachedStyles.clear(); } }
bool connectionManager::finaliseAssignedConnections(bfsState& state, std::vector<pinpair>& circPins, std::vector<pinpair>& constructedListOfConnections) { std::vector<int> toRemOperationIds[2]; for(std::map<int, int>::iterator it = state.operationIdToCircuitPinIndex.begin(); it != state.operationIdToCircuitPinIndex.end(); it++) { int operationId = it->first; int circPinIndex = it->second; if(assignedIdToConnection.find(operationId) == assignedIdToConnection.end()) { //for some buggy reason, an operation was not assigned a connection // toRemOperationIds.clear(); printf(" fAILED %d\n", operationId); return false; } //get connection of operationid int connNr = assignedIdToConnection[operationId]; printf("PAIR id%d circ%d conn%d\n", operationId, circPinIndex, connNr); pinpair dist = connectionPins[connNr]; pinpair circ = circPins[circPinIndex]; printf("712 circ coord %d\n", circ.getPinDetail(0).coord[CIRCUITDEPTH]); int boxType = circ.getType(); std::vector<pinpair> pairs = formPairs(dist, circ); //01.11.2017 pairs[0].allowConnectionThroughChannel = true; pairs[1].allowConnectionThroughChannel = true; constructedListOfConnections.insert(constructedListOfConnections.end(), pairs.begin(), pairs.end()); /* * Free the connection */ //removeConnection(operationId); toRemOperationIds[boxType].push_back(operationId); } //for these operation ids, the connections are finished state.operationIdToCircuitPinIndex.clear(); removeConnections(0, toRemOperationIds[0]); toRemOperationIds[0].clear(); removeConnections(1, toRemOperationIds[1]); toRemOperationIds[1].clear(); return true; }
//---------------------------------------------disconnectModuleSignals void ModuleWidget::disconnectModuleSignals() { removeConnections(&m_pModule->signalModuleInputRegistered); removeConnections(&m_pModule->signalModuleInputUnregistered); removeConnections(&m_pModule->signalModuleInputConnected); removeConnections(&m_pModule->signalModuleInputDisconnected); removeConnections(&m_pModule->signalModuleOutputRegistered); removeConnections(&m_pModule->signalModuleOutputUnregistered); removeConnections(&m_pModule->signalModuleOutputConnected); removeConnections(&m_pModule->signalModuleOutputDisconnected); }
void SMTableStyle::setCurrentDoc(ScribusDoc *doc) { m_doc = doc; if (m_page) m_page->setDoc(doc); if (!m_doc) { removeConnections(); m_selection.clear(); m_cachedStyles.clear(); } }
/** * Disconnects "signal" of the client named "sender" from the "slot" of * "receiverObj" in the "conn" client. * * Special case: * If sender & signal are empty all connections that involve * conn & receiverObj (either as receiver or as sender) * are disconnected. */ bool DCOPSignals::disconnectSignal(const QCString &sender, const QCString &senderObj, const QCString &signal, DCOPConnection *conn, const QCString &receiverObj, const QCString &slot) { if(sender.isEmpty() && signal.isEmpty()) { removeConnections(conn, receiverObj); return true; } DCOPSignalConnectionList *list = connections.find(signal); if(!list) return false; // Not found... DCOPSignalConnection *next = 0; bool result = false; for(DCOPSignalConnection *current = list->first(); current; current = next) { next = list->next(); if(current->recvConn != conn) continue; if(current->senderConn) { if(current->senderConn->appId != sender) continue; } else if(current->sender != sender) continue; if(!senderObj.isEmpty() && (current->senderObj != senderObj)) continue; if(!receiverObj.isEmpty() && (current->recvObj != receiverObj)) continue; if(!slot.isEmpty() && (current->slot != slot)) continue; result = true; list->removeRef(current); conn->signalConnectionList()->removeRef(current); if(current->senderConn) current->senderConn->signalConnectionList()->removeRef(current); delete current; } return result; }
bool ActionEditor::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: currentActionChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 1: deleteAction(); break; case 2: newAction(); break; case 3: newActionGroup(); break; case 4: newDropDownActionGroup(); break; case 5: connectionsClicked(); break; case 6: removeConnections((QObject*)static_QUType_ptr.get(_o+1)); break; default: return ActionEditorBase::qt_invoke( _id, _o ); } return TRUE; }
void SMTableStyle::selected(const QStringList &styleNames) { m_selection.clear(); m_selectionIsDirty = false; removeConnections(); QList<TableStyle> tableStyles; m_cachedStyles.invalidate(); for (int i = 0; i < m_cachedStyles.count(); ++i) tableStyles << m_cachedStyles[i]; foreach (QString styleName, styleNames) { int index = m_cachedStyles.find(styleName); // FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison if (index < 0 && styleName == CommonStrings::trDefaultCharacterStyle) index = m_cachedStyles.find(CommonStrings::DefaultCharacterStyle); if (index > -1) m_selection.append(&m_cachedStyles[index]); }