1
/****************************************************************************
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of Qt Creator.
8
** Commercial License Usage
9
** Licensees holding valid commercial Qt licenses may use this file in
10
** accordance with the commercial license agreement provided with the
11
** Software or, alternatively, in accordance with the terms contained in
12
** a written agreement between you and Digia. For licensing terms and
13
** conditions see http://qt.digia.com/licensing. For further information
14
** use the contact form at http://qt.digia.com/contact-us.
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
** In addition, as a special exception, Digia gives you certain additional
25
** rights. These rights are described in the Digia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
****************************************************************************/
30
#ifndef DESKTOPQMAKERUNCONFIGURATION_H
31
#define DESKTOPQMAKERUNCONFIGURATION_H
33
#include <qmakeprojectmanager/qmakerunconfigurationfactory.h>
35
#include <projectexplorer/localapplicationrunconfiguration.h>
38
#include <QStringList>
54
namespace QmakeProjectManager {
57
class QmakeProFileNode;
58
class QmakePriFileNode;
59
class TargetInformation;
62
class DesktopQmakeRunConfigurationFactory;
64
class DesktopQmakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
67
// to change the display name and arguments and set the userenvironmentchanges
68
friend class DesktopQmakeRunConfigurationWidget;
69
friend class DesktopQmakeRunConfigurationFactory;
72
DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
73
virtual ~DesktopQmakeRunConfiguration();
75
virtual bool isEnabled() const;
76
virtual QString disabledReason() const;
77
virtual QWidget *createConfigurationWidget();
79
virtual QString executable() const;
80
virtual RunMode runMode() const;
81
bool forcedGuiMode() const;
82
virtual QString workingDirectory() const;
83
virtual QString commandLineArguments() const;
84
QString dumperLibrary() const;
85
QStringList dumperLibraryLocations() const;
87
bool isUsingDyldImageSuffix() const;
88
void setUsingDyldImageSuffix(bool state);
90
QString proFilePath() const;
92
QVariantMap toMap() const;
94
Utils::OutputFormatter *createOutputFormatter() const;
96
void setRunMode(RunMode runMode);
98
void addToBaseEnvironment(Utils::Environment &env) const;
101
void commandLineArgumentsChanged(const QString&);
102
void baseWorkingDirectoryChanged(const QString&);
103
void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode);
104
void usingDyldImageSuffixChanged(bool);
106
// Note: These signals might not get emitted for every change!
107
void effectiveTargetInformationChanged();
111
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
114
DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, DesktopQmakeRunConfiguration *source);
115
virtual bool fromMap(const QVariantMap &map);
118
QPair<QString, QString> extractWorkingDirAndExecutable(const QmakeProFileNode *node) const;
119
void setBaseWorkingDirectory(const QString &workingDirectory);
120
QString baseWorkingDirectory() const;
121
void setCommandLineArguments(const QString &argumentsString);
122
QString rawCommandLineArguments() const;
123
QString defaultDisplayName();
128
QString m_commandLineArguments;
129
QString m_proFilePath; // Full path to the Application Pro File
131
// Cached startup sub project information
132
ProjectExplorer::LocalApplicationRunConfiguration::RunMode m_runMode;
133
bool m_forcedGuiMode;
135
bool m_isUsingDyldImageSuffix;
136
QString m_userWorkingDirectory;
138
bool m_parseInProgress;
141
class DesktopQmakeRunConfigurationWidget : public QWidget
146
DesktopQmakeRunConfigurationWidget(DesktopQmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent);
147
~DesktopQmakeRunConfigurationWidget();
150
void showEvent(QShowEvent *event);
151
void hideEvent(QHideEvent *event);
154
void runConfigurationEnabledChange();
155
void workDirectoryEdited();
156
void workingDirectoryReseted();
157
void argumentsEdited(const QString &arguments);
158
void environmentWasChanged();
160
void workingDirectoryChanged(const QString &workingDirectory);
161
void commandLineArgumentsChanged(const QString &args);
162
void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode);
164
void effectiveTargetInformationChanged();
165
void termToggled(bool);
166
void qvfbToggled(bool);
167
void usingDyldImageSuffixToggled(bool);
168
void usingDyldImageSuffixChanged(bool);
171
DesktopQmakeRunConfiguration *m_qmakeRunConfiguration;
173
QLabel *m_disabledIcon;
174
QLabel *m_disabledReason;
175
QLineEdit *m_executableLineEdit;
176
Utils::PathChooser *m_workingDirectoryEdit;
177
QLineEdit *m_argumentsLineEdit;
178
QCheckBox *m_useTerminalCheck;
179
QCheckBox *m_useQvfbCheck;
180
QCheckBox *m_usingDyldImageSuffix;
181
QLineEdit *m_qmlDebugPort;
182
Utils::DetailsWidget *m_detailsContainer;
186
class DesktopQmakeRunConfigurationFactory : public QmakeRunConfigurationFactory
191
explicit DesktopQmakeRunConfigurationFactory(QObject *parent = 0);
192
~DesktopQmakeRunConfigurationFactory();
194
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
195
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
196
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
197
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
199
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
200
QString displayNameForId(const Core::Id id) const;
202
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
203
ProjectExplorer::Node *n);
206
bool canHandle(ProjectExplorer::Target *t) const;
208
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
209
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
210
const QVariantMap &map);
213
} // namespace Internal
214
} // namespace QmakeProjectManager
216
#endif // DESKTOPQMAKERUNCONFIGURATION_H