| 706 | |
| 707 | |
| 708 | void UBApplicationController::importFile(const QString& pFilePath) |
| 709 | { |
| 710 | const QFile fileToOpen(pFilePath); |
| 711 | |
| 712 | if (!fileToOpen.exists()) |
| 713 | return; |
| 714 | |
| 715 | bool success = false; |
| 716 | |
| 717 | std::shared_ptr<UBDocumentProxy> document = UBDocumentManager::documentManager()->importFile(fileToOpen, ""); |
| 718 | |
| 719 | success = (document != 0); |
| 720 | |
| 721 | if (success && document) |
| 722 | { |
| 723 | if (UBApplication::boardController) |
| 724 | { |
| 725 | UBApplication::boardController->setActiveDocumentScene(document, 0, true, true); |
| 726 | } |
| 727 | |
| 728 | if (UBApplication::documentController) |
| 729 | { |
| 730 | UBApplication::documentController->selectDocument(document, true, true); |
| 731 | } |
| 732 | |
| 733 | // This import operation happens when double-clicking on a UBZ for example. |
| 734 | // The document is added and set as current document, so the user probably wants to see it immediately. |
| 735 | showBoard(); |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | void UBApplicationController::useMultiScreen(bool use) |
| 740 | { |
nothing calls this directly
no test coverage detected