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/runconfigurationaspects.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
|
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace CMakeProjectManager {
|
namespace CMakeProjectManager {
|
||||||
@@ -47,21 +43,6 @@ namespace Internal {
|
|||||||
const char CMAKE_RC_PREFIX[] = "CMakeProjectManager.CMakeRunConfiguration.";
|
const char CMAKE_RC_PREFIX[] = "CMakeProjectManager.CMakeRunConfiguration.";
|
||||||
const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title";
|
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)
|
CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
|
||||||
: RunConfiguration(target, CMAKE_RC_PREFIX)
|
: RunConfiguration(target, CMAKE_RC_PREFIX)
|
||||||
{
|
{
|
||||||
@@ -88,17 +69,6 @@ CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
|
|||||||
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
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 CMakeRunConfiguration::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map(RunConfiguration::toMap());
|
QVariantMap map(RunConfiguration::toMap());
|
||||||
@@ -134,11 +104,6 @@ void CMakeRunConfiguration::updateEnabledState()
|
|||||||
RunConfiguration::updateEnabledState();
|
RunConfiguration::updateEnabledState();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *CMakeRunConfiguration::createConfigurationWidget()
|
|
||||||
{
|
|
||||||
return wrapWidget(new CMakeRunConfigurationWidget(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CMakeRunConfiguration::disabledReason() const
|
QString CMakeRunConfiguration::disabledReason() const
|
||||||
{
|
{
|
||||||
if (!isBuildTargetValid())
|
if (!isBuildTargetValid())
|
||||||
|
|||||||
@@ -38,9 +38,6 @@ public:
|
|||||||
explicit CMakeRunConfiguration(ProjectExplorer::Target *target);
|
explicit CMakeRunConfiguration(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::Runnable runnable() const override;
|
|
||||||
QWidget *createConfigurationWidget() override;
|
|
||||||
|
|
||||||
QVariantMap toMap() const override;
|
QVariantMap toMap() const override;
|
||||||
QString disabledReason() const override;
|
QString disabledReason() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -36,26 +36,12 @@
|
|||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Nim {
|
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)
|
NimRunConfiguration::NimRunConfiguration(Target *target)
|
||||||
: RunConfiguration(target, Constants::C_NIMRUNCONFIGURATION_ID)
|
: RunConfiguration(target, Constants::C_NIMRUNCONFIGURATION_ID)
|
||||||
{
|
{
|
||||||
@@ -77,22 +63,6 @@ NimRunConfiguration::NimRunConfiguration(Target *target)
|
|||||||
updateConfiguration();
|
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()
|
void NimRunConfiguration::updateConfiguration()
|
||||||
{
|
{
|
||||||
auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(activeBuildConfiguration());
|
auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(activeBuildConfiguration());
|
||||||
|
|||||||
@@ -38,9 +38,6 @@ class NimRunConfiguration : public ProjectExplorer::RunConfiguration
|
|||||||
public:
|
public:
|
||||||
explicit NimRunConfiguration(ProjectExplorer::Target *target);
|
explicit NimRunConfiguration(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
QWidget *createConfigurationWidget() override;
|
|
||||||
ProjectExplorer::Runnable runnable() const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateConfiguration();
|
void updateConfiguration();
|
||||||
void setActiveBuildConfiguration(NimBuildConfiguration *activeBuildConfiguration);
|
void setActiveBuildConfiguration(NimBuildConfiguration *activeBuildConfiguration);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "buildconfiguration.h"
|
#include "buildconfiguration.h"
|
||||||
#include "environmentaspect.h"
|
#include "environmentaspect.h"
|
||||||
#include "kitinformation.h"
|
#include "kitinformation.h"
|
||||||
|
#include "runconfigurationaspects.h"
|
||||||
#include "runnables.h"
|
#include "runnables.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "kitinformation.h"
|
#include "kitinformation.h"
|
||||||
@@ -43,9 +44,9 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/variablechooser.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
@@ -247,6 +248,37 @@ QString RunConfiguration::disabledReason() const
|
|||||||
return QString();
|
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()
|
void RunConfiguration::updateEnabledState()
|
||||||
{
|
{
|
||||||
Project *p = target()->project();
|
Project *p = target()->project();
|
||||||
@@ -416,7 +448,18 @@ IRunConfigurationAspect *RunConfiguration::extraAspect(Core::Id id) const
|
|||||||
|
|
||||||
Runnable RunConfiguration::runnable() 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
|
OutputFormatter *RunConfiguration::createOutputFormatter() const
|
||||||
|
|||||||
@@ -42,6 +42,10 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QFormLayout;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils { class OutputFormatter; }
|
namespace Utils { class OutputFormatter; }
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -215,7 +219,8 @@ public:
|
|||||||
|
|
||||||
QString disabledReason() const override;
|
QString disabledReason() const override;
|
||||||
|
|
||||||
virtual QWidget *createConfigurationWidget() = 0;
|
virtual QWidget *createConfigurationWidget();
|
||||||
|
virtual void fillConfigurationLayout(QFormLayout *layout) const;
|
||||||
|
|
||||||
virtual bool isConfigured() const;
|
virtual bool isConfigured() const;
|
||||||
// Pop up configuration dialog in case for example the executable is missing.
|
// Pop up configuration dialog in case for example the executable is missing.
|
||||||
|
|||||||
@@ -29,8 +29,6 @@
|
|||||||
#include "qbsprojectmanagerconstants.h"
|
#include "qbsprojectmanagerconstants.h"
|
||||||
#include "qbsproject.h"
|
#include "qbsproject.h"
|
||||||
|
|
||||||
#include <coreplugin/variablechooser.h>
|
|
||||||
|
|
||||||
#include <projectexplorer/deploymentdata.h>
|
#include <projectexplorer/deploymentdata.h>
|
||||||
#include <projectexplorer/localenvironmentaspect.h>
|
#include <projectexplorer/localenvironmentaspect.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -39,9 +37,7 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtoutputformatter.h>
|
#include <qtsupport/qtoutputformatter.h>
|
||||||
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -51,27 +47,6 @@ namespace Internal {
|
|||||||
|
|
||||||
const char QBS_RC_PREFIX[] = "Qbs.RunConfiguration:";
|
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:
|
// QbsRunConfiguration:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
@@ -134,22 +109,6 @@ void QbsRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &
|
|||||||
updateTargetInformation();
|
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
|
void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
|
||||||
{
|
{
|
||||||
bool usingLibraryPaths = extraAspect<UseLibraryPathsAspect>()->value();
|
bool usingLibraryPaths = extraAspect<UseLibraryPathsAspect>()->value();
|
||||||
|
|||||||
@@ -27,12 +27,9 @@
|
|||||||
|
|
||||||
#include <projectexplorer/runnables.h>
|
#include <projectexplorer/runnables.h>
|
||||||
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QLabel>
|
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -41,15 +38,9 @@ class QbsRunConfiguration : public ProjectExplorer::RunConfiguration
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// to change the display name and arguments and set the userenvironmentchanges
|
|
||||||
friend class QbsRunConfigurationWidget;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QbsRunConfiguration(ProjectExplorer::Target *target);
|
explicit QbsRunConfiguration(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
QWidget *createConfigurationWidget() final;
|
|
||||||
ProjectExplorer::Runnable runnable() const final;
|
|
||||||
|
|
||||||
void addToBaseEnvironment(Utils::Environment &env) const;
|
void addToBaseEnvironment(Utils::Environment &env) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -27,13 +27,13 @@
|
|||||||
|
|
||||||
#include "qmakeprojectmanagerconstants.h"
|
#include "qmakeprojectmanagerconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/variablechooser.h>
|
|
||||||
#include <projectexplorer/localenvironmentaspect.h>
|
#include <projectexplorer/localenvironmentaspect.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <projectexplorer/runnables.h>
|
#include <projectexplorer/runnables.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtoutputformatter.h>
|
#include <qtsupport/qtoutputformatter.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
@@ -46,10 +46,8 @@
|
|||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -114,43 +112,6 @@ void DesktopQmakeRunConfiguration::updateTargetInformation()
|
|||||||
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
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
|
QVariantMap DesktopQmakeRunConfiguration::toMap() const
|
||||||
{
|
{
|
||||||
// FIXME: For compatibility purposes in the 4.7 dev cycle only.
|
// FIXME: For compatibility purposes in the 4.7 dev cycle only.
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ class DesktopQmakeRunConfiguration : public ProjectExplorer::RunConfiguration
|
|||||||
public:
|
public:
|
||||||
explicit DesktopQmakeRunConfiguration(ProjectExplorer::Target *target);
|
explicit DesktopQmakeRunConfiguration(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
QWidget *createConfigurationWidget() override;
|
|
||||||
|
|
||||||
ProjectExplorer::Runnable runnable() const override;
|
|
||||||
QVariantMap toMap() const override;
|
QVariantMap toMap() const override;
|
||||||
|
|
||||||
void addToBaseEnvironment(Utils::Environment &env) const;
|
void addToBaseEnvironment(Utils::Environment &env) const;
|
||||||
@@ -59,17 +56,6 @@ private:
|
|||||||
Utils::FileName proFilePath() const;
|
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
|
class DesktopQmakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -62,18 +62,10 @@ Runnable QnxRunConfiguration::runnable() const
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *QnxRunConfiguration::createConfigurationWidget()
|
void QnxRunConfiguration::fillConfigurationLayout(QFormLayout *layout) const
|
||||||
{
|
{
|
||||||
auto widget = new QWidget;
|
RemoteLinuxRunConfiguration::fillConfigurationLayout(layout);
|
||||||
auto formLayout = new QFormLayout(widget);
|
extraAspect<QtLibPathAspect>()->addToMainConfigurationWidget(layout->parentWidget(), layout);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// QnxRunConfigurationFactory
|
// QnxRunConfigurationFactory
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::Runnable runnable() const override;
|
ProjectExplorer::Runnable runnable() const override;
|
||||||
QWidget *createConfigurationWidget() override;
|
void fillConfigurationLayout(QFormLayout *layout) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QnxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
class QnxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||||
|
|||||||
@@ -33,10 +33,6 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qtsupport/qtoutputformatter.h>
|
#include <qtsupport/qtoutputformatter.h>
|
||||||
#include <utils/pathchooser.h>
|
|
||||||
|
|
||||||
#include <QFormLayout>
|
|
||||||
#include <QLabel>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -44,20 +40,6 @@ using namespace Utils;
|
|||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
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)
|
RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *target)
|
||||||
: RunConfiguration(target, runConfigId())
|
: RunConfiguration(target, runConfigId())
|
||||||
{
|
{
|
||||||
@@ -99,21 +81,6 @@ RemoteLinuxCustomRunConfiguration::ensureConfigured(QString *errorMessage)
|
|||||||
return Configured;
|
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()
|
Core::Id RemoteLinuxCustomRunConfiguration::runConfigId()
|
||||||
{
|
{
|
||||||
return "RemoteLinux.CustomRunConfig";
|
return "RemoteLinux.CustomRunConfig";
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ public:
|
|||||||
|
|
||||||
bool isConfigured() const override;
|
bool isConfigured() const override;
|
||||||
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
||||||
QWidget *createConfigurationWidget() override;
|
|
||||||
ProjectExplorer::Runnable runnable() const override;
|
|
||||||
|
|
||||||
static Core::Id runConfigId();
|
static Core::Id runConfigId();
|
||||||
QString runConfigDefaultDisplayName();
|
QString runConfigDefaultDisplayName();
|
||||||
|
|||||||
@@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtoutputformatter.h>
|
#include <qtsupport/qtoutputformatter.h>
|
||||||
|
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -88,29 +86,6 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Core::I
|
|||||||
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
|
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 &)
|
void RemoteLinuxRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &)
|
||||||
{
|
{
|
||||||
setDefaultDisplayName(defaultDisplayName());
|
setDefaultDisplayName(defaultDisplayName());
|
||||||
|
|||||||
@@ -29,21 +29,15 @@
|
|||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
|
||||||
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration
|
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class RemoteLinuxRunConfigurationWidget;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RemoteLinuxRunConfiguration(ProjectExplorer::Target *target);
|
explicit RemoteLinuxRunConfiguration(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
QWidget *createConfigurationWidget() override;
|
|
||||||
ProjectExplorer::Runnable runnable() const override;
|
|
||||||
|
|
||||||
static const char *IdPrefix;
|
static const char *IdPrefix;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user