runsettingspropertiespage.h 3.96 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
Eike Ziller's avatar
Eike Ziller committed
3 4
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://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
Eike Ziller's avatar
Eike Ziller committed
12 13
** a written agreement between you and The Qt Company.  For licensing terms and
** conditions see http://www.qt.io/terms-conditions.  For further information
Eike Ziller's avatar
Eike Ziller committed
14
** use the contact form at http://www.qt.io/contact-us.
15
**
16
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17
** Alternatively, this file may be used under the terms of the GNU Lesser
Eike Ziller's avatar
Eike Ziller committed
18 19 20 21 22 23
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file.  Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
**
Eike Ziller's avatar
Eike Ziller committed
25 26
** In addition, as a special exception, The Qt Company gives you certain additional
** rights.  These rights are described in The Qt Company LGPL Exception
con's avatar
con committed
27 28
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
29
****************************************************************************/
hjk's avatar
hjk committed
30

con's avatar
con committed
31 32 33
#ifndef RUNSETTINGSPROPERTIESPAGE_H
#define RUNSETTINGSPROPERTIESPAGE_H

34
#include <QWidget>
con's avatar
con committed
35

36
QT_BEGIN_NAMESPACE
37 38
class QComboBox;
class QGridLayout;
39
class QLabel;
40 41
class QMenu;
class QPushButton;
Tobias Hunger's avatar
Tobias Hunger committed
42
class QVBoxLayout;
43 44
QT_END_NAMESPACE

con's avatar
con committed
45
namespace ProjectExplorer {
46

Tobias Hunger's avatar
Tobias Hunger committed
47 48
class DeployConfiguration;
class DeployConfigurationModel;
49
class NamedWidget;
50
class RunConfiguration;
dt's avatar
dt committed
51
class RunConfigurationModel;
52
class RunConfigWidget;
53
class Target;
54

con's avatar
con committed
55 56
namespace Internal {

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

Tobias Hunger's avatar
Tobias Hunger committed
59
class BuildStepListWidget;
con's avatar
con committed
60 61 62 63 64

class RunSettingsWidget : public QWidget
{
    Q_OBJECT
public:
65
    explicit RunSettingsWidget(Target *target);
con's avatar
con committed
66 67 68
    ~RunSettingsWidget();

private slots:
69
    void currentRunConfigurationChanged(int index);
con's avatar
con committed
70
    void aboutToShowAddMenu();
71
    void cloneRunConfiguration();
con's avatar
con committed
72
    void removeRunConfiguration();
73
    void activeRunConfigurationChanged();
74
    void renameRunConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
75 76 77 78
    void currentDeployConfigurationChanged(int index);
    void aboutToShowDeployMenu();
    void removeDeployConfiguration();
    void activeDeployConfigurationChanged();
79
    void renameDeployConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
80

81 82
    void updateRemoveToolButton();

83
private:
84 85
    QString uniqueDCName(const QString &name);
    QString uniqueRCName(const QString &name);
Tobias Hunger's avatar
Tobias Hunger committed
86
    void updateDeployConfiguration(DeployConfiguration *);
87
    void setConfigurationWidget(RunConfiguration *rc);
88

89 90 91 92
    void addRunControlWidgets();
    void addSubWidget(RunConfigWidget *subWidget);
    void removeSubWidgets();

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

    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
118 119 120 121 122 123
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // RUNSETTINGSPROPERTIESPAGE_H