Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 2303:6df78d2b1b5e by-id
Work on the cancel-button
author | Chris Cannam |
---|---|
date | Mon, 15 Jul 2019 14:13:40 +0100 |
parents | 23fea10161a6 |
children | 1bf8b93dc006 |
comparison
equal
deleted
inserted
replaced
2302:bac1a8318314 | 2303:6df78d2b1b5e |
---|---|
3473 | 3473 |
3474 void | 3474 void |
3475 MainWindow::paneAdded(Pane *pane) | 3475 MainWindow::paneAdded(Pane *pane) |
3476 { | 3476 { |
3477 if (m_overview) m_overview->registerView(pane); | 3477 if (m_overview) m_overview->registerView(pane); |
3478 if (pane) { | |
3479 connect(pane, SIGNAL(cancelButtonPressed(Layer *)), | |
3480 this, SLOT(paneCancelButtonPressed(Layer *))); | |
3481 } | |
3478 } | 3482 } |
3479 | 3483 |
3480 void | 3484 void |
3481 MainWindow::paneHidden(Pane *pane) | 3485 MainWindow::paneHidden(Pane *pane) |
3482 { | 3486 { |
3486 void | 3490 void |
3487 MainWindow::paneAboutToBeDeleted(Pane *pane) | 3491 MainWindow::paneAboutToBeDeleted(Pane *pane) |
3488 { | 3492 { |
3489 if (m_overview) m_overview->unregisterView(pane); | 3493 if (m_overview) m_overview->unregisterView(pane); |
3490 } | 3494 } |
3495 | |
3496 void | |
3497 MainWindow::paneCancelButtonPressed(Layer *layer) | |
3498 { | |
3499 Pane *pane = qobject_cast<Pane *>(sender()); | |
3500 bool found = false; | |
3501 if (pane && layer) { | |
3502 for (int i = 0; i < pane->getLayerCount(); ++i) { | |
3503 if (pane->getLayer(i) == layer) { | |
3504 found = true; | |
3505 break; | |
3506 } | |
3507 } | |
3508 } | |
3509 if (!found) { | |
3510 SVDEBUG << "MainWindow::paneCancelButtonPressed: Unknown layer in pane" | |
3511 << endl; | |
3512 return; | |
3513 } | |
3514 | |
3515 SVDEBUG << "MainWindow::paneCancelButtonPressed: Layer " << layer << endl; | |
3516 | |
3517 m_document->removeLayerFromView(pane, layer); | |
3518 updateMenuStates(); | |
3519 } | |
3491 | 3520 |
3492 void | 3521 void |
3493 MainWindow::paneDropAccepted(Pane *pane, QStringList uriList) | 3522 MainWindow::paneDropAccepted(Pane *pane, QStringList uriList) |
3494 { | 3523 { |
3495 if (pane) m_paneStack->setCurrentPane(pane); | 3524 if (pane) m_paneStack->setCurrentPane(pane); |
4144 if (!aggregate.isNone()) { | 4173 if (!aggregate.isNone()) { |
4145 if (input.getModel() == aggregate) { | 4174 if (input.getModel() == aggregate) { |
4146 if (auto aggregateModel = ModelById::get(aggregate)) { | 4175 if (auto aggregateModel = ModelById::get(aggregate)) { |
4147 aggregateModel->setObjectName(tr("Multiplexed audio")); | 4176 aggregateModel->setObjectName(tr("Multiplexed audio")); |
4148 } | 4177 } |
4149 m_document->addAggregateModel(aggregate); | 4178 m_document->addNonDerivedModel(aggregate); |
4150 } else { | 4179 } else { |
4151 ModelById::release(aggregate); | 4180 ModelById::release(aggregate); |
4152 } | 4181 } |
4153 } | 4182 } |
4154 | 4183 |