2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Nokia.
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** 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.
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-09 14:53:06 +01:00
|
|
|
|
|
|
|
#ifndef CMAKERUNCONFIGURATION_H
|
|
|
|
#define CMAKERUNCONFIGURATION_H
|
|
|
|
|
|
|
|
#include <projectexplorer/applicationrunconfiguration.h>
|
|
|
|
#include <projectexplorer/persistentsettings.h>
|
2009-05-27 17:28:50 +02:00
|
|
|
#include <projectexplorer/environmenteditmodel.h>
|
2010-09-23 10:35:23 +02:00
|
|
|
#include <utils/environment.h>
|
2009-06-16 18:37:16 +02:00
|
|
|
#include <utils/pathchooser.h>
|
2009-10-01 19:04:53 +02:00
|
|
|
#include <utils/detailswidget.h>
|
2008-12-09 14:53:06 +01:00
|
|
|
|
2009-05-28 18:52:06 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
2009-07-20 15:46:11 +02:00
|
|
|
class QComboBox;
|
2009-06-08 14:47:13 +02:00
|
|
|
QT_END_NAMESPACE
|
2009-05-28 18:52:06 +02:00
|
|
|
|
2010-09-01 11:34:34 +02:00
|
|
|
namespace Utils {
|
|
|
|
class DebuggerLanguageChooser;
|
|
|
|
}
|
|
|
|
|
2008-12-09 14:53:06 +01:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
namespace Internal {
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
class CMakeBuildConfiguration;
|
|
|
|
class CMakeTarget;
|
2008-12-09 14:53:06 +01:00
|
|
|
|
2009-09-25 11:35:44 +02:00
|
|
|
class CMakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
2008-12-09 14:53:06 +01:00
|
|
|
{
|
2009-03-25 18:29:42 +01:00
|
|
|
Q_OBJECT
|
2010-01-19 13:41:02 +01:00
|
|
|
friend class CMakeRunConfigurationWidget;
|
|
|
|
friend class CMakeRunConfigurationFactory;
|
|
|
|
|
2008-12-09 14:53:06 +01:00
|
|
|
public:
|
2010-02-08 15:50:06 +01:00
|
|
|
CMakeRunConfiguration(CMakeTarget *parent, const QString &target,
|
2010-01-19 13:41:02 +01:00
|
|
|
const QString &workingDirectory, const QString &title);
|
|
|
|
~CMakeRunConfiguration();
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
CMakeTarget *cmakeTarget() const;
|
|
|
|
CMakeBuildConfiguration *activeBuildConfiguration() const;
|
2009-11-26 14:43:27 +01:00
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
QString executable() const;
|
|
|
|
RunMode runMode() const;
|
|
|
|
QString workingDirectory() const;
|
|
|
|
QStringList commandLineArguments() const;
|
2010-09-23 10:35:23 +02:00
|
|
|
Utils::Environment environment() const;
|
2010-04-16 11:46:47 +02:00
|
|
|
QWidget *createConfigurationWidget();
|
2008-12-09 14:53:06 +01:00
|
|
|
|
2009-03-16 17:33:05 +01:00
|
|
|
void setExecutable(const QString &executable);
|
|
|
|
void setWorkingDirectory(const QString &workingDirectory);
|
|
|
|
|
2009-06-16 18:37:16 +02:00
|
|
|
void setUserWorkingDirectory(const QString &workingDirectory);
|
|
|
|
|
2009-03-16 17:33:05 +01:00
|
|
|
QString title() const;
|
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
QString dumperLibrary() const;
|
|
|
|
QStringList dumperLibraryLocations() const;
|
|
|
|
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
|
|
|
|
|
|
|
QVariantMap toMap() const;
|
2009-03-25 18:29:42 +01:00
|
|
|
|
2010-06-09 13:21:08 +02:00
|
|
|
void setEnabled(bool b);
|
|
|
|
|
|
|
|
bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
|
|
|
|
using LocalApplicationRunConfiguration::isEnabled;
|
|
|
|
|
2009-05-27 17:28:50 +02:00
|
|
|
signals:
|
|
|
|
void baseEnvironmentChanged();
|
2010-09-23 10:35:23 +02:00
|
|
|
void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff);
|
2009-06-16 18:37:16 +02:00
|
|
|
void workingDirectoryChanged(const QString&);
|
2009-05-27 17:28:50 +02:00
|
|
|
|
2009-03-25 18:29:42 +01:00
|
|
|
private slots:
|
|
|
|
void setArguments(const QString &newText);
|
2010-01-19 13:41:02 +01:00
|
|
|
|
|
|
|
protected:
|
2010-02-08 15:50:06 +01:00
|
|
|
CMakeRunConfiguration(CMakeTarget *parent, CMakeRunConfiguration *source);
|
2010-01-19 13:41:02 +01:00
|
|
|
virtual bool fromMap(const QVariantMap &map);
|
2010-08-19 12:26:21 +02:00
|
|
|
QString defaultDisplayName() const;
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2008-12-09 14:53:06 +01:00
|
|
|
private:
|
2010-01-19 13:41:02 +01:00
|
|
|
void ctor();
|
|
|
|
|
2009-07-20 15:46:11 +02:00
|
|
|
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
|
|
|
SystemEnvironmentBase = 1,
|
|
|
|
BuildEnvironmentBase = 2};
|
2009-05-28 18:52:06 +02:00
|
|
|
void setBaseEnvironmentBase(BaseEnvironmentBase env);
|
|
|
|
BaseEnvironmentBase baseEnvironmentBase() const;
|
2010-09-23 10:35:23 +02:00
|
|
|
Utils::Environment baseEnvironment() const;
|
2009-12-14 13:40:17 +01:00
|
|
|
QString baseEnvironmentText() const;
|
|
|
|
|
2010-09-23 10:35:23 +02:00
|
|
|
void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff);
|
|
|
|
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
|
2009-05-27 17:28:50 +02:00
|
|
|
|
2009-02-18 17:04:04 +01:00
|
|
|
RunMode m_runMode;
|
2010-02-02 12:01:11 +01:00
|
|
|
QString m_buildTarget;
|
2008-12-09 14:53:06 +01:00
|
|
|
QString m_workingDirectory;
|
2009-06-16 18:37:16 +02:00
|
|
|
QString m_userWorkingDirectory;
|
2009-03-16 17:33:05 +01:00
|
|
|
QString m_title;
|
2009-03-25 18:29:42 +01:00
|
|
|
QString m_arguments;
|
2010-09-23 10:35:23 +02:00
|
|
|
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
2009-05-28 18:52:06 +02:00
|
|
|
BaseEnvironmentBase m_baseEnvironmentBase;
|
2010-06-09 13:21:08 +02:00
|
|
|
bool m_enabled;
|
2009-05-27 17:28:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CMakeRunConfigurationWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2010-08-26 18:35:30 +02:00
|
|
|
explicit CMakeRunConfigurationWidget(CMakeRunConfiguration *cmakeRunConfiguration, QWidget *parent = 0);
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2009-05-27 17:28:50 +02:00
|
|
|
private slots:
|
|
|
|
void setArguments(const QString &args);
|
|
|
|
void baseEnvironmentChanged();
|
|
|
|
void userEnvironmentChangesChanged();
|
2009-12-03 19:45:09 +01:00
|
|
|
void userChangesChanged();
|
2009-06-16 18:37:16 +02:00
|
|
|
void setWorkingDirectory();
|
|
|
|
void resetWorkingDirectory();
|
2010-09-01 11:34:34 +02:00
|
|
|
void useCppDebuggerToggled(bool toggled);
|
|
|
|
void useQmlDebuggerToggled(bool toggled);
|
2010-09-02 17:17:35 +02:00
|
|
|
void qmlDebugServerPortChanged(uint port);
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2009-05-28 18:52:06 +02:00
|
|
|
private slots:
|
2009-07-20 15:46:11 +02:00
|
|
|
void baseEnvironmentComboBoxChanged(int index);
|
2009-06-16 18:37:16 +02:00
|
|
|
void workingDirectoryChanged(const QString &workingDirectory);
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2009-05-27 17:28:50 +02:00
|
|
|
private:
|
2010-01-19 13:41:02 +01:00
|
|
|
void ctor();
|
2009-05-28 18:52:06 +02:00
|
|
|
bool m_ignoreChange;
|
2009-05-27 17:28:50 +02:00
|
|
|
CMakeRunConfiguration *m_cmakeRunConfiguration;
|
2009-10-05 11:06:05 +02:00
|
|
|
Utils::PathChooser *m_workingDirectoryEdit;
|
2009-07-20 15:46:11 +02:00
|
|
|
QComboBox *m_baseEnvironmentComboBox;
|
2010-09-01 11:34:34 +02:00
|
|
|
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
|
2009-05-27 17:28:50 +02:00
|
|
|
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
|
2009-10-01 19:04:53 +02:00
|
|
|
Utils::DetailsWidget *m_detailsContainer;
|
2008-12-09 14:53:06 +01:00
|
|
|
};
|
|
|
|
|
2009-01-12 18:26:26 +01:00
|
|
|
class CMakeRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
2008-12-09 14:53:06 +01:00
|
|
|
{
|
2009-07-11 09:41:57 +02:00
|
|
|
Q_OBJECT
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2008-12-09 14:53:06 +01:00
|
|
|
public:
|
2010-01-19 13:41:02 +01:00
|
|
|
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
|
|
|
|
~CMakeRunConfigurationFactory();
|
2010-02-08 15:50:06 +01:00
|
|
|
|
|
|
|
bool canCreate(ProjectExplorer::Target *parent, const QString &id) const;
|
|
|
|
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const QString &id);
|
|
|
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
|
|
|
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
|
|
|
|
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
|
|
|
|
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
|
|
|
|
|
|
|
|
QStringList availableCreationIds(ProjectExplorer::Target *parent) const;
|
2010-01-19 13:41:02 +01:00
|
|
|
QString displayNameForId(const QString &id) const;
|
2008-12-09 14:53:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CMAKERUNCONFIGURATION_H
|