runsettingspropertiespage.h 4.16 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
hjk's avatar
hjk committed
3 4
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** 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 36
#include <QWidget>
#include <QIcon>
con's avatar
con committed
37

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

con's avatar
con committed
47
namespace ProjectExplorer {
48

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

con's avatar
con committed
56 57
namespace Internal {

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

Tobias Hunger's avatar
Tobias Hunger committed
60
class BuildStepListWidget;
con's avatar
con committed
61

62
class RunSettingsPanelFactory : public ITargetPanelFactory
con's avatar
con committed
63 64
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
65
    QString id() const;
con's avatar
con committed
66
    QString displayName() const;
67
    int priority() const;
Tobias Hunger's avatar
Tobias Hunger committed
68
    bool supports(Target *target);
69
    PropertiesPanel *createPanel(Target *target);
con's avatar
con committed
70 71 72 73 74 75
};

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

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

93 94
    void updateRemoveToolButton();

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

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

Tobias Hunger's avatar
Tobias Hunger committed
105
    Target *m_target;
dt's avatar
dt committed
106
    RunConfigurationModel *m_runConfigurationsModel;
Tobias Hunger's avatar
Tobias Hunger committed
107
    DeployConfigurationModel *m_deployConfigurationModel;
con's avatar
con committed
108
    QWidget *m_runConfigurationWidget;
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