From 5a65f4d55d3943700e99485fa9921c37662cf7ae Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Thu, 19 Aug 2010 22:28:56 +0300 Subject: [PATCH] GUI: Prevent opening new files or directories when project file loaded. --- gui/mainwindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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