runsettingspropertiespage.h 3.98 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
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
con's avatar
con committed
8
**
con's avatar
con committed
9
** No Commercial Usage
10
**
con's avatar
con committed
11 12 13 14
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
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
**
con's avatar
con committed
25 26 27 28 29 30
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
con's avatar
con committed
31
**
32
**************************************************************************/
hjk's avatar
hjk committed
33

con's avatar
con committed
34 35 36 37 38
#ifndef RUNSETTINGSPROPERTIESPAGE_H
#define RUNSETTINGSPROPERTIESPAGE_H

#include "iprojectproperties.h"

hjk's avatar
hjk committed
39
#include <QtGui/QWidget>
40
#include <QtGui/QIcon>
con's avatar
con committed
41

42 43
QT_BEGIN_NAMESPACE
class QMenu;
44
class QLabel;
Tobias Hunger's avatar
Tobias Hunger committed
45
class QVBoxLayout;
46 47
QT_END_NAMESPACE

con's avatar
con committed
48
namespace ProjectExplorer {
49

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

con's avatar
con committed
57 58
namespace Internal {

Tobias Hunger's avatar
Tobias Hunger committed
59 60
const char * const RUNSETTINGS_PANEL_ID("ProjectExplorer.RunSettingsPanel");

con's avatar
con committed
61 62 63 64 65
namespace Ui {
class RunSettingsPropertiesPage;
}

class RunSettingsWidget;
Tobias Hunger's avatar
Tobias Hunger committed
66
class BuildStepListWidget;
con's avatar
con committed
67

68
class RunSettingsPanelFactory : public ITargetPanelFactory
con's avatar
con committed
69 70
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
71
    QString id() const;
con's avatar
con committed
72
    QString displayName() const;
Tobias Hunger's avatar
Tobias Hunger committed
73 74
    bool supports(Target *target);
    IPropertiesPanel *createPanel(Target *target);
con's avatar
con committed
75 76
};

77
class RunSettingsPanel : public IPropertiesPanel
con's avatar
con committed
78 79
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
80
    RunSettingsPanel(Target *target);
con's avatar
con committed
81 82
    ~RunSettingsPanel();

83
    QString displayName() const;
84 85 86
    QWidget *widget() const;
    QIcon icon() const;

con's avatar
con committed
87 88
private:
    RunSettingsWidget *m_widget;
89
    QIcon m_icon;
con's avatar
con committed
90 91 92 93 94 95
};

class RunSettingsWidget : public QWidget
{
    Q_OBJECT
public:
Tobias Hunger's avatar
Tobias Hunger committed
96
    RunSettingsWidget(Target *target);
con's avatar
con committed
97 98 99
    ~RunSettingsWidget();

private slots:
100
    void currentRunConfigurationChanged(int index);
con's avatar
con committed
101 102 103
    void aboutToShowAddMenu();
    void addRunConfiguration();
    void removeRunConfiguration();
104
    void activeRunConfigurationChanged();
105
    void renameRunConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
106 107 108 109 110
    void currentDeployConfigurationChanged(int index);
    void aboutToShowDeployMenu();
    void addDeployConfiguration();
    void removeDeployConfiguration();
    void activeDeployConfigurationChanged();
111
    void renameDeployConfiguration();
Tobias Hunger's avatar
Tobias Hunger committed
112

113
private:
114 115
    QString uniqueDCName(const QString &name);
    QString uniqueRCName(const QString &name);
Tobias Hunger's avatar
Tobias Hunger committed
116
    void updateDeployConfiguration(DeployConfiguration *);
117
    void setConfigurationWidget(RunConfiguration *rc);
118

119 120 121 122
    void addRunControlWidgets();
    void addSubWidget(RunConfigWidget *subWidget);
    void removeSubWidgets();

Tobias Hunger's avatar
Tobias Hunger committed
123
    Target *m_target;
dt's avatar
dt committed
124
    RunConfigurationModel *m_runConfigurationsModel;
Tobias Hunger's avatar
Tobias Hunger committed
125
    DeployConfigurationModel *m_deployConfigurationModel;
con's avatar
con committed
126 127
    Ui::RunSettingsPropertiesPage *m_ui;
    QWidget *m_runConfigurationWidget;
128
    QVBoxLayout *m_runLayout;
Tobias Hunger's avatar
Tobias Hunger committed
129 130 131 132 133
    DeployConfigurationWidget *m_deployConfigurationWidget;
    QVBoxLayout *m_deployLayout;
    BuildStepListWidget *m_deploySteps;
    QMenu *m_addRunMenu;
    QMenu *m_addDeployMenu;
134
    bool m_ignoreChange;
135
    QList<QPair<RunConfigWidget *, QLabel *> > m_subWidgets;
con's avatar
con committed
136 137 138 139 140 141
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // RUNSETTINGSPROPERTIESPAGE_H