runsettingspropertiespage.h 3.78 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

con's avatar
con committed
56 57
namespace Internal {

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

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

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

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

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

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

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

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

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

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

Tobias Hunger's avatar
Tobias Hunger committed
118
    Target *m_target;
dt's avatar
dt committed
119
    RunConfigurationModel *m_runConfigurationsModel;
Tobias Hunger's avatar
Tobias Hunger committed
120
    DeployConfigurationModel *m_deployConfigurationModel;
con's avatar
con committed
121 122
    Ui::RunSettingsPropertiesPage *m_ui;
    QWidget *m_runConfigurationWidget;
123
    QVBoxLayout *m_runLayout;
Tobias Hunger's avatar
Tobias Hunger committed
124 125 126 127 128
    DeployConfigurationWidget *m_deployConfigurationWidget;
    QVBoxLayout *m_deployLayout;
    BuildStepListWidget *m_deploySteps;
    QMenu *m_addRunMenu;
    QMenu *m_addDeployMenu;
129
    bool m_ignoreChange;
con's avatar
con committed
130 131 132 133 134 135
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // RUNSETTINGSPROPERTIESPAGE_H