void KisDummiesFacadeBase::setImage(KisImageWSP image) { if (m_d->image) { emit sigActivateNode(0); m_d->image->disconnect(this); KisNodeDummy *rootDummy = this->rootDummy(); if(rootDummy) { slotRemoveNode(rootDummy->node()); } } m_d->image = image; if (image) { slotNodeAdded(image->root()); connect(image, SIGNAL(sigNodeAddedAsync(KisNodeSP)), SLOT(slotNodeAdded(KisNodeSP)), Qt::DirectConnection); connect(image, SIGNAL(sigRemoveNodeAsync(KisNodeSP)), SLOT(slotRemoveNode(KisNodeSP)), Qt::DirectConnection); connect(image, SIGNAL(sigLayersChangedAsync()), SLOT(slotLayersChanged()), Qt::DirectConnection); connect(image, SIGNAL(sigNodeChanged(KisNodeSP)), SLOT(slotNodeChanged(KisNodeSP))); connect(image, SIGNAL(sigNodeAddedAsync(KisNodeSP)), SLOT(slotNodeActivationRequested(KisNodeSP)), Qt::AutoConnection); emit sigActivateNode(findFirstLayer(image->root())); } }
void KisNodeManager::setView(QPointer<KisView>imageView) { m_d->maskManager.setView(imageView); m_d->layerManager.setView(imageView); if (m_d->imageView) { KisShapeController *shapeController = dynamic_cast<KisShapeController*>(m_d->imageView->document()->shapeController()); Q_ASSERT(shapeController); shapeController->disconnect(SIGNAL(sigActivateNode(KisNodeSP)), this); m_d->imageView->image()->disconnect(this); } m_d->imageView = imageView; if (m_d->imageView) { KisShapeController *shapeController = dynamic_cast<KisShapeController*>(m_d->imageView->document()->shapeController()); Q_ASSERT(shapeController); connect(shapeController, SIGNAL(sigActivateNode(KisNodeSP)), SLOT(slotNonUiActivatedNode(KisNodeSP))); connect(m_d->imageView->image(), SIGNAL(sigIsolatedModeChanged()),this, SLOT(slotUpdateIsolateModeAction())); connect(m_d->imageView->image(), SIGNAL(sigRequestNodeReselection(KisNodeSP, const KisNodeList&)),this, SLOT(slotImageRequestNodeReselection(KisNodeSP, const KisNodeList&))); m_d->imageView->resourceProvider()->slotNodeActivated(m_d->imageView->currentNode()); }
void KisDummiesFacadeBase::slotNodeActivationRequested(KisNodeSP node) { if(!node->inherits("KisSelectionMask")) { emit sigActivateNode(node); } }