buildsettingspropertiespage.h 3.14 KB
Newer Older
1
/**************************************************************************
con's avatar
con committed
2
3
4
**
** This file is part of Qt Creator
**
5
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
con's avatar
con committed
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
con's avatar
con committed
8
**
9
** Commercial Usage
10
**
11
12
13
14
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
15
**
16
** GNU Lesser General Public License Usage
17
**
18
19
20
21
22
23
** 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.
24
**
25
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
26
** contact the sales department at http://qt.nokia.com/contact.
con's avatar
con committed
27
**
28
**************************************************************************/
hjk's avatar
hjk committed
29

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

#include "iprojectproperties.h"
dt's avatar
dt committed
34

35
36
37
38
39
40
41
42
#include <QtGui/QWidget>

QT_BEGIN_NAMESPACE
class QComboBox;
class QLabel;
class QMenu;
class QPushButton;
QT_END_NAMESPACE
con's avatar
con committed
43
44
45

namespace ProjectExplorer {

dt's avatar
dt committed
46
class BuildConfiguration;
47
class IBuildStepFactory;
con's avatar
con committed
48
49
50
51
52
53
54

namespace Internal {

class BuildSettingsPanelFactory : public IPanelFactory
{
public:
    bool supports(Project *project);
55
    IPropertiesPanel *createPanel(Project *project);
con's avatar
con committed
56
57
58
59
};

class BuildSettingsWidget;

60
class BuildSettingsPanel : public IPropertiesPanel
con's avatar
con committed
61
62
63
64
65
{
public:
    BuildSettingsPanel(Project *project);
    ~BuildSettingsPanel();
    QString name() const;
66
67
    QWidget *widget() const;
    QIcon icon() const;
con's avatar
con committed
68
69
70

private:
    BuildSettingsWidget *m_widget;
71
    const QIcon m_icon;
con's avatar
con committed
72
73
74
75
76
77
78
79
80
81
82
};

class BuildConfigurationsWidget;

class BuildSettingsWidget : public QWidget
{
    Q_OBJECT
public:
    BuildSettingsWidget(Project *project);
    ~BuildSettingsWidget();

83
84
85
86
    void clear();
    void addSubWidget(const QString &name, QWidget *widget);
    QList<QWidget *> subWidgets() const;

con's avatar
con committed
87
88
private slots:
    void updateBuildSettings();
dt's avatar
dt committed
89
90
    void currentIndexChanged(int index);
    void activeBuildConfigurationChanged();
con's avatar
con committed
91
92
93
94

    void createConfiguration();
    void cloneConfiguration();
    void deleteConfiguration();
con's avatar
con committed
95
    void updateAddButtonMenu();
96
97
    void checkMakeActiveLabel();
    void makeActive();
con's avatar
con committed
98

99
    void setupUi();
100

con's avatar
con committed
101
private:
102
103
    void cloneConfiguration(BuildConfiguration *toClone);
    void deleteConfiguration(BuildConfiguration *toDelete);
con's avatar
con committed
104
105

    Project *m_project;
106
107
    BuildConfiguration *m_buildConfiguration;

dt's avatar
dt committed
108
109
110
    QPushButton *m_addButton;
    QPushButton *m_removeButton;
    QComboBox *m_buildConfigurationComboBox;
con's avatar
con committed
111
    QMenu *m_addButtonMenu;
112
    QLabel *m_makeActiveLabel;
113
114
115
116
117

    QList<QWidget *> m_subWidgets;
    QList<QLabel *> m_labels;

    int m_leftMargin;
con's avatar
con committed
118
119
120
121
122
123
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // BUILDSETTINGSPROPERTIESPAGE_H