ProjectExplorer: Un-export BuildEnvironmentWidget

Apparently not needed anymore outside.

Change-Id: I9f4f1a65f56a86ba75a37a9b96db71472b3e0af2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-02-19 18:38:10 +01:00
parent 7f1c8aea5d
commit 6033c31e23
7 changed files with 47 additions and 150 deletions

View File

@@ -16,7 +16,6 @@ add_qtc_plugin(ProjectExplorer
buildpropertiessettings.h
buildpropertiessettingspage.cpp buildpropertiessettingspage.h
buildconfiguration.cpp buildconfiguration.h
buildenvironmentwidget.cpp buildenvironmentwidget.h
buildinfo.cpp buildinfo.h
buildmanager.cpp buildmanager.h
buildprogress.cpp buildprogress.h

View File

@@ -26,22 +26,22 @@
#include "buildconfiguration.h"
#include "buildaspects.h"
#include "buildenvironmentwidget.h"
#include "buildinfo.h"
#include "buildsteplist.h"
#include "buildstepspage.h"
#include "buildsystem.h"
#include "namedwidget.h"
#include "environmentwidget.h"
#include "kit.h"
#include "kitinformation.h"
#include "kitmanager.h"
#include "project.h"
#include "projectexplorer.h"
#include "namedwidget.h"
#include "projectexplorerconstants.h"
#include "projectexplorer.h"
#include "project.h"
#include "projectmacroexpander.h"
#include "projecttree.h"
#include "target.h"
#include "session.h"
#include "target.h"
#include "toolchain.h"
#include <coreplugin/idocument.h>
@@ -54,8 +54,10 @@
#include <utils/mimetypes/mimetype.h>
#include <utils/qtcassert.h>
#include <QCheckBox>
#include <QDebug>
#include <QFormLayout>
#include <QVBoxLayout>
using namespace Utils;
@@ -67,6 +69,45 @@ const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.BuildConfiguration.
namespace ProjectExplorer {
namespace Internal {
class BuildEnvironmentWidget : public NamedWidget
{
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::BuildEnvironmentWidget)
public:
explicit BuildEnvironmentWidget(BuildConfiguration *bc)
: NamedWidget(tr("Build Environment"))
{
auto clearBox = new QCheckBox(tr("Clear system environment"), this);
clearBox->setChecked(!bc->useSystemEnvironment());
auto envWidget = new EnvironmentWidget(this, EnvironmentWidget::TypeLocal, clearBox);
envWidget->setBaseEnvironment(bc->baseEnvironment());
envWidget->setBaseEnvironmentText(bc->baseEnvironmentText());
envWidget->setUserChanges(bc->userEnvironmentChanges());
connect(envWidget, &EnvironmentWidget::userChangesChanged, this, [bc, envWidget] {
bc->setUserEnvironmentChanges(envWidget->userChanges());
});
connect(clearBox, &QAbstractButton::toggled, this, [bc, envWidget](bool checked) {
bc->setUseSystemEnvironment(!checked);
envWidget->setBaseEnvironment(bc->baseEnvironment());
envWidget->setBaseEnvironmentText(bc->baseEnvironmentText());
});
connect(bc, &BuildConfiguration::environmentChanged, this, [bc, envWidget] {
envWidget->setBaseEnvironment(bc->baseEnvironment());
envWidget->setBaseEnvironmentText(bc->baseEnvironmentText());
});
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->addWidget(clearBox);
vbox->addWidget(envWidget);
}
};
class BuildConfigurationPrivate
{
public:
@@ -245,7 +286,7 @@ NamedWidget *BuildConfiguration::createConfigWidget()
QList<NamedWidget *> BuildConfiguration::createSubConfigWidgets()
{
return {new BuildEnvironmentWidget(this)};
return {new Internal::BuildEnvironmentWidget(this)};
}
BuildSystem *BuildConfiguration::buildSystem() const

View File

@@ -1,82 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "buildenvironmentwidget.h"
#include "buildconfiguration.h"
#include "environmentwidget.h"
#include <projectexplorer/target.h>
#include <QVBoxLayout>
#include <QCheckBox>
namespace ProjectExplorer {
BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc)
: NamedWidget(tr("Build Environment")), m_buildConfiguration(bc)
{
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
m_clearSystemEnvironmentCheckBox->setText(tr("Clear system environment"));
m_buildEnvironmentWidget = new EnvironmentWidget(this, EnvironmentWidget::TypeLocal,
m_clearSystemEnvironmentCheckBox);
vbox->addWidget(m_buildEnvironmentWidget);
connect(m_buildEnvironmentWidget, &EnvironmentWidget::userChangesChanged,
this, &BuildEnvironmentWidget::environmentModelUserChangesChanged);
connect(m_clearSystemEnvironmentCheckBox, &QAbstractButton::toggled,
this, &BuildEnvironmentWidget::clearSystemEnvironmentCheckBoxClicked);
connect(m_buildConfiguration, &BuildConfiguration::environmentChanged,
this, &BuildEnvironmentWidget::environmentChanged);
m_clearSystemEnvironmentCheckBox->setChecked(!m_buildConfiguration->useSystemEnvironment());
m_buildEnvironmentWidget->setBaseEnvironment(m_buildConfiguration->baseEnvironment());
m_buildEnvironmentWidget->setBaseEnvironmentText(m_buildConfiguration->baseEnvironmentText());
m_buildEnvironmentWidget->setUserChanges(m_buildConfiguration->userEnvironmentChanges());
}
void BuildEnvironmentWidget::environmentModelUserChangesChanged()
{
m_buildConfiguration->setUserEnvironmentChanges(m_buildEnvironmentWidget->userChanges());
}
void BuildEnvironmentWidget::clearSystemEnvironmentCheckBoxClicked(bool checked)
{
m_buildConfiguration->setUseSystemEnvironment(!checked);
m_buildEnvironmentWidget->setBaseEnvironment(m_buildConfiguration->baseEnvironment());
m_buildEnvironmentWidget->setBaseEnvironmentText(m_buildConfiguration->baseEnvironmentText());
}
void BuildEnvironmentWidget::environmentChanged()
{
m_buildEnvironmentWidget->setBaseEnvironment(m_buildConfiguration->baseEnvironment());
m_buildEnvironmentWidget->setBaseEnvironmentText(m_buildConfiguration->baseEnvironmentText());
}
} // ProjectExplorer

View File

@@ -1,56 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <projectexplorer/namedwidget.h>
QT_BEGIN_NAMESPACE
class QCheckBox;
QT_END_NAMESPACE
namespace ProjectExplorer {
class EnvironmentWidget;
class BuildConfiguration;
class PROJECTEXPLORER_EXPORT BuildEnvironmentWidget : public NamedWidget
{
Q_OBJECT
public:
explicit BuildEnvironmentWidget(BuildConfiguration *bc);
private:
void environmentModelUserChangesChanged();
void clearSystemEnvironmentCheckBoxClicked(bool checked);
void environmentChanged();
EnvironmentWidget *m_buildEnvironmentWidget;
QCheckBox *m_clearSystemEnvironmentCheckBox;
BuildConfiguration *m_buildConfiguration;
};
} // namespace ProjectExplorer

View File

@@ -105,7 +105,6 @@ HEADERS += projectexplorer.h \
projectexplorersettingspage.h \
baseprojectwizarddialog.h \
miniprojecttargetselector.h \
buildenvironmentwidget.h \
ldparser.h \
lldparser.h \
linuxiccparser.h \
@@ -258,7 +257,6 @@ SOURCES += projectexplorer.cpp \
projectexplorersettingspage.cpp \
baseprojectwizarddialog.cpp \
miniprojecttargetselector.cpp \
buildenvironmentwidget.cpp \
ldparser.cpp \
lldparser.cpp \
linuxiccparser.cpp \

View File

@@ -33,7 +33,6 @@ Project {
"baseprojectwizarddialog.cpp", "baseprojectwizarddialog.h",
"buildaspects.cpp", "buildaspects.h",
"buildconfiguration.cpp", "buildconfiguration.h",
"buildenvironmentwidget.cpp", "buildenvironmentwidget.h",
"buildinfo.cpp", "buildinfo.h",
"buildmanager.cpp", "buildmanager.h",
"buildprogress.cpp", "buildprogress.h",

View File

@@ -49,8 +49,6 @@
#include <cpptools/cppprojectupdater.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/generatedcodemodelsupport.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildenvironmentwidget.h>
#include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/buildtargetinfo.h>