Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions gui/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
#define SETTINGS_SHOW_INFORMATION "Show information"
#define SETTINGS_SHOW_PORTABILITY "Show portability"

// Standards support
#define SETTINGS_STD_CPP11 "Platform CPP11"
#define SETTINGS_STD_C99 "Platform C99"
#define SETTINGS_STD_POSIX "Platform Posix"

// Other settings
#define SETTINGS_CHECK_PATH "Check path"
#define SETTINGS_CHECK_FORCE "Check force"
Expand Down
8 changes: 4 additions & 4 deletions gui/gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ HEADERS += aboutdialog.h \
resultstree.h \
resultsview.h \
settingsdialog.h \
showtypes.h \
statsdialog.h \
threadhandler.h \
threadresult.h \
translationhandler.h \
txtreport.h \
xmlreport.h \
xmlreportv1.h \
xmlreportv2.h \
showtypes.h
xmlreportv2.h

SOURCES += aboutdialog.cpp \
application.cpp \
Expand All @@ -102,15 +102,15 @@ SOURCES += aboutdialog.cpp \
resultstree.cpp \
resultsview.cpp \
settingsdialog.cpp \
showtypes.cpp \
statsdialog.cpp \
threadhandler.cpp \
threadresult.cpp \
translationhandler.cpp \
txtreport.cpp \
xmlreport.cpp \
xmlreportv1.cpp \
xmlreportv2.cpp \
showtypes.cpp
xmlreportv2.cpp

win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS
Expand Down
28 changes: 28 additions & 0 deletions gui/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@
<addaction name="mActionRecheck"/>
<addaction name="mActionStop"/>
<addaction name="separator"/>
<addaction name="mActionCplusplus11"/>
<addaction name="mActionC99"/>
<addaction name="mActionPosix"/>
<addaction name="separator"/>
<addaction name="mActionPlatforms"/>
</widget>
<widget class="QMenu" name="mMenuEdit">
Expand Down Expand Up @@ -602,6 +606,30 @@
<bool>false</bool>
</property>
</action>
<action name="mActionCplusplus11">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>C++11</string>
</property>
</action>
<action name="mActionC99">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>C99</string>
</property>
</action>
<action name="mActionPosix">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Posix</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down
21 changes: 21 additions & 0 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ void MainWindow::LoadSettings()
mUI.mActionShowPerformance->setChecked(types->isShown(ShowTypes::ShowPerformance));
mUI.mActionShowInformation->setChecked(types->isShown(ShowTypes::ShowInformation));

const bool stdCpp11 = mSettings->value(SETTINGS_STD_CPP11, false).toBool();
mUI.mActionCplusplus11->setChecked(stdCpp11);
const bool stdC99 = mSettings->value(SETTINGS_STD_C99, false).toBool();
mUI.mActionC99->setChecked(stdC99);
const bool stdPosix = mSettings->value(SETTINGS_STD_POSIX, false).toBool();
mUI.mActionPosix->setChecked(stdPosix);

// Main window settings
const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool();
mUI.mActionToolBarMain->setChecked(showMainToolbar);
Expand Down Expand Up @@ -263,6 +270,10 @@ void MainWindow::SaveSettings()
mSettings->setValue(SETTINGS_SHOW_PERFORMANCE, mUI.mActionShowPerformance->isChecked());
mSettings->setValue(SETTINGS_SHOW_INFORMATION, mUI.mActionShowInformation->isChecked());

mSettings->setValue(SETTINGS_STD_CPP11, mUI.mActionCplusplus11->isChecked());
mSettings->setValue(SETTINGS_STD_C99, mUI.mActionC99->isChecked());
mSettings->setValue(SETTINGS_STD_POSIX, mUI.mActionPosix->isChecked());

// Main window settings
mSettings->setValue(SETTINGS_TOOLBARS_MAIN_SHOW, mUI.mToolBarMain->isVisible());
mSettings->setValue(SETTINGS_TOOLBARS_VIEW_SHOW, mUI.mToolBarView->isVisible());
Expand Down Expand Up @@ -484,6 +495,9 @@ Settings MainWindow::GetCppcheckSettings()
result._inlineSuppressions = mSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool();
result.inconclusive = mSettings->value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool();
result.platformType = (Settings::PlatformType) mSettings->value(SETTINGS_CHECKED_PLATFORM, 0).toInt();
result.standards.cpp11 = mSettings->value(SETTINGS_STD_CPP11, false).toBool();
result.standards.c99 = mSettings->value(SETTINGS_STD_C99, false).toBool();
result.standards.posix = mSettings->value(SETTINGS_STD_POSIX, false).toBool();

if (result._jobs <= 0) {
result._jobs = 1;
Expand All @@ -506,6 +520,10 @@ void MainWindow::CheckDone()
EnableProjectActions(true);
EnableProjectOpenActions(true);
mPlatformActions->setEnabled(true);
mUI.mActionCplusplus11->setEnabled(true);
mUI.mActionC99->setEnabled(true);
mUI.mActionPosix->setEnabled(true);


if (mUI.mResults->HasResults()) {
mUI.mActionClearResults->setEnabled(true);
Expand All @@ -524,6 +542,9 @@ void MainWindow::CheckLockDownUI()
EnableProjectActions(false);
EnableProjectOpenActions(false);
mPlatformActions->setEnabled(false);
mUI.mActionCplusplus11->setEnabled(false);
mUI.mActionC99->setEnabled(false);
mUI.mActionPosix->setEnabled(false);
}

void MainWindow::ProgramSettings()
Expand Down