summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-24 21:20:10 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-28 13:46:35 (GMT)
commit85f5009d2786349a6576d19bf6b605f825775b44 (patch)
tree355e8130c4be0d6135a26dca355ac22b40316115 /Source/QtDialog/CMakeSetupDialog.cxx
parentd6c051c126a8cba8adec39b6ae3ae09cc773633f (diff)
downloadCMake-85f5009d2786349a6576d19bf6b605f825775b44.zip
CMake-85f5009d2786349a6576d19bf6b605f825775b44.tar.gz
CMake-85f5009d2786349a6576d19bf6b605f825775b44.tar.bz2
CMake GUI: Add environment editor
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index f6bde8f..a904b94 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -16,6 +16,7 @@
#include <QMenuBar>
#include <QMessageBox>
#include <QMimeData>
+#include <QProcessEnvironment>
#include <QProgressBar>
#include <QSettings>
#include <QShortcut>
@@ -35,6 +36,7 @@
#include "cmVersion.h"
#include "AddCacheEntry.h"
+#include "EnvironmentDialog.h"
#include "FirstConfigure.h"
#include "RegexExplorer.h"
#include "WarningMessagesDialog.h"
@@ -292,6 +294,9 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->AddEntry, &QToolButton::clicked, this,
&CMakeSetupDialog::addCacheEntry);
+ QObject::connect(this->Environment, &QToolButton::clicked, this,
+ &CMakeSetupDialog::editEnvironment);
+
QObject::connect(this->WarnUninitializedAction, &QAction::triggered,
this->CMakeThread->cmakeInstance(),
&QCMake::setWarnUninitializedMode);
@@ -742,6 +747,7 @@ void CMakeSetupDialog::setEnabledState(bool enabled)
this->ConfigureAction->setEnabled(enabled);
this->AddEntry->setEnabled(enabled);
this->RemoveEntry->setEnabled(false); // let selection re-enable it
+ this->Environment->setEnabled(enabled);
}
bool CMakeSetupDialog::setupFirstConfigure()
@@ -1075,6 +1081,17 @@ void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
}
}
+void CMakeSetupDialog::editEnvironment()
+{
+ EnvironmentDialog dialog(this->CMakeThread->cmakeInstance()->environment(),
+ this);
+ if (dialog.exec() == QDialog::Accepted) {
+ QMetaObject::invokeMethod(
+ this->CMakeThread->cmakeInstance(), "setEnvironment",
+ Q_ARG(QProcessEnvironment, dialog.environment()));
+ }
+}
+
void CMakeSetupDialog::addCacheEntry()
{
QDialog dialog(this);