diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-03-12 02:51:56 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-03-12 02:51:56 (GMT) |
commit | 420725077cc9326d5b8c610f2770994a177eed15 (patch) | |
tree | 955bf582c6b9d25475b1c98a98a0ba49b587f2d9 /Source/QtDialog | |
parent | fc26c1459caa61c79b9076e3ca85905e45bbcbc9 (diff) | |
download | CMake-420725077cc9326d5b8c610f2770994a177eed15.zip CMake-420725077cc9326d5b8c610f2770994a177eed15.tar.gz CMake-420725077cc9326d5b8c610f2770994a177eed15.tar.bz2 |
ENH: add ability to suppress dev warnings to gui code
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 14 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.h | 3 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 7 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.h | 4 |
4 files changed, 25 insertions, 3 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 4ac1d5c..81a1e5a 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -59,6 +59,7 @@ void QCMakeThread::run() CMakeSetupDialog::CMakeSetupDialog() : ExitAfterGenerate(true), CacheModified(false), CurrentState(Interrupting) { + this->SuppressDevWarnings = false; // create the GUI QSettings settings; settings.beginGroup("Settings/StartPath"); @@ -95,8 +96,11 @@ CMakeSetupDialog::CMakeSetupDialog() this->GenerateAction = ToolsMenu->addAction(tr("&Generate")); QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)), this, SLOT(doGenerate())); + this->SuppressDevWarningsAction = ToolsMenu->addAction(tr("&Suppress dev Warnings")); + QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)), + this, SLOT(doSuppressDev())); + this->SuppressDevWarningsAction->setCheckable(true); - QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help")); QAction* a = HelpMenu->addAction(tr("About")); QObject::connect(a, SIGNAL(triggered(bool)), @@ -304,6 +308,14 @@ void CMakeSetupDialog::finishGenerate(int err) } } +#include <iostream> +void CMakeSetupDialog::doSuppressDev() +{ + this->SuppressDevWarnings = !this->SuppressDevWarnings; + this->CMakeThread->cmakeInstance()-> + SetSuppressDevWarnings(this->SuppressDevWarnings); +} + void CMakeSetupDialog::doGenerate() { if(this->CurrentState == Generating) diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index b2dbce6..ae9128e 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -44,6 +44,7 @@ protected slots: void initialize(); void doConfigure(); void doGenerate(); + void doSuppressDev(); void doHelp(); void doAbout(); void doInterrupt(); @@ -85,11 +86,13 @@ protected: QCMakeThread* CMakeThread; bool ExitAfterGenerate; bool CacheModified; + bool SuppressDevWarnings; QAction* ReloadCacheAction; QAction* DeleteCacheAction; QAction* ExitAction; QAction* ConfigureAction; QAction* GenerateAction; + QAction* SuppressDevWarningsAction; State CurrentState; }; diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 4f4ce37..43db641 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -28,6 +28,7 @@ QCMake::QCMake(QObject* p) : QObject(p) { + this->SuppressDevWarnings = false; qRegisterMetaType<QCMakeCacheProperty>(); qRegisterMetaType<QCMakeCachePropertyList>(); @@ -107,6 +108,7 @@ void QCMake::setBinaryDirectory(const QString& dir) "Please check the permissions of the directory you are trying to run CMake on."); } } + QCMakeCachePropertyList props = this->properties(); emit this->propertiesChanged(props); cmCacheManager::CacheIterator itm = cachem->NewIterator(); @@ -143,6 +145,7 @@ void QCMake::configure() this->CMakeInstance->SetGlobalGenerator( this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data())); this->CMakeInstance->LoadCache(); + this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); this->CMakeInstance->PreLoadCMakeFiles(); cmSystemTools::ResetErrorOccuredFlag(); @@ -360,3 +363,7 @@ void QCMake::reloadCache() emit this->propertiesChanged(props); } +void QCMake::SetSuppressDevWarnings(bool value) +{ + this->SuppressDevWarnings = value; +} diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index ad3f3f5..ab7040c 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -65,7 +65,7 @@ class QCMake : public QObject public: QCMake(QObject* p=0); ~QCMake(); - + void SetSuppressDevWarnings(bool value); public slots: /// load the cache file in a directory void loadCache(const QString& dir); @@ -125,7 +125,7 @@ protected: static void progressCallback(const char* msg, float percent, void* cd); static void errorCallback(const char* msg, const char* title, bool&, void* cd); - + bool SuppressDevWarnings; QString SourceDirectory; QString BinaryDirectory; QString Generator; |