| 2533 | |
| 2534 | |
| 2535 | void UBDocumentController::openSelectedItem() |
| 2536 | { |
| 2537 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
| 2538 | |
| 2539 | QList<QGraphicsItem*> selectedItems = mDocumentUI->thumbnailWidget->selectedItems(); |
| 2540 | |
| 2541 | if (selectedItems.count() > 0) |
| 2542 | { |
| 2543 | UBThumbnail* thumb = dynamic_cast<UBThumbnail*> (selectedItems.last()); |
| 2544 | |
| 2545 | if (thumb) |
| 2546 | { |
| 2547 | std::shared_ptr<UBDocumentProxy> proxy = mDocumentUI->thumbnailWidget->document()->proxy(); |
| 2548 | |
| 2549 | if (proxy && isOKToOpenDocument(proxy)) |
| 2550 | { |
| 2551 | UBApplication::showMessage(tr("Opening document in Board. Please wait..."), true); |
| 2552 | UBApplication::applicationController->showBoard(); |
| 2553 | mBoardController->setActiveDocumentScene(proxy, thumb->sceneIndex()); |
| 2554 | } |
| 2555 | } |
| 2556 | } |
| 2557 | else |
| 2558 | { |
| 2559 | std::shared_ptr<UBDocumentProxy> proxy = selectedDocumentProxy(); |
| 2560 | |
| 2561 | if (proxy && isOKToOpenDocument(proxy)) |
| 2562 | { |
| 2563 | UBApplication::showMessage(tr("Opening document in Board. Please wait..."), true); |
| 2564 | mBoardController->setActiveDocumentScene(proxy); |
| 2565 | UBApplication::applicationController->showBoard(); |
| 2566 | } |
| 2567 | } |
| 2568 | |
| 2569 | UBApplication::showMessage(tr("Document opened successfully"), false); |
| 2570 | |
| 2571 | QApplication::restoreOverrideCursor(); |
| 2572 | } |
| 2573 | |
| 2574 | void UBDocumentController::duplicateSelectedItem() |
| 2575 | { |
nothing calls this directly
no test coverage detected