forked from qt-creator/qt-creator
ProjectExplorer: Factor out some common code in runconfigurations
DesktopQmake, CMake, Qbs, Nim, RemoteLinux and Qnx now have a common understanding what should be in a runnable and how their configuration widget should be set up. So move them over to using shared code, too. Several others runconfigs only lack a one or two more aspects to follow suit in later patches. Change-Id: Ia862c95c97d63bd0a0f2dc303435775a2fc530d3 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -35,10 +35,6 @@
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
@@ -47,21 +43,6 @@ namespace Internal {
|
||||
const char CMAKE_RC_PREFIX[] = "CMakeProjectManager.CMakeRunConfiguration.";
|
||||
const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title";
|
||||
|
||||
// Configuration widget
|
||||
class CMakeRunConfigurationWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
CMakeRunConfigurationWidget(RunConfiguration *rc)
|
||||
{
|
||||
auto fl = new QFormLayout(this);
|
||||
|
||||
rc->extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
}
|
||||
};
|
||||
|
||||
CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
|
||||
: RunConfiguration(target, CMAKE_RC_PREFIX)
|
||||
{
|
||||
@@ -88,17 +69,6 @@ CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
|
||||
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
||||
}
|
||||
|
||||
Runnable CMakeRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable r;
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
r.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
r.environment = extraAspect<LocalEnvironmentAspect>()->environment();
|
||||
r.runMode = extraAspect<TerminalAspect>()->runMode();
|
||||
return r;
|
||||
}
|
||||
|
||||
QVariantMap CMakeRunConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map(RunConfiguration::toMap());
|
||||
@@ -134,11 +104,6 @@ void CMakeRunConfiguration::updateEnabledState()
|
||||
RunConfiguration::updateEnabledState();
|
||||
}
|
||||
|
||||
QWidget *CMakeRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return wrapWidget(new CMakeRunConfigurationWidget(this));
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (!isBuildTargetValid())
|
||||
|
||||
@@ -38,9 +38,6 @@ public:
|
||||
explicit CMakeRunConfiguration(ProjectExplorer::Target *target);
|
||||
|
||||
private:
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
|
||||
QVariantMap toMap() const override;
|
||||
QString disabledReason() const override;
|
||||
|
||||
|
||||
@@ -36,26 +36,12 @@
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QFormLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Nim {
|
||||
|
||||
class NimRunConfigurationWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit NimRunConfigurationWidget(NimRunConfiguration *rc)
|
||||
{
|
||||
auto fl = new QFormLayout(this);
|
||||
rc->extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
rc->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
}
|
||||
};
|
||||
|
||||
NimRunConfiguration::NimRunConfiguration(Target *target)
|
||||
: RunConfiguration(target, Constants::C_NIMRUNCONFIGURATION_ID)
|
||||
{
|
||||
@@ -77,22 +63,6 @@ NimRunConfiguration::NimRunConfiguration(Target *target)
|
||||
updateConfiguration();
|
||||
}
|
||||
|
||||
QWidget *NimRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return wrapWidget(new NimRunConfigurationWidget(this));
|
||||
}
|
||||
|
||||
Runnable NimRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable result;
|
||||
result.runMode = extraAspect<TerminalAspect>()->runMode();
|
||||
result.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
result.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
result.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
result.environment = extraAspect<EnvironmentAspect>()->environment();
|
||||
return result;
|
||||
}
|
||||
|
||||
void NimRunConfiguration::updateConfiguration()
|
||||
{
|
||||
auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(activeBuildConfiguration());
|
||||
|
||||
@@ -38,9 +38,6 @@ class NimRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
public:
|
||||
explicit NimRunConfiguration(ProjectExplorer::Target *target);
|
||||
|
||||
QWidget *createConfigurationWidget() override;
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
|
||||
private:
|
||||
void updateConfiguration();
|
||||
void setActiveBuildConfiguration(NimBuildConfiguration *activeBuildConfiguration);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "buildconfiguration.h"
|
||||
#include "environmentaspect.h"
|
||||
#include "kitinformation.h"
|
||||
#include "runconfigurationaspects.h"
|
||||
#include "runnables.h"
|
||||
#include "session.h"
|
||||
#include "kitinformation.h"
|
||||
@@ -43,9 +44,9 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFormLayout>
|
||||
@@ -247,6 +248,37 @@ QString RunConfiguration::disabledReason() const
|
||||
return QString();
|
||||
}
|
||||
|
||||
QWidget *RunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
auto widget = new QWidget;
|
||||
auto formLayout = new QFormLayout(widget);
|
||||
|
||||
fillConfigurationLayout(formLayout);
|
||||
|
||||
Core::VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
return wrapWidget(widget);
|
||||
}
|
||||
|
||||
void RunConfiguration::fillConfigurationLayout(QFormLayout *layout) const
|
||||
{
|
||||
auto widget = layout->parentWidget();
|
||||
if (auto aspect = extraAspect<ExecutableAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
if (auto aspect = extraAspect<SymbolFileAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
if (auto aspect = extraAspect<ArgumentsAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
if (auto aspect = extraAspect<WorkingDirectoryAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
if (auto aspect = extraAspect<TerminalAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
if (auto aspect = extraAspect<UseLibraryPathsAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
if (auto aspect = extraAspect<UseDyldSuffixAspect>())
|
||||
aspect->addToMainConfigurationWidget(widget, layout);
|
||||
}
|
||||
|
||||
void RunConfiguration::updateEnabledState()
|
||||
{
|
||||
Project *p = target()->project();
|
||||
@@ -416,7 +448,18 @@ IRunConfigurationAspect *RunConfiguration::extraAspect(Core::Id id) const
|
||||
|
||||
Runnable RunConfiguration::runnable() const
|
||||
{
|
||||
return Runnable();
|
||||
StandardRunnable r;
|
||||
if (auto aspect = extraAspect<ExecutableAspect>())
|
||||
r.executable = aspect->executable().toString();
|
||||
if (auto aspect = extraAspect<ArgumentsAspect>())
|
||||
r.commandLineArguments = aspect->arguments();
|
||||
if (auto aspect = extraAspect<WorkingDirectoryAspect>())
|
||||
r.workingDirectory = aspect->workingDirectory().toString();
|
||||
if (auto aspect = extraAspect<EnvironmentAspect>())
|
||||
r.environment = aspect->environment();
|
||||
if (auto aspect = extraAspect<TerminalAspect>())
|
||||
r.runMode = aspect->runMode();
|
||||
return r;
|
||||
}
|
||||
|
||||
OutputFormatter *RunConfiguration::createOutputFormatter() const
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFormLayout;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class OutputFormatter; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -215,7 +219,8 @@ public:
|
||||
|
||||
QString disabledReason() const override;
|
||||
|
||||
virtual QWidget *createConfigurationWidget() = 0;
|
||||
virtual QWidget *createConfigurationWidget();
|
||||
virtual void fillConfigurationLayout(QFormLayout *layout) const;
|
||||
|
||||
virtual bool isConfigured() const;
|
||||
// Pop up configuration dialog in case for example the executable is missing.
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "qbsprojectmanagerconstants.h"
|
||||
#include "qbsproject.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <projectexplorer/deploymentdata.h>
|
||||
#include <projectexplorer/localenvironmentaspect.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -39,9 +37,7 @@
|
||||
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QFileInfo>
|
||||
#include <QFormLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -51,27 +47,6 @@ namespace Internal {
|
||||
|
||||
const char QBS_RC_PREFIX[] = "Qbs.RunConfiguration:";
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// QbsRunConfigurationWidget:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
class QbsRunConfigurationWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit QbsRunConfigurationWidget(RunConfiguration *rc)
|
||||
{
|
||||
auto toplayout = new QFormLayout(this);
|
||||
|
||||
rc->extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<UseLibraryPathsAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
|
||||
Core::VariableChooser::addSupportForChildWidgets(this, rc->macroExpander());
|
||||
}
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// QbsRunConfiguration:
|
||||
// --------------------------------------------------------------------
|
||||
@@ -134,22 +109,6 @@ void QbsRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &
|
||||
updateTargetInformation();
|
||||
}
|
||||
|
||||
QWidget *QbsRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return wrapWidget(new QbsRunConfigurationWidget(this));
|
||||
}
|
||||
|
||||
Runnable QbsRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable r;
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
r.runMode = extraAspect<TerminalAspect>()->runMode();
|
||||
r.environment = extraAspect<LocalEnvironmentAspect>()->environment();
|
||||
return r;
|
||||
}
|
||||
|
||||
void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
|
||||
{
|
||||
bool usingLibraryPaths = extraAspect<UseLibraryPathsAspect>()->value();
|
||||
|
||||
@@ -27,12 +27,9 @@
|
||||
|
||||
#include <projectexplorer/runnables.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QHash>
|
||||
#include <QLabel>
|
||||
#include <QPair>
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
@@ -41,15 +38,9 @@ class QbsRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
// to change the display name and arguments and set the userenvironmentchanges
|
||||
friend class QbsRunConfigurationWidget;
|
||||
|
||||
public:
|
||||
explicit QbsRunConfiguration(ProjectExplorer::Target *target);
|
||||
|
||||
QWidget *createConfigurationWidget() final;
|
||||
ProjectExplorer::Runnable runnable() const final;
|
||||
|
||||
void addToBaseEnvironment(Utils::Environment &env) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
#include "qmakeprojectmanagerconstants.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <projectexplorer/localenvironmentaspect.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
@@ -46,10 +46,8 @@
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QFormLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -114,43 +112,6 @@ void DesktopQmakeRunConfiguration::updateTargetInformation()
|
||||
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
}
|
||||
|
||||
//
|
||||
// DesktopQmakeRunConfigurationWidget
|
||||
//
|
||||
|
||||
DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(RunConfiguration *rc)
|
||||
: m_runConfiguration(rc)
|
||||
{
|
||||
auto toplayout = new QFormLayout(this);
|
||||
|
||||
rc->extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
rc->extraAspect<UseLibraryPathsAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
|
||||
if (HostOsInfo::isMacHost())
|
||||
rc->extraAspect<UseDyldSuffixAspect>()->addToMainConfigurationWidget(this, toplayout);
|
||||
|
||||
Core::VariableChooser::addSupportForChildWidgets(this, rc->macroExpander());
|
||||
}
|
||||
|
||||
QWidget *DesktopQmakeRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return wrapWidget(new DesktopQmakeRunConfigurationWidget(this));
|
||||
}
|
||||
|
||||
Runnable DesktopQmakeRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable r;
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
r.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
r.environment = extraAspect<LocalEnvironmentAspect>()->environment();
|
||||
r.runMode = extraAspect<TerminalAspect>()->runMode();
|
||||
return r;
|
||||
}
|
||||
|
||||
QVariantMap DesktopQmakeRunConfiguration::toMap() const
|
||||
{
|
||||
// FIXME: For compatibility purposes in the 4.7 dev cycle only.
|
||||
|
||||
@@ -40,9 +40,6 @@ class DesktopQmakeRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
public:
|
||||
explicit DesktopQmakeRunConfiguration(ProjectExplorer::Target *target);
|
||||
|
||||
QWidget *createConfigurationWidget() override;
|
||||
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
void addToBaseEnvironment(Utils::Environment &env) const;
|
||||
@@ -59,17 +56,6 @@ private:
|
||||
Utils::FileName proFilePath() const;
|
||||
};
|
||||
|
||||
class DesktopQmakeRunConfigurationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DesktopQmakeRunConfigurationWidget(ProjectExplorer::RunConfiguration *rc);
|
||||
|
||||
private:
|
||||
ProjectExplorer::RunConfiguration *m_runConfiguration = nullptr;
|
||||
};
|
||||
|
||||
class DesktopQmakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -62,18 +62,10 @@ Runnable QnxRunConfiguration::runnable() const
|
||||
return r;
|
||||
}
|
||||
|
||||
QWidget *QnxRunConfiguration::createConfigurationWidget()
|
||||
void QnxRunConfiguration::fillConfigurationLayout(QFormLayout *layout) const
|
||||
{
|
||||
auto widget = new QWidget;
|
||||
auto formLayout = new QFormLayout(widget);
|
||||
|
||||
extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<SymbolFileAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<QtLibPathAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
|
||||
return wrapWidget(widget);
|
||||
RemoteLinuxRunConfiguration::fillConfigurationLayout(layout);
|
||||
extraAspect<QtLibPathAspect>()->addToMainConfigurationWidget(layout->parentWidget(), layout);
|
||||
}
|
||||
|
||||
// QnxRunConfigurationFactory
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
private:
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
void fillConfigurationLayout(QFormLayout *layout) const override;
|
||||
};
|
||||
|
||||
class QnxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
|
||||
@@ -33,10 +33,6 @@
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -44,20 +40,6 @@ using namespace Utils;
|
||||
namespace RemoteLinux {
|
||||
namespace Internal {
|
||||
|
||||
class RemoteLinuxCustomRunConfigWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit RemoteLinuxCustomRunConfigWidget(RemoteLinuxCustomRunConfiguration *runConfig)
|
||||
{
|
||||
auto fl = new QFormLayout(this);
|
||||
|
||||
runConfig->extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
runConfig->extraAspect<SymbolFileAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
runConfig->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
runConfig->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, fl);
|
||||
}
|
||||
};
|
||||
|
||||
RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *target)
|
||||
: RunConfiguration(target, runConfigId())
|
||||
{
|
||||
@@ -99,21 +81,6 @@ RemoteLinuxCustomRunConfiguration::ensureConfigured(QString *errorMessage)
|
||||
return Configured;
|
||||
}
|
||||
|
||||
QWidget *RemoteLinuxCustomRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return wrapWidget(new RemoteLinuxCustomRunConfigWidget(this));
|
||||
}
|
||||
|
||||
Runnable RemoteLinuxCustomRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable r;
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.environment = extraAspect<RemoteLinuxEnvironmentAspect>()->environment();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
r.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
return r;
|
||||
}
|
||||
|
||||
Core::Id RemoteLinuxCustomRunConfiguration::runConfigId()
|
||||
{
|
||||
return "RemoteLinux.CustomRunConfig";
|
||||
|
||||
@@ -38,8 +38,6 @@ public:
|
||||
|
||||
bool isConfigured() const override;
|
||||
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
|
||||
static Core::Id runConfigId();
|
||||
QString runConfigDefaultDisplayName();
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
@@ -88,29 +86,6 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Core::I
|
||||
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
|
||||
}
|
||||
|
||||
QWidget *RemoteLinuxRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
auto widget = new QWidget;
|
||||
auto formLayout = new QFormLayout(widget);
|
||||
|
||||
extraAspect<ExecutableAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<SymbolFileAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(widget, formLayout);
|
||||
|
||||
return wrapWidget(widget);
|
||||
}
|
||||
|
||||
Runnable RemoteLinuxRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable r;
|
||||
r.environment = extraAspect<RemoteLinuxEnvironmentAspect>()->environment();
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
r.workingDirectory = extraAspect<WorkingDirectoryAspect>()->workingDirectory().toString();
|
||||
return r;
|
||||
}
|
||||
|
||||
void RemoteLinuxRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &)
|
||||
{
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
@@ -29,21 +29,15 @@
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
namespace RemoteLinux {
|
||||
|
||||
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class RemoteLinuxRunConfigurationWidget;
|
||||
|
||||
public:
|
||||
explicit RemoteLinuxRunConfiguration(ProjectExplorer::Target *target);
|
||||
|
||||
QWidget *createConfigurationWidget() override;
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
|
||||
static const char *IdPrefix;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user