aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/environmentaspectwidget.h
blob: d236621fa48e176a1eaea370490ce9cfa5f6e8af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "projectexplorer_export.h"

#include "environmentaspect.h"
#include "runconfiguration.h"

#include <utils/environment.h>
#include <utils/guard.h>

#include <QList>
#include <QVariantMap>

QT_BEGIN_NAMESPACE
class QComboBox;
class QHBoxLayout;
QT_END_NAMESPACE

namespace Utils { class DetailsWidget; }

namespace ProjectExplorer {

class EnvironmentWidget;

class PROJECTEXPLORER_EXPORT EnvironmentAspectWidget : public QWidget
{
    Q_OBJECT

public:
    explicit EnvironmentAspectWidget(EnvironmentAspect *aspect);

protected:
    EnvironmentAspect *aspect() const { return m_aspect; }
    EnvironmentWidget *envWidget() const { return m_environmentWidget; }
    void addWidget(QWidget *widget);

private:
    void baseEnvironmentSelected(int idx);
    void changeBaseEnvironment();
    void userChangesEdited();
    void changeUserChanges(Utils::EnvironmentItems changes);
    void environmentChanged();

    EnvironmentAspect *m_aspect;
    Utils::Guard m_ignoreChanges;
    QHBoxLayout *m_baseLayout = nullptr;
    QComboBox *m_baseEnvironmentComboBox = nullptr;
    EnvironmentWidget *m_environmentWidget = nullptr;
};

} // namespace ProjectExplorer