Fixed: #2572 (GUI: Disable all UI actions on Recheck)

This commit is contained in:
Erik Lax 2011-02-11 21:08:37 +02:00 committed by Kimmo Varis
parent a1c1234596
commit eddbfbee1e
2 changed files with 19 additions and 7 deletions

View File

@ -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

View File

@ -206,6 +206,12 @@ protected slots:
*/
void CheckDone();
/**
* @brief Lock down UI while checking
*
*/
void CheckLockDownUI();
/**
* @brief Slot for enabling save and clear button
*