| 906 | } |
| 907 | |
| 908 | void UBBoardController::deleteScene(int nIndex) |
| 909 | { |
| 910 | if (selectedDocument()->pageCount()>=2) |
| 911 | { |
| 912 | mDeletingSceneIndex = nIndex; |
| 913 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
| 914 | persistCurrentScene(); |
| 915 | UBApplication::showMessage(tr("Deleting page %1").arg(nIndex+1), true); |
| 916 | |
| 917 | auto document = UBDocument::getDocument(selectedDocument()); |
| 918 | document->deletePages({nIndex}); |
| 919 | |
| 920 | QDateTime now = QDateTime::currentDateTime(); |
| 921 | selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(now)); |
| 922 | UBMetadataDcSubsetAdaptor::persist(selectedDocument()); |
| 923 | |
| 924 | if (nIndex >= pageCount()) |
| 925 | nIndex = pageCount()-1; |
| 926 | setActiveDocumentScene(nIndex); |
| 927 | UBApplication::showMessage(tr("Page %1 deleted").arg(nIndex+1)); |
| 928 | QApplication::restoreOverrideCursor(); |
| 929 | mDeletingSceneIndex = -1; |
| 930 | } |
| 931 | } |
| 932 | |
| 933 | |
| 934 | void UBBoardController::clearScene() |
nothing calls this directly
no test coverage detected