Fixed #7294 (GUI: Add option in 'Settings' for 'Statistics Dialog' display.)

This commit is contained in:
Akhilesh Nema 2016-01-16 17:43:57 +01:00 committed by Daniel Marjamäki
parent 06ded4a3d4
commit efff2c5397
5 changed files with 14 additions and 2 deletions

View File

@ -84,6 +84,7 @@
#define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors" #define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors"
#define SETTINGS_MRU_PROJECTS "MRU Projects" #define SETTINGS_MRU_PROJECTS "MRU Projects"
#define SETTINGS_SHOW_ERROR_ID "Show error Id" #define SETTINGS_SHOW_ERROR_ID "Show error Id"
#define SETTINGS_SHOW_STATISTICS "Show statistics"
// The maximum value for the progress bar // The maximum value for the progress bar
#define PROGRESS_MAX 1024.0 #define PROGRESS_MAX 1024.0

View File

@ -763,7 +763,8 @@ void MainWindow::CheckDone()
// Notify user - if the window is not active - that check is ready // Notify user - if the window is not active - that check is ready
QApplication::alert(this, 3000); QApplication::alert(this, 3000);
ShowStatistics(); if (mSettings->value(SETTINGS_SHOW_STATISTICS, false).toBool())
ShowStatistics();
} }
void MainWindow::CheckLockDownUI() void MainWindow::CheckLockDownUI()

View File

@ -571,7 +571,7 @@ private:
bool mExiting; bool mExiting;
/** /**
* @brief Set in case of loading project file. * @brief Set to true in case of loading log file.
*/ */
bool mIsLogfileLoaded; bool mIsLogfileLoaded;

View File

@ -150,6 +150,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="mShowStatistics">
<property name="text">
<string>Show statistics on check completion</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
@ -372,6 +379,7 @@
<tabstop>mSaveFullPath</tabstop> <tabstop>mSaveFullPath</tabstop>
<tabstop>mListLanguages</tabstop> <tabstop>mListLanguages</tabstop>
<tabstop>mEnableInconclusive</tabstop> <tabstop>mEnableInconclusive</tabstop>
<tabstop>mShowStatistics</tabstop>
<tabstop>mShowDebugWarnings</tabstop> <tabstop>mShowDebugWarnings</tabstop>
<tabstop>mButtons</tabstop> <tabstop>mButtons</tabstop>
</tabstops> </tabstops>

View File

@ -51,6 +51,7 @@ SettingsDialog::SettingsDialog(ApplicationList *list,
mUI.mSaveFullPath->setCheckState(BoolToCheckState(settings.value(SETTINGS_SAVE_FULL_PATH, false).toBool())); mUI.mSaveFullPath->setCheckState(BoolToCheckState(settings.value(SETTINGS_SAVE_FULL_PATH, false).toBool()));
mUI.mInlineSuppressions->setCheckState(BoolToCheckState(settings.value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool())); mUI.mInlineSuppressions->setCheckState(BoolToCheckState(settings.value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool()));
mUI.mEnableInconclusive->setCheckState(BoolToCheckState(settings.value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool())); mUI.mEnableInconclusive->setCheckState(BoolToCheckState(settings.value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool()));
mUI.mShowStatistics->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_STATISTICS, false).toBool()));
mUI.mShowErrorId->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_ERROR_ID, false).toBool())); mUI.mShowErrorId->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_ERROR_ID, false).toBool()));
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok())); connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok()));
@ -173,6 +174,7 @@ void SettingsDialog::SaveSettingValues() const
SaveCheckboxValue(&settings, mUI.mShowDebugWarnings, SETTINGS_SHOW_DEBUG_WARNINGS); SaveCheckboxValue(&settings, mUI.mShowDebugWarnings, SETTINGS_SHOW_DEBUG_WARNINGS);
SaveCheckboxValue(&settings, mUI.mInlineSuppressions, SETTINGS_INLINE_SUPPRESSIONS); SaveCheckboxValue(&settings, mUI.mInlineSuppressions, SETTINGS_INLINE_SUPPRESSIONS);
SaveCheckboxValue(&settings, mUI.mEnableInconclusive, SETTINGS_INCONCLUSIVE_ERRORS); SaveCheckboxValue(&settings, mUI.mEnableInconclusive, SETTINGS_INCONCLUSIVE_ERRORS);
SaveCheckboxValue(&settings, mUI.mShowStatistics, SETTINGS_SHOW_STATISTICS);
SaveCheckboxValue(&settings, mUI.mShowErrorId, SETTINGS_SHOW_ERROR_ID); SaveCheckboxValue(&settings, mUI.mShowErrorId, SETTINGS_SHOW_ERROR_ID);
const QListWidgetItem *currentLang = mUI.mListLanguages->currentItem(); const QListWidgetItem *currentLang = mUI.mListLanguages->currentItem();