From 74960d64727bf6dec3d363a9ef90969c8053a074 Mon Sep 17 00:00:00 2001 From: LoudSnorer Date: Thu, 23 Feb 2023 18:36:26 -0500 Subject: [PATCH] Add message for import error when no loaders are found --- oscar/mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 32dda11f..be5e18bd 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -1154,14 +1154,21 @@ QList MainWindow::selectCPAPDataCards(const QString & prompt, bool a } + bool found=false; for (int i = 0; i < w.selectedFiles().size(); i++) { Q_FOREACH(MachineLoader * loader, loaders) { if (loader->Detect(w.selectedFiles().at(i))) { + found=true; datacards.append(ImportPath(w.selectedFiles().at(i), loader)); break; } } } + if (!found) { + QMessageBox msgBox ( QMessageBox::Information , tr("OSCAR Information") , tr("No supported data was found") , QMessageBox::Ok ) ; + msgBox.setInformativeText(w.selectedFiles().at(0)); + msgBox.exec(); + } } return datacards;