buildsettingspropertiespage.h 3.41 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

namespace Internal {

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

class BuildSettingsWidget;

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

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

class BuildConfigurationsWidget;

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

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

con's avatar
con committed
89 90
    void setupUi();

con's avatar
con committed
91 92
private slots:
    void updateBuildSettings();
dt's avatar
dt committed
93 94
    void currentIndexChanged(int index);
    void activeBuildConfigurationChanged();
con's avatar
con committed
95 96 97 98

    void createConfiguration();
    void cloneConfiguration();
    void deleteConfiguration();
con's avatar
con committed
99
    void updateAddButtonMenu();
100 101
    void checkMakeActiveLabel();
    void makeActive();
con's avatar
con committed
102

103 104 105
    void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
    void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
    void buildConfigurationDisplayNameChanged();
con's avatar
con committed
106
private:
107 108
    void cloneConfiguration(BuildConfiguration *toClone);
    void deleteConfiguration(BuildConfiguration *toDelete);
con's avatar
con committed
109 110

    Project *m_project;
111 112
    BuildConfiguration *m_buildConfiguration;

dt's avatar
dt committed
113 114 115
    QPushButton *m_addButton;
    QPushButton *m_removeButton;
    QComboBox *m_buildConfigurationComboBox;
con's avatar
con committed
116
    QMenu *m_addButtonMenu;
117
    QLabel *m_makeActiveLabel;
118 119 120 121 122

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

    int m_leftMargin;
con's avatar
con committed
123 124 125 126 127 128
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // BUILDSETTINGSPROPERTIESPAGE_H