runsettingspropertiespage.h 3.63 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

con's avatar
con committed
26 27 28
#ifndef RUNSETTINGSPROPERTIESPAGE_H
#define RUNSETTINGSPROPERTIESPAGE_H

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

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

con's avatar
con committed
40
namespace ProjectExplorer {
41

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

con's avatar
con committed
50 51
namespace Internal {

hjk's avatar
hjk committed
52
const char RUNSETTINGS_PANEL_ID[] = "ProjectExplorer.RunSettingsPanel";
Tobias Hunger's avatar
Tobias Hunger committed
53

Tobias Hunger's avatar
Tobias Hunger committed
54
class BuildStepListWidget;
con's avatar
con committed
55 56 57 58 59

class RunSettingsWidget : public QWidget
{
    Q_OBJECT
public:
60
    explicit RunSettingsWidget(Target *target);
con's avatar
con committed
61 62
    ~RunSettingsWidget();

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

76 77
    void updateRemoveToolButton();

78 79
    QString uniqueDCName(const QString &name);
    QString uniqueRCName(const QString &name);
Tobias Hunger's avatar
Tobias Hunger committed
80
    void updateDeployConfiguration(DeployConfiguration *);
81
    void setConfigurationWidget(RunConfiguration *rc);
82

83 84 85 86
    void addRunControlWidgets();
    void addSubWidget(RunConfigWidget *subWidget);
    void removeSubWidgets();

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

    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
112 113 114 115 116 117
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // RUNSETTINGSPROPERTIESPAGE_H