src/main.cpp

changeset 212
27259810da6d
parent 206
654661eab7f3
child 214
8e1fe64ce4e3
--- a/src/main.cpp	Thu Jun 09 19:11:27 2022 +0300
+++ b/src/main.cpp	Sat Jun 11 14:30:30 2022 +0300
@@ -50,14 +50,14 @@
 	const std::optional<ModelId> modelIdOpt = documents->openModel(
 		path,
 		errorStream,
-		DocumentManager::OpenType::ManuallyOpened);
+		OpenType::ManuallyOpened);
 	if (modelIdOpt.has_value()) {
-		documents->loadDependenciesForModel(modelIdOpt.value(), path, *libraries, errorStream);
-		if (not errorString.isEmpty()) {
+		const DocumentManager::MissingDependencies missing = documents->loadDependenciesForAllModels(*libraries);
+		if (not missing.empty()) {
 			QMessageBox::warning(
 				parent,
 				QObject::tr("Problem loading references"),
-				errorString);
+				errorStringFromMissingDependencies(missing));
 		}
 	}
 	else {
@@ -286,7 +286,7 @@
 	QApplication app{argc, argv};
 	QMainWindow mainWindow;
 	Ui_MainWindow ui;
-	DocumentManager documents{&mainWindow};
+	DocumentManager documents;
 	QString currentLanguage = "en";
 	QTranslator translator{&mainWindow};
 	Configuration settings;

mercurial