| 48 QString errorString; |
48 QString errorString; |
| 49 QTextStream errorStream{&errorString}; |
49 QTextStream errorStream{&errorString}; |
| 50 const std::optional<ModelId> modelIdOpt = documents->openModel( |
50 const std::optional<ModelId> modelIdOpt = documents->openModel( |
| 51 path, |
51 path, |
| 52 errorStream, |
52 errorStream, |
| 53 DocumentManager::OpenType::ManuallyOpened); |
53 OpenType::ManuallyOpened); |
| 54 if (modelIdOpt.has_value()) { |
54 if (modelIdOpt.has_value()) { |
| 55 documents->loadDependenciesForModel(modelIdOpt.value(), path, *libraries, errorStream); |
55 const DocumentManager::MissingDependencies missing = documents->loadDependenciesForAllModels(*libraries); |
| 56 if (not errorString.isEmpty()) { |
56 if (not missing.empty()) { |
| 57 QMessageBox::warning( |
57 QMessageBox::warning( |
| 58 parent, |
58 parent, |
| 59 QObject::tr("Problem loading references"), |
59 QObject::tr("Problem loading references"), |
| 60 errorString); |
60 errorStringFromMissingDependencies(missing)); |
| 61 } |
61 } |
| 62 } |
62 } |
| 63 else { |
63 else { |
| 64 QMessageBox::critical( |
64 QMessageBox::critical( |
| 65 parent, |
65 parent, |
| 284 { |
284 { |
| 285 doQtRegistrations(); |
285 doQtRegistrations(); |
| 286 QApplication app{argc, argv}; |
286 QApplication app{argc, argv}; |
| 287 QMainWindow mainWindow; |
287 QMainWindow mainWindow; |
| 288 Ui_MainWindow ui; |
288 Ui_MainWindow ui; |
| 289 DocumentManager documents{&mainWindow}; |
289 DocumentManager documents; |
| 290 QString currentLanguage = "en"; |
290 QString currentLanguage = "en"; |
| 291 QTranslator translator{&mainWindow}; |
291 QTranslator translator{&mainWindow}; |
| 292 Configuration settings; |
292 Configuration settings; |
| 293 LibraryManager libraries{&mainWindow}; |
293 LibraryManager libraries{&mainWindow}; |
| 294 QByteArray documentSplitterState; |
294 QByteArray documentSplitterState; |