Parcourir la source

ENH: Add debug output option to a new Options menu.
Move dev warnings option to the new Options menu.
Fixes #6335.

Clinton Stimpson il y a 17 ans
Parent
commit
7ff914227d

+ 14 - 3
Source/QtDialog/CMakeSetupDialog.cxx

@@ -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));
+}
 

+ 1 - 0
Source/QtDialog/CMakeSetupDialog.h

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

+ 15 - 0
Source/QtDialog/QCMake.cxx

@@ -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)
 {

+ 6 - 0
Source/QtDialog/QCMake.h

@@ -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;