From eddbfbee1eb7480e171179e58a1f3f1b9eadb936 Mon Sep 17 00:00:00 2001 From: Erik Lax Date: Fri, 11 Feb 2011 21:08:37 +0200 Subject: [PATCH] Fixed: #2572 (GUI: Disable all UI actions on Recheck) --- gui/mainwindow.cpp | 20 +++++++++++++------- gui/mainwindow.h | 6 ++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index bd32a1334..c7b966b6e 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -213,14 +213,11 @@ void MainWindow::DoCheckFiles(const QStringList &files) QDir inf(mCurrentDirectory); const QString checkPath = inf.canonicalPath(); mSettings->setValue(SETTINGS_CHECK_PATH, checkPath); - EnableCheckButtons(false); - mUI.mActionSettings->setEnabled(false); - mUI.mActionOpenXML->setEnabled(false); - mUI.mResults->SetCheckDirectory(checkPath); + CheckLockDownUI(); // lock UI while checking + + mUI.mResults->SetCheckDirectory(checkPath); Settings checkSettings = GetCppcheckSettings(); - EnableProjectActions(false); - EnableProjectOpenActions(false); mThread->Check(checkSettings, false); } @@ -400,6 +397,15 @@ void MainWindow::CheckDone() QApplication::alert(this, 3000); } +void MainWindow::CheckLockDownUI() +{ + EnableCheckButtons(false); + mUI.mActionSettings->setEnabled(false); + mUI.mActionOpenXML->setEnabled(false); + EnableProjectActions(false); + EnableProjectOpenActions(false); +} + void MainWindow::ProgramSettings() { SettingsDialog dialog(mSettings, mApplications, mTranslation, this); @@ -418,7 +424,7 @@ void MainWindow::ProgramSettings() void MainWindow::ReCheck() { ClearResults(); - EnableCheckButtons(false); + CheckLockDownUI(); // lock UI while checking const int filesCount = mThread->GetPreviousFilesCount(); Q_ASSERT(filesCount > 0); // If no files should not be able to recheck diff --git a/gui/mainwindow.h b/gui/mainwindow.h index ea844a287..9e3361c05 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -206,6 +206,12 @@ protected slots: */ void CheckDone(); + /** + * @brief Lock down UI while checking + * + */ + void CheckLockDownUI(); + /** * @brief Slot for enabling save and clear button *