Commit 602d899e authored by hjk's avatar hjk

Move CustomExecutableRunConfiguration to ProjectExplorer

There's nothing QtSupport specific in there.

Change-Id: I616a37ed56f1853cdbb16f483de5682d5ea63715
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 87e8f03c
......@@ -47,7 +47,6 @@
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <utils/algorithm.h>
......
......@@ -32,14 +32,7 @@
#include "androidruncontrol.h"
#include "androidmanager.h"
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <debugger/debuggerconstants.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
using namespace ProjectExplorer;
......
......@@ -41,7 +41,6 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcassert.h>
......
......@@ -41,6 +41,7 @@
#include <cpptools/projectpartbuilder.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/buildtargetinfo.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/headerpath.h>
......@@ -50,7 +51,6 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <cpptools/generatedcodemodelsupport.h>
......
......@@ -39,12 +39,12 @@
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/headerpath.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
......@@ -419,7 +419,7 @@ Project::RestoreResult GenericProject::fromMap(const QVariantMap &map, QString *
continue;
}
if (!t->activeRunConfiguration())
t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t));
t->addRunConfiguration(new CustomExecutableRunConfiguration(t));
}
refresh(Everything);
......
......@@ -32,16 +32,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <QDir>
#include <QFileSystemWatcher>
#include <QList>
#include <QProcess>
#include <QApplication>
#include <QDomDocument>
using namespace QmakeProjectManager;
using namespace ProjectExplorer;
......
......@@ -35,17 +35,17 @@
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/debuggerconstants.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/target.h>
#include <debugger/debuggerconstants.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <coreplugin/id.h>
using namespace Debugger;
......
......@@ -24,13 +24,14 @@
****************************************************************************/
#include "customexecutableconfigurationwidget.h"
#include "customexecutablerunconfiguration.h"
#include "environmentaspect.h"
#include "project.h"
#include "runconfigurationaspects.h"
#include "target.h"
#include <coreplugin/variablechooser.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/project.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/target.h>
#include <utils/detailswidget.h>
#include <utils/pathchooser.h>
......@@ -41,10 +42,9 @@
#include <QLabel>
#include <QLineEdit>
using namespace ProjectExplorer;
using namespace Utils;
namespace QtSupport {
namespace ProjectExplorer {
namespace Internal {
CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc, ApplyMode mode)
......@@ -181,4 +181,4 @@ bool CustomExecutableConfigurationWidget::isValid() const
}
} // namespace Internal
} // namespace QtSupport
} // namespace ProjectExplorer
......@@ -41,11 +41,9 @@ class PathChooser;
}
namespace ProjectExplorer {
class ArgumentsAspect;
class TerminalAspect;
}
namespace QtSupport {
class CustomExecutableRunConfiguration;
namespace Internal {
......@@ -81,4 +79,4 @@ private:
};
} // namespace Internal
} // namespace QtSupport
} // namespace ProjectExplorer
......@@ -24,16 +24,15 @@
****************************************************************************/
#include "customexecutablerunconfiguration.h"
#include "customexecutableconfigurationwidget.h"
#include "qtkitinformation.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/localenvironmentaspect.h>
#include <projectexplorer/project.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/target.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include "abi.h"
#include "buildconfiguration.h"
#include "customexecutableconfigurationwidget.h"
#include "devicesupport/devicemanager.h"
#include "localenvironmentaspect.h"
#include "project.h"
#include "runconfigurationaspects.h"
#include "target.h"
#include <coreplugin/icore.h>
......@@ -42,22 +41,19 @@
#include <QDialog>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QDir>
#include <QKeyEvent>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QDir>
using namespace ProjectExplorer::Internal;
using namespace QtSupport;
using namespace QtSupport::Internal;
using namespace ProjectExplorer;
namespace ProjectExplorer {
namespace {
const char CUSTOM_EXECUTABLE_ID[] = "ProjectExplorer.CustomExecutableRunConfiguration";
const char EXECUTABLE_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.Executable";
const char WORKING_DIRECTORY_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory";
}
void CustomExecutableRunConfiguration::ctor()
{
......@@ -69,12 +65,12 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *paren
m_dialog(0)
{
addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier()));
addExtraAspect(new ArgumentsAspect(this, QStringLiteral("ProjectExplorer.CustomExecutableRunConfiguration.Arguments")));
addExtraAspect(new TerminalAspect(this, QStringLiteral("ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal")));
addExtraAspect(new ArgumentsAspect(this, "ProjectExplorer.CustomExecutableRunConfiguration.Arguments"));
addExtraAspect(new TerminalAspect(this, "ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal"));
if (parent->activeBuildConfiguration())
m_workingDirectory = QLatin1String(Constants::DEFAULT_WORKING_DIR);
m_workingDirectory = Constants::DEFAULT_WORKING_DIR;
else
m_workingDirectory = QLatin1String(Constants::DEFAULT_WORKING_DIR_ALTERNATE);
m_workingDirectory = Constants::DEFAULT_WORKING_DIR_ALTERNATE;
ctor();
}
......@@ -395,4 +391,6 @@ QString CustomExecutableRunConfigurationFactory::displayNameForId(Core::Id id) c
return QString();
}
} // namespace ProjectExplorer
#include "customexecutablerunconfiguration.moc"
......@@ -25,20 +25,17 @@
#pragma once
#include "qtsupport_global.h"
#include "projectexplorer_global.h"
#include <projectexplorer/runnables.h>
#include "projectexplorer/runnables.h"
#include <QVariantMap>
namespace ProjectExplorer {
namespace ProjectExplorer { class Target; }
namespace QtSupport {
namespace Internal { class CustomExecutableConfigurationWidget; }
class CustomExecutableRunConfigurationFactory;
class QTSUPPORT_EXPORT CustomExecutableRunConfiguration : public ProjectExplorer::RunConfiguration
class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public RunConfiguration
{
Q_OBJECT
// the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments
......@@ -46,7 +43,7 @@ class QTSUPPORT_EXPORT CustomExecutableRunConfiguration : public ProjectExplorer
friend class CustomExecutableRunConfigurationFactory;
public:
explicit CustomExecutableRunConfiguration(ProjectExplorer::Target *parent);
explicit CustomExecutableRunConfiguration(Target *parent);
~CustomExecutableRunConfiguration() override;
/**
......@@ -55,25 +52,21 @@ public:
*/
QString executable() const;
QString workingDirectory() const;
ProjectExplorer::Runnable runnable() const override;
Runnable runnable() const override;
/** Returns whether this runconfiguration ever was configured with an executable
*/
bool isConfigured() const override;
QWidget *createConfigurationWidget() override;
ProjectExplorer::Abi abi() const override;
Abi abi() const override;
QVariantMap toMap() const override;
ConfigurationState ensureConfigured(QString *errorMessage) override;
signals:
void changed();
protected:
CustomExecutableRunConfiguration(ProjectExplorer::Target *parent,
CustomExecutableRunConfiguration(Target *parent,
CustomExecutableRunConfiguration *source);
virtual bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName() const;
......@@ -89,7 +82,7 @@ private:
void setBaseWorkingDirectory(const QString &workingDirectory);
QString baseWorkingDirectory() const;
void setUserName(const QString &name);
void setRunMode(ProjectExplorer::ApplicationLauncher::Mode runMode);
void setRunMode(ApplicationLauncher::Mode runMode);
bool validateExecutable(QString *executable = 0, QString *errorMessage = 0) const;
QString m_executable;
......@@ -97,28 +90,26 @@ private:
QWidget *m_dialog;
};
class CustomExecutableRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
class CustomExecutableRunConfigurationFactory : public IRunConfigurationFactory
{
Q_OBJECT
public:
explicit CustomExecutableRunConfigurationFactory(QObject *parent = 0);
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const override;
QList<Core::Id> availableCreationIds(Target *parent, CreationMode mode) const override;
QString displayNameForId(Core::Id id) const override;
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const override;
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const override;
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const override;
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
ProjectExplorer::RunConfiguration *source) override;
bool canCreate(Target *parent, Core::Id id) const override;
bool canRestore(Target *parent, const QVariantMap &map) const override;
bool canClone(Target *parent, RunConfiguration *product) const override;
RunConfiguration *clone(Target *parent, RunConfiguration *source) override;
private:
bool canHandle(ProjectExplorer::Target *parent) const;
bool canHandle(Target *parent) const;
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id) override;
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
const QVariantMap &map) override;
RunConfiguration *doCreate(Target *parent, Core::Id id) override;
RunConfiguration *doRestore(Target *parent, const QVariantMap &map) override;
};
} // namespace QtSupport
} // namespace ProjectExplorer
......@@ -27,6 +27,7 @@
#include "buildsteplist.h"
#include "configtaskhandler.h"
#include "customexecutablerunconfiguration.h"
#include "customwizard/customwizard.h"
#include "deployablefile.h"
#include "deployconfiguration.h"
......@@ -608,6 +609,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
addAutoReleasedObject(new CurrentProjectFind);
addAutoReleasedObject(new LocalApplicationRunControlFactory);
addAutoReleasedObject(new CustomExecutableRunConfigurationFactory);
addAutoReleasedObject(new ProjectFileWizardExtension);
......
......@@ -155,7 +155,9 @@ HEADERS += projectexplorer.h \
waitforstopdialog.h \
projectexplorericons.h \
projectexplorer_global.h \
extracompiler.h
extracompiler.h \
customexecutableconfigurationwidget.h \
customexecutablerunconfiguration.h
SOURCES += projectexplorer.cpp \
abi.cpp \
......@@ -295,7 +297,9 @@ SOURCES += projectexplorer.cpp \
projecttree.cpp \
expanddata.cpp \
waitforstopdialog.cpp \
extracompiler.cpp
extracompiler.cpp \
customexecutableconfigurationwidget.cpp \
customexecutablerunconfiguration.cpp
FORMS += processstep.ui \
editorsettingspropertiespage.ui \
......
......@@ -49,6 +49,8 @@ QtcPlugin {
"copytaskhandler.cpp", "copytaskhandler.h",
"currentprojectfilter.cpp", "currentprojectfilter.h",
"currentprojectfind.cpp", "currentprojectfind.h",
"customexecutableconfigurationwidget.cpp", "customexecutableconfigurationwidget.h",
"customexecutablerunconfiguration.cpp", "customexecutablerunconfiguration.h",
"customparser.cpp", "customparser.h",
"customparserconfigdialog.cpp", "customparserconfigdialog.h", "customparserconfigdialog.ui",
"customtoolchain.cpp", "customtoolchain.h",
......
......@@ -34,7 +34,6 @@
#include <debugger/debuggerconstants.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
......
......@@ -21,8 +21,6 @@ HEADERS += \
baseqtversion.h \
qmldumptool.h \
qtoptionspage.h \
customexecutablerunconfiguration.h \
customexecutableconfigurationwidget.h \
qtsupportconstants.h \
profilereader.h \
qtparser.h \
......@@ -50,8 +48,6 @@ SOURCES += \
baseqtversion.cpp \
qmldumptool.cpp \
qtoptionspage.cpp \
customexecutablerunconfiguration.cpp \
customexecutableconfigurationwidget.cpp \
profilereader.cpp \
qtparser.cpp \
exampleslistmodel.cpp \
......
......@@ -65,10 +65,6 @@ QtcPlugin {
"qtconfigwidget.cpp",
"qtconfigwidget.h",
"qtsupport.qrc",
"customexecutableconfigurationwidget.cpp",
"customexecutableconfigurationwidget.h",
"customexecutablerunconfiguration.cpp",
"customexecutablerunconfiguration.h",
"exampleslistmodel.cpp",
"exampleslistmodel.h",
"profilereader.cpp",
......
......@@ -27,7 +27,6 @@
#include "codegenerator.h"
#include "codegensettingspage.h"
#include "customexecutablerunconfiguration.h"
#include "desktopqtversionfactory.h"
#include "gettingstartedwelcomepage.h"
#include "qtkitinformation.h"
......@@ -84,7 +83,6 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
welcomePage = new ExamplesWelcomePage;
addAutoReleasedObject(welcomePage);
addAutoReleasedObject(new CustomExecutableRunConfigurationFactory);
ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment