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 QMLPROJECTRUNCONFIGURATION_H
|
|
|
|
|
#define QMLPROJECTRUNCONFIGURATION_H
|
|
|
|
|
|
|
|
|
|
#include "qmlprojectmanager_global.h"
|
2011-01-20 14:03:07 +01:00
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
2011-01-20 14:03:07 +01:00
|
|
|
|
|
|
|
|
#include <QtCore/QWeakPointer>
|
2010-04-13 10:58:30 +02:00
|
|
|
|
2010-12-16 12:05:48 +01:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QStringListModel)
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2010-03-05 11:11:05 +01:00
|
|
|
namespace Core {
|
|
|
|
|
class IEditor;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-29 12:50:44 +01:00
|
|
|
namespace Utils {
|
|
|
|
|
class Environment;
|
|
|
|
|
class EnvironmentItem;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-04 15:03:01 +02:00
|
|
|
namespace Qt4ProjectManager {
|
2010-11-29 09:45:30 +01:00
|
|
|
class QtVersion;
|
2010-10-04 15:03:01 +02:00
|
|
|
}
|
|
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
namespace QmlProjectManager {
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
2010-11-29 09:45:30 +01:00
|
|
|
class QmlProjectTarget;
|
|
|
|
|
class QmlProjectRunConfigurationFactory;
|
2010-11-29 11:42:58 +01:00
|
|
|
class QmlProjectRunConfigurationWidget;
|
2010-02-16 13:39:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class QMLPROJECTMANAGER_EXPORT QmlProjectRunConfiguration : public ProjectExplorer::RunConfiguration
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
friend class Internal::QmlProjectRunConfigurationFactory;
|
2010-11-29 11:42:58 +01:00
|
|
|
friend class Internal::QmlProjectRunConfigurationWidget;
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2010-10-06 10:03:51 +02:00
|
|
|
// used in qmldumptool.cpp
|
|
|
|
|
Q_PROPERTY(int qtVersionId READ qtVersionId)
|
|
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
public:
|
|
|
|
|
QmlProjectRunConfiguration(Internal::QmlProjectTarget *parent);
|
|
|
|
|
virtual ~QmlProjectRunConfiguration();
|
|
|
|
|
|
|
|
|
|
Internal::QmlProjectTarget *qmlTarget() const;
|
|
|
|
|
|
|
|
|
|
QString viewerPath() const;
|
2010-10-04 15:03:01 +02:00
|
|
|
QString observerPath() const;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString viewerArguments() const;
|
2010-02-16 13:39:13 +01:00
|
|
|
QString workingDirectory() const;
|
2010-10-06 10:03:51 +02:00
|
|
|
int qtVersionId() const;
|
2010-10-05 10:54:05 +02:00
|
|
|
Qt4ProjectManager::QtVersion *qtVersion() const;
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2010-12-03 17:04:29 +01:00
|
|
|
enum MainScriptSource {
|
|
|
|
|
FileInEditor,
|
|
|
|
|
FileInProjectFile,
|
|
|
|
|
FileInSettings
|
|
|
|
|
};
|
|
|
|
|
MainScriptSource mainScriptSource() const;
|
|
|
|
|
void setScriptSource(MainScriptSource source, const QString &settingsPath = QString());
|
|
|
|
|
|
2010-11-29 11:42:58 +01:00
|
|
|
QString mainScript() const;
|
|
|
|
|
|
2010-11-29 12:50:44 +01:00
|
|
|
Utils::Environment environment() const;
|
|
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
// RunConfiguration
|
2010-11-29 11:42:58 +01:00
|
|
|
bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
|
2010-04-16 11:46:47 +02:00
|
|
|
virtual QWidget *createConfigurationWidget();
|
2011-04-15 12:59:44 +02:00
|
|
|
Utils::OutputFormatter *createOutputFormatter() const;
|
2010-02-16 13:39:13 +01:00
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
|
2011-02-01 18:36:00 +01:00
|
|
|
ProjectExplorer::Abi abi() const;
|
|
|
|
|
|
2010-03-08 14:36:44 +01:00
|
|
|
public slots:
|
2010-03-05 11:11:05 +01:00
|
|
|
void changeCurrentFile(Core::IEditor*);
|
2010-03-08 14:36:44 +01:00
|
|
|
|
|
|
|
|
private slots:
|
2010-08-19 16:51:27 +02:00
|
|
|
void updateEnabled();
|
2010-10-04 15:03:01 +02:00
|
|
|
void updateQtVersions();
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
protected:
|
2010-11-29 09:45:30 +01:00
|
|
|
QmlProjectRunConfiguration(Internal::QmlProjectTarget *parent,
|
|
|
|
|
QmlProjectRunConfiguration *source);
|
2010-02-16 13:39:13 +01:00
|
|
|
virtual bool fromMap(const QVariantMap &map);
|
2010-03-05 11:11:05 +01:00
|
|
|
void setEnabled(bool value);
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void ctor();
|
2010-10-04 15:03:01 +02:00
|
|
|
static bool isValidVersion(Qt4ProjectManager::QtVersion *version);
|
2010-10-13 13:02:26 +02:00
|
|
|
void setQtVersionId(int id);
|
2010-12-21 12:39:14 +01:00
|
|
|
|
|
|
|
|
static QString canonicalCapsPath(const QString &filePath);
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2010-11-29 12:50:44 +01:00
|
|
|
Utils::Environment baseEnvironment() const;
|
|
|
|
|
void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff);
|
|
|
|
|
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
|
|
|
|
|
|
2010-03-05 11:11:05 +01:00
|
|
|
// absolute path to current file (if being used)
|
|
|
|
|
QString m_currentFileFilename;
|
|
|
|
|
// absolute path to selected main script (if being used)
|
|
|
|
|
QString m_mainScriptFilename;
|
|
|
|
|
|
2010-10-04 15:03:01 +02:00
|
|
|
int m_qtVersionId;
|
2010-02-16 13:39:13 +01:00
|
|
|
QString m_scriptFile;
|
|
|
|
|
QString m_qmlViewerArgs;
|
2010-04-15 11:59:22 +02:00
|
|
|
|
2010-03-08 14:36:44 +01:00
|
|
|
Internal::QmlProjectTarget *m_projectTarget;
|
2010-11-29 11:42:58 +01:00
|
|
|
QWeakPointer<Internal::QmlProjectRunConfigurationWidget> m_configurationWidget;
|
2010-03-08 14:36:44 +01:00
|
|
|
|
2010-03-05 11:11:05 +01:00
|
|
|
bool m_usingCurrentFile;
|
|
|
|
|
bool m_isEnabled;
|
2010-11-29 12:50:44 +01:00
|
|
|
|
|
|
|
|
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
2010-02-16 13:39:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace QmlProjectManager
|
|
|
|
|
|
|
|
|
|
#endif // QMLPROJECTRUNCONFIGURATION_H
|