GUI: Prevent opening new files or directories when project file loaded.

This commit is contained in:
Kimmo Varis 2010-08-19 22:28:56 +03:00
parent 2da6a242d2
commit 5a65f4d55d
1 changed files with 11 additions and 0 deletions

View File

@ -252,6 +252,17 @@ void MainWindow::DoCheckFiles(const QStringList &files)
QStringList MainWindow::SelectFilesToCheck(QFileDialog::FileMode mode) 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; QStringList selected;
// NOTE: we use QFileDialog::getOpenFileNames() and // NOTE: we use QFileDialog::getOpenFileNames() and