runsettingspropertiespage.h 3.5 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
3 4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
con's avatar
con committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
con's avatar
con committed
7
**
hjk's avatar
hjk committed
8 9 10 11
** 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
12 13 14
** 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.
15
**
16 17 18 19 20 21 22
** 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.
con's avatar
con committed
23
**
hjk's avatar
hjk committed
24
****************************************************************************/
hjk's avatar
hjk committed
25

Tobias Hunger's avatar
Tobias Hunger committed
26
#pragma once
con's avatar
con committed
27

28
#include <QWidget>
con's avatar
con committed
29

30
QT_BEGIN_NAMESPACE
31 32
class QComboBox;
class QGridLayout;
33
class QLabel;
34 35
class QMenu;
class QPushButton;
Tobias Hunger's avatar
Tobias Hunger committed
36
class QVBoxLayout;
37 38
QT_END_NAMESPACE

con's avatar
con committed
39
namespace ProjectExplorer {
40

Tobias Hunger's avatar
Tobias Hunger committed
41 42
class DeployConfiguration;
class DeployConfigurationModel;
43
class NamedWidget;
44
class RunConfiguration;
45
class RunConfigurationModel;
46
class RunConfigWidget;
47
class Target;
48

con's avatar
con committed
49 50
namespace Internal {

Tobias Hunger's avatar
Tobias Hunger committed
51
class BuildStepListWidget;
con's avatar
con committed
52 53 54 55 56

class RunSettingsWidget : public QWidget
{
    Q_OBJECT
public:
57
    explicit RunSettingsWidget(Target *target);
con's avatar
con committed
58

59
private:
60
    void currentRunConfigurationChanged(int index);
con's avatar
con committed
61
    void aboutToShowAddMenu();
62
    void cloneRunConfiguration();
con's avatar
con committed
63
    void removeRunConfiguration();
64
    void activeRunConfigurationChanged();
65
    void renameRunConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
66 67 68 69
    void currentDeployConfigurationChanged(int index);
    void aboutToShowDeployMenu();
    void removeDeployConfiguration();
    void activeDeployConfigurationChanged();
70
    void renameDeployConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
71

72 73
    void updateRemoveToolButton();

74 75
    QString uniqueDCName(const QString &name);
    QString uniqueRCName(const QString &name);
Tobias Hunger's avatar
Tobias Hunger committed
76
    void updateDeployConfiguration(DeployConfiguration *);
77
    void setConfigurationWidget(RunConfiguration *rc);
78

79 80 81 82
    void addRunControlWidgets();
    void addSubWidget(RunConfigWidget *subWidget);
    void removeSubWidgets();

Tobias Hunger's avatar
Tobias Hunger committed
83
    Target *m_target;
84
    RunConfigurationModel *m_runConfigurationsModel;
Tobias Hunger's avatar
Tobias Hunger committed
85
    DeployConfigurationModel *m_deployConfigurationModel;
86 87 88 89 90 91
    QWidget *m_runConfigurationWidget = nullptr;
    RunConfiguration *m_runConfiguration = nullptr;
    QVBoxLayout *m_runLayout = nullptr;
    NamedWidget *m_deployConfigurationWidget = nullptr;
    QVBoxLayout *m_deployLayout = nullptr;
    BuildStepListWidget *m_deploySteps = nullptr;
Tobias Hunger's avatar
Tobias Hunger committed
92 93
    QMenu *m_addRunMenu;
    QMenu *m_addDeployMenu;
94
    bool m_ignoreChange = false;
95 96
    typedef QPair<RunConfigWidget *, QLabel *> RunConfigItem;
    QList<RunConfigItem> m_subWidgets;
97 98 99 100 101 102 103 104 105 106 107

    QGridLayout *m_gridLayout;
    QComboBox *m_deployConfigurationCombo;
    QWidget *m_deployWidget;
    QComboBox *m_runConfigurationCombo;
    QPushButton *m_addDeployToolButton;
    QPushButton *m_removeDeployToolButton;
    QPushButton *m_addRunToolButton;
    QPushButton *m_removeRunToolButton;
    QPushButton *m_renameRunButton;
    QPushButton *m_renameDeployButton;
con's avatar
con committed
108 109 110 111
};

} // namespace Internal
} // namespace ProjectExplorer