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

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

#include "iprojectproperties.h"

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

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

con's avatar
con committed
46
namespace ProjectExplorer {
47

Tobias Hunger's avatar
Tobias Hunger committed
48 49
class DeployConfiguration;
class DeployConfigurationModel;
50
class NamedWidget;
51
class RunConfiguration;
dt's avatar
dt committed
52
class RunConfigurationModel;
53
class RunConfigWidget;
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
class RunSettingsPanelFactory : public ITargetPanelFactory
con's avatar
con committed
62 63
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
64
    QString id() const;
con's avatar
con committed
65
    QString displayName() const;
66
    int priority() const;
Tobias Hunger's avatar
Tobias Hunger committed
67
    bool supports(Target *target);
68
    PropertiesPanel *createPanel(Target *target);
con's avatar
con committed
69 70 71 72 73 74
};

class RunSettingsWidget : public QWidget
{
    Q_OBJECT
public:
75
    explicit RunSettingsWidget(Target *target);
con's avatar
con committed
76 77 78
    ~RunSettingsWidget();

private slots:
79
    void currentRunConfigurationChanged(int index);
con's avatar
con committed
80 81 82
    void aboutToShowAddMenu();
    void addRunConfiguration();
    void removeRunConfiguration();
83
    void activeRunConfigurationChanged();
84
    void renameRunConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
85 86 87 88 89
    void currentDeployConfigurationChanged(int index);
    void aboutToShowDeployMenu();
    void addDeployConfiguration();
    void removeDeployConfiguration();
    void activeDeployConfigurationChanged();
90
    void renameDeployConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
91

92 93
    void updateRemoveToolButton();

94
private:
95 96
    QString uniqueDCName(const QString &name);
    QString uniqueRCName(const QString &name);
Tobias Hunger's avatar
Tobias Hunger committed
97
    void updateDeployConfiguration(DeployConfiguration *);
98
    void setConfigurationWidget(RunConfiguration *rc);
99

100 101 102 103
    void addRunControlWidgets();
    void addSubWidget(RunConfigWidget *subWidget);
    void removeSubWidgets();

Tobias Hunger's avatar
Tobias Hunger committed
104
    Target *m_target;
dt's avatar
dt committed
105
    RunConfigurationModel *m_runConfigurationsModel;
Tobias Hunger's avatar
Tobias Hunger committed
106
    DeployConfigurationModel *m_deployConfigurationModel;
con's avatar
con committed
107
    QWidget *m_runConfigurationWidget;
108
    RunConfiguration *m_runConfiguration;
109
    QVBoxLayout *m_runLayout;
110
    NamedWidget *m_deployConfigurationWidget;
Tobias Hunger's avatar
Tobias Hunger committed
111 112 113 114
    QVBoxLayout *m_deployLayout;
    BuildStepListWidget *m_deploySteps;
    QMenu *m_addRunMenu;
    QMenu *m_addDeployMenu;
115
    bool m_ignoreChange;
116 117
    typedef QPair<RunConfigWidget *, QLabel *> RunConfigItem;
    QList<RunConfigItem> m_subWidgets;
118 119 120 121 122 123 124 125 126 127 128

    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
129 130 131 132 133 134
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // RUNSETTINGSPROPERTIESPAGE_H