2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-09 14:53:06 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-09 14:53:06 +01:00
|
|
|
|
|
|
|
|
#ifndef CMAKERUNCONFIGURATION_H
|
|
|
|
|
#define CMAKERUNCONFIGURATION_H
|
|
|
|
|
|
2013-01-28 12:56:56 +01:00
|
|
|
#include <projectexplorer/localapplicationrunconfiguration.h>
|
2010-09-23 10:35:23 +02:00
|
|
|
#include <utils/environment.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 {
|
2011-02-28 16:50:14 +01:00
|
|
|
class PathChooser;
|
|
|
|
|
class DetailsWidget;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-09 14:53:06 +01:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
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:
|
2012-04-24 15:49:09 +02:00
|
|
|
CMakeRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const QString &target,
|
2010-01-19 13:41:02 +01:00
|
|
|
const QString &workingDirectory, const QString &title);
|
|
|
|
|
~CMakeRunConfiguration();
|
|
|
|
|
|
|
|
|
|
QString executable() const;
|
2014-05-26 23:42:25 +03:00
|
|
|
ProjectExplorer::ApplicationLauncher::Mode runMode() const;
|
2010-01-19 13:41:02 +01:00
|
|
|
QString workingDirectory() const;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString commandLineArguments() 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);
|
2010-09-27 15:11:26 +01:00
|
|
|
void setBaseWorkingDirectory(const QString &workingDirectory);
|
2009-06-16 18:37:16 +02:00
|
|
|
|
2009-03-16 17:33:05 +01:00
|
|
|
QString title() const;
|
|
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
QVariantMap toMap() const;
|
2009-03-25 18:29:42 +01:00
|
|
|
|
2010-06-09 13:21:08 +02:00
|
|
|
void setEnabled(bool b);
|
|
|
|
|
|
2011-05-26 15:33:24 +02:00
|
|
|
bool isEnabled() const;
|
2011-05-26 16:30:35 +02:00
|
|
|
QString disabledReason() const;
|
2010-06-09 13:21:08 +02:00
|
|
|
|
2009-05-27 17:28:50 +02:00
|
|
|
signals:
|
2010-09-27 15:11:26 +01:00
|
|
|
void baseWorkingDirectoryChanged(const QString&);
|
2009-05-27 17:28:50 +02:00
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
protected:
|
2012-04-24 15:49:09 +02:00
|
|
|
CMakeRunConfiguration(ProjectExplorer::Target *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-09-27 15:11:26 +01:00
|
|
|
void setUserWorkingDirectory(const QString &workingDirectory);
|
2010-09-27 15:04:58 +01:00
|
|
|
QString baseWorkingDirectory() const;
|
2010-01-19 13:41:02 +01:00
|
|
|
void ctor();
|
|
|
|
|
|
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;
|
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:
|
2009-06-16 18:37:16 +02:00
|
|
|
void setWorkingDirectory();
|
|
|
|
|
void resetWorkingDirectory();
|
2013-01-29 18:00:30 +01:00
|
|
|
void environmentWasChanged();
|
2010-01-19 13:41:02 +01:00
|
|
|
|
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-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
|
|
|
|
2014-07-01 11:08:26 +02:00
|
|
|
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const;
|
2010-02-08 15:50:06 +01:00
|
|
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
|
|
|
|
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
|
|
|
|
|
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
|
|
|
|
|
|
2014-06-12 16:24:52 +02:00
|
|
|
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
|
2014-07-01 11:08:26 +02:00
|
|
|
QString displayNameForId(Core::Id id) const;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2012-07-17 15:56:43 +02:00
|
|
|
static Core::Id idFromBuildTarget(const QString &target);
|
|
|
|
|
static QString buildTargetFromId(Core::Id id);
|
|
|
|
|
|
2012-07-06 13:10:58 +02:00
|
|
|
private:
|
2012-04-24 15:49:09 +02:00
|
|
|
bool canHandle(ProjectExplorer::Target *parent) const;
|
2013-03-26 16:39:41 +01:00
|
|
|
|
2014-07-01 11:08:26 +02:00
|
|
|
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id);
|
2013-03-28 14:53:12 +01:00
|
|
|
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
|
|
|
|
const QVariantMap &map);
|
2008-12-09 14:53:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // CMAKERUNCONFIGURATION_H
|