| 1473 | } |
| 1474 | |
| 1475 | bool MainWindow::confirmAndRemoveDependentTransforms(const std::vector<std::string>& removed_names) { |
| 1476 | auto& dp = session_->sessionManager().dataProcessorService(); |
| 1477 | const auto affected = dp.transformsDependingOn(removed_names); |
| 1478 | if (affected.empty()) { |
| 1479 | return true; // nothing depends on it — proceed |
| 1480 | } |
| 1481 | QStringList names; |
| 1482 | for (const auto& recipe : affected) { |
| 1483 | for (const auto& out : recipe.outputs) { |
| 1484 | names << QString::fromStdString(out); |
| 1485 | } |
| 1486 | } |
| 1487 | const auto answer = QMessageBox::warning( |
| 1488 | this, tr("Delete derived series?"), |
| 1489 | tr("These derived series depend on what you are deleting and will also be removed:\n\n• %1") |
| 1490 | .arg(names.join(QStringLiteral("\n• "))), |
| 1491 | QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel); |
| 1492 | if (answer != QMessageBox::Ok) { |
| 1493 | return false; // user cancelled — leave everything intact |
| 1494 | } |
| 1495 | // Remove each derivative: drop its Custom Series entry BY NAME (robust against |
| 1496 | // catalog-key churn — same as PJ3's removeCurve(name)), then the transform node. |
| 1497 | for (const auto& recipe : affected) { |
| 1498 | for (const auto& out : recipe.outputs) { |
| 1499 | ui_->curveListPanel->removeCustomCurveByName(QString::fromStdString(out)); |
| 1500 | } |
| 1501 | (void)dp.removeTransform(recipe.key); |
| 1502 | } |
| 1503 | return true; |
| 1504 | } |
| 1505 | |
| 1506 | void MainWindow::onCatalogTrashRequested(QStringList keys, bool covers_all) { |
| 1507 | CatalogModel& catalog = session_->catalogModel(); |
nothing calls this directly
no test coverage detected