runsettingspropertiespage.h 3.71 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;
dt's avatar
dt committed
53
class RunConfigurationModel;
54

con's avatar
con committed
55 56
namespace Internal {

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

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

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

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

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

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

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

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

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

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

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

} // namespace Internal
} // namespace ProjectExplorer

#endif // RUNSETTINGSPROPERTIESPAGE_H