Cppcheck
|
#include <settingsdialog.h>
Public Member Functions | |
SettingsDialog (ApplicationList *list, TranslationHandler *translator, bool premium, QWidget *parent=nullptr) | |
SettingsDialog (const SettingsDialog &)=delete | |
~SettingsDialog () override | |
SettingsDialog & | operator= (const SettingsDialog &)=delete |
void | saveSettingValues () const |
Save all values to QSettings. More... | |
bool | showFullPath () const |
Get checkbox value for mShowFullPath. More... | |
bool | saveFullPath () const |
Get checkbox value for mSaveFullPath. More... | |
bool | showNoErrorsMessage () const |
Get checkbox value for mNoErrorsMessage. More... | |
bool | showErrorId () const |
Get checkbox value for mShowIdColumn. More... | |
bool | showInconclusive () const |
Get checkbox value for mEnableInconclusive. More... | |
bool | saveAllErrors () const |
Get checkbox value for mSaveAllErrors. More... | |
Protected Slots | |
void | ok () |
Slot for clicking OK. More... | |
void | validateEditPythonPath () |
Slot for validating input value in editPythonPath . More... | |
void | addApplication () |
Slot for adding a new application to the list. More... | |
void | removeApplication () |
Slot for deleting an application from the list. More... | |
void | editApplication () |
Slot for modifying an application in the list. More... | |
void | defaultApplication () |
Slot for making the selected application as the default (first) More... | |
void | browsePythonPath () |
Slot for browsing for the python binary. More... | |
void | browseClangPath () |
Slot for browsing for the clang binary. More... | |
void | browseMisraFile () |
Browse for MISRA file. More... | |
void | setCodeEditorStyleDefault () |
Set Code Editor Style to Default. More... | |
void | editCodeEditorStyle () |
Edit Custom Code Editor Style. More... | |
Protected Member Functions | |
void | populateApplicationList () |
Clear all applications from the list and re insert them from mTempApplications. More... | |
void | loadSettings () |
Load saved values Loads dialog size and column widths. More... | |
void | saveSettings () const |
Save settings Save dialog size and column widths. More... | |
void | initTranslationsList () |
Populate the translations list. More... | |
Static Protected Member Functions | |
static void | saveCheckboxValue (QSettings *settings, const QCheckBox *box, const QString &name) |
Save a single checkboxes value. More... | |
static Qt::CheckState | boolToCheckState (bool yes) |
Convert bool to Qt::CheckState. More... | |
static bool | checkStateToBool (Qt::CheckState state) |
Converts Qt::CheckState to bool. More... | |
Protected Attributes | |
CodeEditorStyle * | mCurrentStyle |
Current Code Editor Style. More... | |
ApplicationList * | mApplications |
List of applications user has specified. More... | |
ApplicationList * | mTempApplications |
Temporary list of applications This will be copied to actual list of applications (mApplications) when user clicks ok. More... | |
TranslationHandler * | mTranslator |
List of translations. More... | |
Ui::Settings * | mUI |
Dialog from UI designer. More... | |
Private Member Functions | |
void | manageStyleControls () |
Private Attributes | |
bool | mPremium |
Static Private Attributes | |
static constexpr int | mLangCodeRole = Qt::UserRole |
Settings dialog.
Definition at line 45 of file settingsdialog.h.
SettingsDialog::SettingsDialog | ( | ApplicationList * | list, |
TranslationHandler * | translator, | ||
bool | premium, | ||
QWidget * | parent = nullptr |
||
) |
Definition at line 50 of file settingsdialog.cpp.
References addApplication(), boolToCheckState(), browseClangPath(), browseMisraFile(), browsePythonPath(), ApplicationList::copy(), defaultApplication(), editApplication(), editCodeEditorStyle(), initTranslationsList(), loadSettings(), CodeEditorStyle::loadSettings(), manageStyleControls(), mCurrentStyle, mTempApplications, mUI, ok(), populateApplicationList(), removeApplication(), setCodeEditorStyleDefault(), SETTINGS_CHECK_FOR_UPDATES, SETTINGS_CHECK_FORCE, SETTINGS_CHECK_THREADS, SETTINGS_CLANG_PATH, SETTINGS_INCONCLUSIVE_ERRORS, SETTINGS_INLINE_SUPPRESSIONS, SETTINGS_MISRA_FILE, SETTINGS_PYTHON_PATH, SETTINGS_SAVE_ALL_ERRORS, SETTINGS_SAVE_FULL_PATH, SETTINGS_SHOW_DEBUG_WARNINGS, SETTINGS_SHOW_ERROR_ID, SETTINGS_SHOW_FULL_PATH, SETTINGS_SHOW_NO_ERRORS, SETTINGS_SHOW_STATISTICS, SETTINGS_VS_INCLUDE_PATHS, toString(), and validateEditPythonPath().
|
delete |
|
override |
Definition at line 132 of file settingsdialog.cpp.
References mCurrentStyle, mUI, and saveSettings().
|
protectedslot |
Slot for adding a new application to the list.
Definition at line 245 of file settingsdialog.cpp.
References ApplicationList::addApplication(), Application::getName(), mTempApplications, and mUI.
Referenced by SettingsDialog().
|
staticprotected |
Convert bool to Qt::CheckState.
yes | value to convert |
Definition at line 152 of file settingsdialog.cpp.
Referenced by SettingsDialog().
|
protectedslot |
Slot for browsing for the clang binary.
Definition at line 398 of file settingsdialog.cpp.
References mUI.
Referenced by SettingsDialog().
|
protectedslot |
Browse for MISRA file.
Definition at line 368 of file settingsdialog.cpp.
References mUI.
Referenced by SettingsDialog().
|
protectedslot |
Slot for browsing for the python binary.
Definition at line 361 of file settingsdialog.cpp.
References mUI.
Referenced by SettingsDialog().
|
staticprotected |
Converts Qt::CheckState to bool.
state | Qt::CheckState to convert |
Definition at line 160 of file settingsdialog.cpp.
Referenced by saveAllErrors(), saveCheckboxValue(), saveFullPath(), showErrorId(), showFullPath(), showInconclusive(), and showNoErrorsMessage().
|
protectedslot |
Slot for making the selected application as the default (first)
Definition at line 289 of file settingsdialog.cpp.
References mTempApplications, mUI, populateApplicationList(), and ApplicationList::setDefault().
Referenced by SettingsDialog().
|
protectedslot |
Slot for modifying an application in the list.
Definition at line 273 of file settingsdialog.cpp.
References ApplicationList::getApplication(), ApplicationList::getDefaultApplication(), Application::getName(), mTempApplications, and mUI.
Referenced by SettingsDialog().
|
protectedslot |
Edit Custom Code Editor Style.
Definition at line 388 of file settingsdialog.cpp.
References StyleEditDialog::getStyle(), manageStyleControls(), and mCurrentStyle.
Referenced by SettingsDialog().
|
protected |
Populate the translations list.
Definition at line 139 of file settingsdialog.cpp.
References TranslationHandler::getCurrentLanguage(), TranslationHandler::getTranslations(), mLangCodeRole, mTranslator, and mUI.
Referenced by SettingsDialog().
|
protected |
Load saved values Loads dialog size and column widths.
Definition at line 166 of file settingsdialog.cpp.
References SETTINGS_CHECK_DIALOG_HEIGHT, and SETTINGS_CHECK_DIALOG_WIDTH.
Referenced by SettingsDialog().
|
private |
Definition at line 409 of file settingsdialog.cpp.
References defaultStyleDark(), defaultStyleLight(), CodeEditorStyle::isSystemTheme(), mCurrentStyle, and mUI.
Referenced by editCodeEditorStyle(), setCodeEditorStyleDefault(), and SettingsDialog().
|
protectedslot |
Slot for clicking OK.
Definition at line 325 of file settingsdialog.cpp.
References ApplicationList::copy(), mApplications, and mTempApplications.
Referenced by SettingsDialog().
|
delete |
|
protected |
Clear all applications from the list and re insert them from mTempApplications.
Definition at line 300 of file settingsdialog.cpp.
References ApplicationList::getApplication(), ApplicationList::getApplicationCount(), ApplicationList::getDefaultApplication(), Application::getName(), mTempApplications, and mUI.
Referenced by defaultApplication(), removeApplication(), and SettingsDialog().
|
protectedslot |
Slot for deleting an application from the list.
Definition at line 256 of file settingsdialog.cpp.
References ApplicationList::getDefaultApplication(), mTempApplications, mUI, populateApplicationList(), ApplicationList::removeApplication(), and ApplicationList::setDefault().
Referenced by SettingsDialog().
bool SettingsDialog::saveAllErrors | ( | ) | const |
Get checkbox value for mSaveAllErrors.
Definition at line 341 of file settingsdialog.cpp.
References checkStateToBool(), and mUI.
Referenced by MainWindow::programSettings().
|
staticprotected |
Save a single checkboxes value.
settings | Pointer to Settings. |
box | checkbox to save |
name | name for QSettings to store the value |
Definition at line 217 of file settingsdialog.cpp.
References checkStateToBool().
Referenced by saveSettingValues().
bool SettingsDialog::saveFullPath | ( | ) | const |
Get checkbox value for mSaveFullPath.
Definition at line 336 of file settingsdialog.cpp.
References checkStateToBool(), and mUI.
Referenced by MainWindow::programSettings().
|
protected |
Save settings Save dialog size and column widths.
Definition at line 173 of file settingsdialog.cpp.
References SETTINGS_CHECK_DIALOG_HEIGHT, and SETTINGS_CHECK_DIALOG_WIDTH.
Referenced by ~SettingsDialog().
void SettingsDialog::saveSettingValues | ( | ) | const |
Save all values to QSettings.
Definition at line 180 of file settingsdialog.cpp.
References mCurrentStyle, mLangCodeRole, mPremium, mUI, saveCheckboxValue(), CodeEditorStyle::saveSettings(), SETTINGS_CHECK_FOR_UPDATES, SETTINGS_CHECK_FORCE, SETTINGS_CHECK_THREADS, SETTINGS_CLANG_PATH, SETTINGS_INCONCLUSIVE_ERRORS, SETTINGS_INLINE_SUPPRESSIONS, SETTINGS_LANGUAGE, SETTINGS_MISRA_FILE, SETTINGS_PYTHON_PATH, SETTINGS_SAVE_ALL_ERRORS, SETTINGS_SAVE_FULL_PATH, SETTINGS_SHOW_DEBUG_WARNINGS, SETTINGS_SHOW_ERROR_ID, SETTINGS_SHOW_FULL_PATH, SETTINGS_SHOW_NO_ERRORS, SETTINGS_SHOW_STATISTICS, and SETTINGS_VS_INCLUDE_PATHS.
Referenced by MainWindow::programSettings().
|
protectedslot |
Set Code Editor Style to Default.
Definition at line 376 of file settingsdialog.cpp.
References defaultStyleDark(), defaultStyleLight(), CodeEditorStyle::getSystemTheme(), manageStyleControls(), mCurrentStyle, and mUI.
Referenced by SettingsDialog().
bool SettingsDialog::showErrorId | ( | ) | const |
Get checkbox value for mShowIdColumn.
Definition at line 351 of file settingsdialog.cpp.
References checkStateToBool(), and mUI.
Referenced by MainWindow::programSettings().
bool SettingsDialog::showFullPath | ( | ) | const |
Get checkbox value for mShowFullPath.
Definition at line 331 of file settingsdialog.cpp.
References checkStateToBool(), and mUI.
Referenced by MainWindow::programSettings().
bool SettingsDialog::showInconclusive | ( | ) | const |
Get checkbox value for mEnableInconclusive.
Definition at line 356 of file settingsdialog.cpp.
References checkStateToBool(), and mUI.
Referenced by MainWindow::programSettings().
bool SettingsDialog::showNoErrorsMessage | ( | ) | const |
Get checkbox value for mNoErrorsMessage.
Definition at line 346 of file settingsdialog.cpp.
References checkStateToBool(), and mUI.
Referenced by MainWindow::programSettings().
|
protectedslot |
Slot for validating input value in editPythonPath
.
Definition at line 223 of file settingsdialog.cpp.
References mUI.
Referenced by SettingsDialog().
|
protected |
List of applications user has specified.
Definition at line 220 of file settingsdialog.h.
Referenced by ok().
|
protected |
Current Code Editor Style.
Definition at line 214 of file settingsdialog.h.
Referenced by editCodeEditorStyle(), manageStyleControls(), saveSettingValues(), setCodeEditorStyleDefault(), SettingsDialog(), and ~SettingsDialog().
|
staticconstexprprivate |
Definition at line 243 of file settingsdialog.h.
Referenced by initTranslationsList(), and saveSettingValues().
|
private |
Definition at line 245 of file settingsdialog.h.
Referenced by saveSettingValues().
|
protected |
Temporary list of applications This will be copied to actual list of applications (mApplications) when user clicks ok.
Definition at line 227 of file settingsdialog.h.
Referenced by addApplication(), defaultApplication(), editApplication(), ok(), populateApplicationList(), removeApplication(), and SettingsDialog().
|
protected |
List of translations.
Definition at line 233 of file settingsdialog.h.
Referenced by initTranslationsList().
|
protected |
Dialog from UI designer.
Definition at line 239 of file settingsdialog.h.
Referenced by addApplication(), browseClangPath(), browseMisraFile(), browsePythonPath(), defaultApplication(), editApplication(), initTranslationsList(), manageStyleControls(), populateApplicationList(), removeApplication(), saveAllErrors(), saveFullPath(), saveSettingValues(), setCodeEditorStyleDefault(), SettingsDialog(), showErrorId(), showFullPath(), showInconclusive(), showNoErrorsMessage(), validateEditPythonPath(), and ~SettingsDialog().