2010-02-16 13:39:13 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
|
** Nokia at qt-info@nokia.com.
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef QMLPROJECTRUNCONTROL_H
|
|
|
|
|
#define QMLPROJECTRUNCONTROL_H
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
#include <projectexplorer/applicationlauncher.h>
|
|
|
|
|
|
|
|
|
|
namespace QmlProjectManager {
|
|
|
|
|
|
|
|
|
|
class QmlProjectRunConfiguration;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-05-02 16:29:13 +02:00
|
|
|
class QmlProjectRunControl : public ProjectExplorer::RunControl
|
2010-04-30 13:19:31 +02:00
|
|
|
{
|
2010-02-16 13:39:13 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-05-02 16:29:13 +02:00
|
|
|
explicit QmlProjectRunControl(QmlProjectRunConfiguration *runConfiguration, QString mode);
|
|
|
|
|
virtual ~QmlProjectRunControl ();
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
// RunControl
|
|
|
|
|
virtual void start();
|
2010-08-20 14:19:25 +02:00
|
|
|
virtual StopResult stop();
|
2010-02-16 13:39:13 +01:00
|
|
|
virtual bool isRunning() const;
|
2011-03-28 19:58:13 +02:00
|
|
|
virtual QIcon icon() const;
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void processExited(int exitCode);
|
|
|
|
|
void slotBringApplicationToForeground(qint64 pid);
|
2011-04-15 12:59:44 +02:00
|
|
|
void slotAppendMessage(const QString &line, Utils::OutputFormat);
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
|
|
|
|
|
|
|
|
|
QString m_executable;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString m_commandLineArguments;
|
2010-02-16 13:39:13 +01:00
|
|
|
};
|
|
|
|
|
|
2011-05-02 16:29:13 +02:00
|
|
|
class QmlProjectRunControlFactory : public ProjectExplorer::IRunControlFactory {
|
2010-02-16 13:39:13 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-05-02 16:29:13 +02:00
|
|
|
explicit QmlProjectRunControlFactory(QObject *parent = 0);
|
|
|
|
|
virtual ~QmlProjectRunControlFactory();
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
// IRunControlFactory
|
|
|
|
|
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
|
|
|
|
|
virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
|
|
|
|
|
virtual QString displayName() const;
|
2011-02-28 12:23:12 +01:00
|
|
|
virtual ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration
|
|
|
|
|
*runConfiguration);
|
2010-08-13 14:18:10 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig);
|
2010-10-04 15:13:31 +02:00
|
|
|
static void showQmlObserverToolWarning();
|
2010-02-16 13:39:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProjectManager
|
|
|
|
|
|
|
|
|
|
#endif // QMLPROJECTRUNCONTROL_H
|