buildstepspage.h 3.35 KB
Newer Older
1
/**************************************************************************
con's avatar
con committed
2 3 4
**
** This file is part of Qt Creator
**
con's avatar
con committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
con's avatar
con committed
6
**
hjk's avatar
hjk committed
7
** Contact: Nokia Corporation (info@qt.nokia.com)
con's avatar
con committed
8
**
9
**
10
** GNU Lesser General Public License Usage
11
**
hjk's avatar
hjk committed
12 13 14 15 16 17
** 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.
18
**
con's avatar
con committed
19
** In addition, as a special exception, Nokia gives you certain additional
hjk's avatar
hjk committed
20
** rights. These rights are described in the Nokia Qt LGPL Exception
con's avatar
con committed
21 22
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
23 24 25 26 27
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
con's avatar
con committed
28
** If you have questions regarding the use of this file, please contact
Tobias Hunger's avatar
Tobias Hunger committed
29
** Nokia at info@qt.nokia.com.
con's avatar
con committed
30
**
31
**************************************************************************/
hjk's avatar
hjk committed
32

con's avatar
con committed
33 34 35 36
#ifndef BUILDSTEPSPAGE_H
#define BUILDSTEPSPAGE_H

#include "buildstep.h"
Tobias Hunger's avatar
Tobias Hunger committed
37 38 39
#include "deployconfiguration.h"
#include "namedwidget.h"

con's avatar
con committed
40
QT_BEGIN_NAMESPACE
dt's avatar
dt committed
41 42 43 44
class QPushButton;
class QToolButton;
class QLabel;
class QVBoxLayout;
45
class QSignalMapper;
con's avatar
con committed
46 47
QT_END_NAMESPACE

48 49 50 51
namespace Utils {
class DetailsWidget;
}

con's avatar
con committed
52 53
namespace ProjectExplorer {

Tobias Hunger's avatar
Tobias Hunger committed
54
class Target;
55
class BuildConfiguration;
con's avatar
con committed
56 57 58

namespace Internal {

59
class BuildStepsWidgetData
dt's avatar
dt committed
60
{
61 62 63 64 65
public:
    BuildStepsWidgetData(BuildStep *s);
    ~BuildStepsWidgetData();

    BuildStep *step;
dt's avatar
dt committed
66
    BuildStepConfigWidget *widget;
dt's avatar
dt committed
67
    Utils::DetailsWidget *detailsWidget;
dt's avatar
dt committed
68 69
    QToolButton *upButton;
    QToolButton *downButton;
70
    QToolButton *removeButton;
dt's avatar
dt committed
71 72
};

Tobias Hunger's avatar
Tobias Hunger committed
73
class BuildStepListWidget : public NamedWidget
dt's avatar
dt committed
74
{
con's avatar
con committed
75
    Q_OBJECT
Tobias Hunger's avatar
Tobias Hunger committed
76

con's avatar
con committed
77
public:
Tobias Hunger's avatar
Tobias Hunger committed
78 79
    BuildStepListWidget(QWidget *parent = 0);
    virtual ~BuildStepListWidget();
con's avatar
con committed
80

Tobias Hunger's avatar
Tobias Hunger committed
81
    void init(BuildStepList *bsl);
con's avatar
con committed
82 83 84

private slots:
    void updateAddBuildStepMenu();
85 86
    void triggerAddBuildStep();
    void addBuildStep(int pos);
dt's avatar
dt committed
87
    void updateSummary();
88 89 90 91 92
    void triggerStepMoveUp(int pos);
    void stepMoved(int from, int to);
    void triggerStepMoveDown(int pos);
    void triggerRemoveBuildStep(int pos);
    void removeBuildStep(int pos);
con's avatar
con committed
93 94

private:
95
    void setupUi();
con's avatar
con committed
96
    void updateBuildStepButtonsState();
dt's avatar
dt committed
97
    void addBuildStepWidget(int pos, BuildStep *step);
con's avatar
con committed
98

Tobias Hunger's avatar
Tobias Hunger committed
99
    BuildStepList *m_buildStepList;
con's avatar
con committed
100
    QHash<QAction *, QPair<QString, ProjectExplorer::IBuildStepFactory *> > m_addBuildStepHash;
dt's avatar
dt committed
101

102
    QList<Internal::BuildStepsWidgetData *> m_buildStepsData;
dt's avatar
dt committed
103 104 105 106 107

    QVBoxLayout *m_vbox;

    QLabel *m_noStepsLabel;
    QPushButton *m_addButton;
108 109 110 111 112 113

    QSignalMapper *m_upMapper;
    QSignalMapper *m_downMapper;
    QSignalMapper *m_removeMapper;

    int m_leftMargin;
con's avatar
con committed
114 115
};

Tobias Hunger's avatar
Tobias Hunger committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
namespace Ui {
    class BuildStepsPage;
}

class BuildStepsPage : public BuildConfigWidget
{
    Q_OBJECT

public:
    BuildStepsPage(Target *target, const QString &id);
    virtual ~BuildStepsPage();

    QString displayName() const;
    void init(BuildConfiguration *bc);

private:
    QString m_id;
    BuildStepListWidget *m_widget;
};

con's avatar
con committed
136 137 138 139
} // Internal
} // ProjectExplorer

#endif // BUILDSTEPSPAGE_H