diff options
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 20 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.h | 8 | ||||
-rw-r--r-- | Source/QtDialog/WarningMessagesDialog.cxx | 56 | ||||
-rw-r--r-- | Source/QtDialog/WarningMessagesDialog.h | 22 | ||||
-rw-r--r-- | Source/QtDialog/WarningMessagesDialog.ui | 57 |
5 files changed, 161 insertions, 2 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 71b7940685..dd7c1387a0 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -475,6 +475,26 @@ void QCMake::setSuppressDeprecatedWarnings(bool value) this->CMakeInstance->SetSuppressDeprecatedWarnings(value); } +bool QCMake::getDevWarningsAsErrors() +{ + return this->CMakeInstance->GetDevWarningsAsErrors(); +} + +void QCMake::setDevWarningsAsErrors(bool value) +{ + this->CMakeInstance->SetDevWarningsAsErrors(value); +} + +bool QCMake::getDeprecatedWarningsAsErrors() +{ + return this->CMakeInstance->GetDeprecatedWarningsAsErrors(); +} + +void QCMake::setDeprecatedWarningsAsErrors(bool value) +{ + this->CMakeInstance->SetDeprecatedWarningsAsErrors(value); +} + void QCMake::setWarnUninitializedMode(bool value) { this->WarnUninitializedMode = value; diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 4b787b9859..8942e7c909 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -99,6 +99,14 @@ public slots: bool getSuppressDeprecatedWarnings(); /// set whether to do suppress deprecated warnings void setSuppressDeprecatedWarnings(bool value); + /// get whether to treat developer (author) warnings as errors + bool getDevWarningsAsErrors(); + /// set whether to treat developer (author) warnings as errors + void setDevWarningsAsErrors(bool value); + /// get whether to treat deprecated warnings as errors + bool getDeprecatedWarningsAsErrors(); + /// set whether to treat deprecated warnings as errors + void setDeprecatedWarningsAsErrors(bool value); /// set whether to run cmake with warnings about uninitialized variables void setWarnUninitializedMode(bool value); /// set whether to run cmake with warnings about unused variables diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx index 735b71c38d..4bd541f3e3 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); + } } diff --git a/Source/QtDialog/WarningMessagesDialog.h b/Source/QtDialog/WarningMessagesDialog.h index 028ec104dc..6c274a71d9 100644 --- a/Source/QtDialog/WarningMessagesDialog.h +++ b/Source/QtDialog/WarningMessagesDialog.h @@ -35,6 +35,28 @@ private slots: */ void doAccept(); + /** + * Handler for checked state changed event of the suppress developer warnings + * checkbox. + */ + void doSuppressDeveloperWarningsChanged(int state); + /** + * Handler for checked state changed event of the suppress deprecated + * warnings checkbox. + */ + void doSuppressDeprecatedWarningsChanged(int state); + + /** + * Handler for checked state changed event of the developer warnings as + * errors checkbox. + */ + void doDeveloperWarningsAsErrorsChanged(int state); + /** + * Handler for checked state changed event of the deprecated warnings as + * errors checkbox. + */ + void doDeprecatedWarningsAsErrorsChanged(int state); + private: QCMake* cmakeInstance; diff --git a/Source/QtDialog/WarningMessagesDialog.ui b/Source/QtDialog/WarningMessagesDialog.ui index 2367772cfa..3b35cbc676 100644 --- a/Source/QtDialog/WarningMessagesDialog.ui +++ b/Source/QtDialog/WarningMessagesDialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>250</width> - <height>150</height> + <width>300</width> + <height>300</height> </rect> </property> <property name="windowTitle"> @@ -37,6 +37,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="toolTip"> + <string>Suppress developer (author) warnings.</string> + </property> <property name="text"> <string>Developer Warnings</string> </property> @@ -53,6 +56,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="toolTip"> + <string>Suppress deprecated warnings.</string> + </property> <property name="text"> <string>Deprecated Warnings</string> </property> @@ -65,6 +71,53 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Warnings as Errors</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QCheckBox" name="developerWarningsAsErrors"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Treat developer (author) warnings as errors.</string> + </property> + <property name="text"> + <string>Developer Warnings as Errors</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="deprecatedWarningsAsErrors"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Treat deprecated warnings as errors.</string> + </property> + <property name="text"> + <string>Deprecated Warnings as Errors</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> |