summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/WarningMessagesDialog.cxx
diff options
context:
space:
mode:
authorMichael Scott <michael.scott250@gmail.com>2015-12-26 16:04:13 (GMT)
committerBrad King <brad.king@kitware.com>2016-01-12 19:03:32 (GMT)
commit821667018cc0ea049c52647b507d1a8e4bbe2c3a (patch)
tree21dc6a6724338284e9d085905183cf29abe5c7a8 /Source/QtDialog/WarningMessagesDialog.cxx
parent28f2d750edaf6ee1af660d3a0ae6792c65c47997 (diff)
downloadCMake-821667018cc0ea049c52647b507d1a8e4bbe2c3a.zip
CMake-821667018cc0ea049c52647b507d1a8e4bbe2c3a.tar.gz
CMake-821667018cc0ea049c52647b507d1a8e4bbe2c3a.tar.bz2
cmake-gui: Add options to control warning-as-error messages
Add new widgets to the warning messages dialog to control treating warnings as errors.
Diffstat (limited to 'Source/QtDialog/WarningMessagesDialog.cxx')
-rw-r--r--Source/QtDialog/WarningMessagesDialog.cxx56
1 files changed, 56 insertions, 0 deletions
diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx
index 735b71c..4bd541f 100644
--- a/Source/QtDialog/WarningMessagesDialog.cxx
+++ b/Source/QtDialog/WarningMessagesDialog.cxx
@@ -26,12 +26,27 @@ void WarningMessagesDialog::setInitialValues()
this->cmakeInstance->getSuppressDevWarnings());
this->suppressDeprecatedWarnings->setChecked(
this->cmakeInstance->getSuppressDeprecatedWarnings());
+
+ this->developerWarningsAsErrors->setChecked(
+ this->cmakeInstance->getDevWarningsAsErrors());
+ this->deprecatedWarningsAsErrors->setChecked(
+ this->cmakeInstance->getDeprecatedWarningsAsErrors());
}
void WarningMessagesDialog::setupSignals()
{
QObject::connect(this->buttonBox, SIGNAL(accepted()),
this, SLOT(doAccept()));
+
+ QObject::connect(this->suppressDeveloperWarnings, SIGNAL(stateChanged(int)),
+ this, SLOT(doSuppressDeveloperWarningsChanged(int)));
+ QObject::connect(this->suppressDeprecatedWarnings, SIGNAL(stateChanged(int)),
+ this, SLOT(doSuppressDeprecatedWarningsChanged(int)));
+
+ QObject::connect(this->developerWarningsAsErrors, SIGNAL(stateChanged(int)),
+ this, SLOT(doDeveloperWarningsAsErrorsChanged(int)));
+ QObject::connect(this->deprecatedWarningsAsErrors, SIGNAL(stateChanged(int)),
+ this, SLOT(doDeprecatedWarningsAsErrorsChanged(int)));
}
void WarningMessagesDialog::doAccept()
@@ -40,4 +55,45 @@ void WarningMessagesDialog::doAccept()
this->suppressDeveloperWarnings->isChecked());
this->cmakeInstance->setSuppressDeprecatedWarnings(
this->suppressDeprecatedWarnings->isChecked());
+
+ this->cmakeInstance->setDevWarningsAsErrors(
+ this->developerWarningsAsErrors->isChecked());
+ this->cmakeInstance->setDeprecatedWarningsAsErrors(
+ this->deprecatedWarningsAsErrors->isChecked());
+}
+
+void WarningMessagesDialog::doSuppressDeveloperWarningsChanged(int state)
+{
+ // no warnings implies no errors either
+ if (state)
+ {
+ this->developerWarningsAsErrors->setChecked(false);
+ }
+}
+
+void WarningMessagesDialog::doSuppressDeprecatedWarningsChanged(int state)
+{
+ // no warnings implies no errors either
+ if (state)
+ {
+ this->deprecatedWarningsAsErrors->setChecked(false);
+ }
+}
+
+void WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged(int state)
+{
+ // warnings as errors implies warnings are not suppressed
+ if (state)
+ {
+ this->suppressDeveloperWarnings->setChecked(false);
+ }
+}
+
+void WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged(int state)
+{
+ // warnings as errors implies warnings are not suppressed
+ if (state)
+ {
+ this->suppressDeprecatedWarnings->setChecked(false);
+ }
}