diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 1a0437434..e35955017 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -252,6 +252,17 @@ void MainWindow::DoCheckFiles(const QStringList &files) QStringList MainWindow::SelectFilesToCheck(QFileDialog::FileMode mode) { + if (mProject) + { + QMessageBox msgBox(this); + msgBox.setWindowTitle(tr("Cppcheck")); + const QString msg(tr("You must close the project file before selecting new files or directories!")); + msgBox.setText(msg); + msgBox.setIcon(QMessageBox::Critical); + msgBox.exec(); + return QStringList(); + } + QStringList selected; // NOTE: we use QFileDialog::getOpenFileNames() and