ENH: Add debug output option to a new Options menu.

Move dev warnings option to the new Options menu.
      Fixes #6335.
This commit is contained in:
Clinton Stimpson 2008-04-02 17:41:24 -04:00
parent 6292341841
commit 7ff914227d
4 changed files with 36 additions and 3 deletions

View File

@ -96,10 +96,16 @@ 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 (-Wno-dev)"));
QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
QAction* supressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
QObject::connect(supressDevWarningsAction, SIGNAL(triggered(bool)),
this, SLOT(doSuppressDev()));
this->SuppressDevWarningsAction->setCheckable(true);
supressDevWarningsAction->setCheckable(true);
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
debugAction->setCheckable(true);
QObject::connect(debugAction, SIGNAL(toggled(bool)),
this, SLOT(setDebugOutput(bool)));
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
QAction* a = HelpMenu->addAction(tr("About"));
@ -861,4 +867,9 @@ void CMakeSetupDialog::startSearch()
this->Search->selectAll();
}
void CMakeSetupDialog::setDebugOutput(bool flag)
{
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
"setDebugOutput", Qt::QueuedConnection, Q_ARG(bool, flag));
}

View File

@ -73,6 +73,7 @@ protected slots:
void selectionChanged();
void addCacheEntry();
void startSearch();
void setDebugOutput(bool);
protected:

View File

@ -362,6 +362,21 @@ void QCMake::reloadCache()
props = this->properties();
emit this->propertiesChanged(props);
}
void QCMake::setDebugOutput(bool flag)
{
if(flag != this->CMakeInstance->GetDebugOutput())
{
this->CMakeInstance->SetDebugOutputOn(flag);
emit this->debugOutputChanged(flag);
}
}
bool QCMake::getDebugOutput() const
{
return this->CMakeInstance->GetDebugOutput();
}
void QCMake::SetSuppressDevWarnings(bool value)
{

View File

@ -87,6 +87,8 @@ public slots:
void deleteCache();
/// reload the cache in binary directory
void reloadCache();
/// set whether to do debug output
void setDebugOutput(bool);
public:
/// get the list of cache properties
@ -99,6 +101,8 @@ public:
QString generator() const;
/// get the available generators
QStringList availableGenerators() const;
/// get whether to do debug output
bool getDebugOutput() const;
signals:
/// signal when properties change (during read from disk or configure process)
@ -118,6 +122,8 @@ signals:
void outputMessage(const QString& msg);
/// signal when there is an error message
void errorMessage(const QString& msg);
/// signal when debug output changes
void debugOutputChanged(bool);
protected:
cmake* CMakeInstance;