forked from qt-creator/qt-creator
ProjectExplorer: Introduce base class for enabled/disabled project configuration
... and use this as a base for all RunConfigurations. Clean out code in the individual run configurations dealing with their enabled/disabled state. Change-Id: Icc2ea136b056f7aea7ce96480b4402459d7ac0ce Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -40,7 +40,6 @@ public:
|
||||
BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent,
|
||||
BareMetalCustomRunConfiguration *source);
|
||||
|
||||
bool isEnabled() const override { return true; }
|
||||
bool isConfigured() const override;
|
||||
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
|
@@ -75,17 +75,6 @@ void BareMetalRunConfiguration::init()
|
||||
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated); // Handles device changes, etc.
|
||||
}
|
||||
|
||||
bool BareMetalRunConfiguration::isEnabled() const
|
||||
{
|
||||
m_disabledReason.clear(); // FIXME: Check this makes sense.
|
||||
return true;
|
||||
}
|
||||
|
||||
QString BareMetalRunConfiguration::disabledReason() const
|
||||
{
|
||||
return m_disabledReason;
|
||||
}
|
||||
|
||||
QWidget *BareMetalRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return new BareMetalRunConfigurationWidget(this);
|
||||
@@ -167,11 +156,6 @@ QString BareMetalRunConfiguration::buildSystemTarget() const
|
||||
return (bst == targets.list.constEnd()) ? QString() : bst->targetName;
|
||||
}
|
||||
|
||||
void BareMetalRunConfiguration::setDisabledReason(const QString &reason) const
|
||||
{
|
||||
m_disabledReason = reason;
|
||||
}
|
||||
|
||||
void BareMetalRunConfiguration::handleBuildSystemDataUpdated()
|
||||
{
|
||||
emit targetInformationChanged();
|
||||
|
@@ -44,8 +44,6 @@ public:
|
||||
explicit BareMetalRunConfiguration(ProjectExplorer::Target *parent, Core::Id id,
|
||||
const QString &projectFilePath);
|
||||
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
Utils::OutputFormatter *createOutputFormatter() const override;
|
||||
|
||||
@@ -70,14 +68,12 @@ protected:
|
||||
BareMetalRunConfiguration(ProjectExplorer::Target *parent, BareMetalRunConfiguration *source);
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
QString defaultDisplayName();
|
||||
void setDisabledReason(const QString &reason) const;
|
||||
|
||||
private:
|
||||
void handleBuildSystemDataUpdated();
|
||||
void init();
|
||||
|
||||
QString m_projectFilePath;
|
||||
mutable QString m_disabledReason;
|
||||
QString m_workingDirectory;
|
||||
};
|
||||
|
||||
|
@@ -152,7 +152,7 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
|
||||
}
|
||||
|
||||
updateApplicationAndDeploymentTargets();
|
||||
updateTargetRunConfigurations(t);
|
||||
t->updateDefaultRunConfigurations();
|
||||
|
||||
createGeneratedCodeModelSupport();
|
||||
|
||||
@@ -446,35 +446,6 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
|
||||
}
|
||||
}
|
||||
|
||||
void CMakeProject::updateTargetRunConfigurations(Target *t)
|
||||
{
|
||||
// *Update* existing runconfigurations (no need to update new ones!):
|
||||
QHash<QString, const CMakeBuildTarget *> buildTargetHash;
|
||||
const QList<CMakeBuildTarget> buildTargetList = buildTargets();
|
||||
foreach (const CMakeBuildTarget &bt, buildTargetList) {
|
||||
if (bt.targetType != ExecutableType || bt.executable.isEmpty())
|
||||
continue;
|
||||
|
||||
buildTargetHash.insert(bt.title, &bt);
|
||||
}
|
||||
|
||||
foreach (RunConfiguration *rc, t->runConfigurations()) {
|
||||
auto cmakeRc = qobject_cast<CMakeRunConfiguration *>(rc);
|
||||
if (!cmakeRc)
|
||||
continue;
|
||||
|
||||
auto btIt = buildTargetHash.constFind(cmakeRc->title());
|
||||
cmakeRc->setEnabled(btIt != buildTargetHash.constEnd());
|
||||
if (btIt != buildTargetHash.constEnd()) {
|
||||
cmakeRc->setExecutable(btIt.value()->executable.toString());
|
||||
cmakeRc->setBaseWorkingDirectory(btIt.value()->workingDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
// create new and remove obsolete RCs using the factories
|
||||
t->updateDefaultRunConfigurations();
|
||||
}
|
||||
|
||||
void CMakeProject::updateApplicationAndDeploymentTargets()
|
||||
{
|
||||
Target *t = activeTarget();
|
||||
|
@@ -122,7 +122,6 @@ private:
|
||||
|
||||
void createGeneratedCodeModelSupport();
|
||||
QStringList filesGeneratedFrom(const QString &sourceFile) const final;
|
||||
void updateTargetRunConfigurations(ProjectExplorer::Target *t);
|
||||
void updateApplicationAndDeploymentTargets();
|
||||
|
||||
ProjectExplorer::Target *m_connectedTarget = nullptr;
|
||||
|
@@ -82,8 +82,7 @@ CMakeRunConfiguration::CMakeRunConfiguration(Target *parent, CMakeRunConfigurati
|
||||
RunConfiguration(parent, source),
|
||||
m_buildSystemTarget(source->m_buildSystemTarget),
|
||||
m_executable(source->m_executable),
|
||||
m_title(source->m_title),
|
||||
m_enabled(source->m_enabled)
|
||||
m_title(source->m_title)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
@@ -144,12 +143,16 @@ QString CMakeRunConfiguration::defaultDisplayName() const
|
||||
{
|
||||
if (m_title.isEmpty())
|
||||
return tr("Run CMake kit");
|
||||
QString result = m_title;
|
||||
if (!m_enabled) {
|
||||
result += QLatin1Char(' ');
|
||||
result += tr("(disabled)");
|
||||
}
|
||||
return result;
|
||||
return m_title;
|
||||
}
|
||||
|
||||
void CMakeRunConfiguration::updateEnabledState()
|
||||
{
|
||||
auto cp = qobject_cast<CMakeProject *>(target()->project());
|
||||
if (!cp->hasBuildTarget(m_buildSystemTarget))
|
||||
setEnabled(false);
|
||||
else
|
||||
RunConfiguration::updateEnabledState();
|
||||
}
|
||||
|
||||
QWidget *CMakeRunConfiguration::createConfigurationWidget()
|
||||
@@ -157,25 +160,14 @@ QWidget *CMakeRunConfiguration::createConfigurationWidget()
|
||||
return new CMakeRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
void CMakeRunConfiguration::setEnabled(bool b)
|
||||
{
|
||||
if (m_enabled == b)
|
||||
return;
|
||||
m_enabled = b;
|
||||
emit enabledChanged();
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
bool CMakeRunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (!m_enabled)
|
||||
return tr("The executable is not built by the current build configuration");
|
||||
return QString();
|
||||
auto cp = qobject_cast<CMakeProject *>(target()->project());
|
||||
QTC_ASSERT(cp, return QString());
|
||||
|
||||
if (cp->hasParsingData() && !cp->hasBuildTarget(m_buildSystemTarget))
|
||||
return tr("The project no longer builds the target associated with this run configuration.");
|
||||
return RunConfiguration::disabledReason();
|
||||
}
|
||||
|
||||
static void updateExecutable(CMakeRunConfiguration *rc, Utils::FancyLineEdit *fle)
|
||||
|
@@ -51,9 +51,6 @@ public:
|
||||
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
void setEnabled(bool b);
|
||||
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
|
||||
QString buildSystemTarget() const final { return m_buildSystemTarget; }
|
||||
@@ -63,6 +60,8 @@ protected:
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
QString defaultDisplayName() const;
|
||||
|
||||
void updateEnabledState() final;
|
||||
|
||||
private:
|
||||
QString baseWorkingDirectory() const;
|
||||
void ctor();
|
||||
@@ -70,7 +69,6 @@ private:
|
||||
const QString m_buildSystemTarget;
|
||||
QString m_executable;
|
||||
QString m_title;
|
||||
bool m_enabled = true;
|
||||
};
|
||||
|
||||
class CMakeRunConfigurationWidget : public QWidget
|
||||
|
@@ -111,48 +111,16 @@ IosRunConfiguration::IosRunConfiguration(Target *parent, IosRunConfiguration *so
|
||||
|
||||
void IosRunConfiguration::init()
|
||||
{
|
||||
QmakeProject *project = static_cast<QmakeProject *>(target()->project());
|
||||
m_parseSuccess = project->validParse(m_profilePath);
|
||||
m_parseInProgress = project->parseInProgress(m_profilePath);
|
||||
m_lastIsEnabled = isEnabled();
|
||||
m_lastDisabledReason = disabledReason();
|
||||
updateDisplayNames();
|
||||
connect(DeviceManager::instance(), &DeviceManager::updated,
|
||||
this, &IosRunConfiguration::deviceChanges);
|
||||
connect(KitManager::instance(), &KitManager::kitsChanged,
|
||||
this, &IosRunConfiguration::deviceChanges);
|
||||
connect(project, &QmakeProject::proFileUpdated,
|
||||
this, &IosRunConfiguration::proFileUpdated);
|
||||
}
|
||||
|
||||
void IosRunConfiguration::enabledCheck()
|
||||
{
|
||||
bool newIsEnabled = isEnabled();
|
||||
QString newDisabledReason = disabledReason();
|
||||
if (newDisabledReason != m_lastDisabledReason || newIsEnabled != m_lastIsEnabled) {
|
||||
m_lastDisabledReason = newDisabledReason;
|
||||
m_lastIsEnabled = newIsEnabled;
|
||||
emit enabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void IosRunConfiguration::deviceChanges() {
|
||||
updateDisplayNames();
|
||||
enabledCheck();
|
||||
}
|
||||
|
||||
void IosRunConfiguration::proFileUpdated(QmakeProFile *pro, bool success,
|
||||
bool parseInProgress)
|
||||
{
|
||||
if (m_profilePath != pro->filePath())
|
||||
return;
|
||||
m_parseSuccess = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (success && !parseInProgress) {
|
||||
updateDisplayNames();
|
||||
emit localExecutableChanged();
|
||||
}
|
||||
enabledCheck();
|
||||
updateEnabledState();
|
||||
}
|
||||
|
||||
QWidget *IosRunConfiguration::createConfigurationWidget()
|
||||
@@ -182,6 +150,21 @@ void IosRunConfiguration::updateDisplayNames()
|
||||
setDisplayName(tr("Run %1 on %2").arg(applicationName()).arg(devName));
|
||||
}
|
||||
|
||||
void IosRunConfiguration::updateEnabledState()
|
||||
{
|
||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
|
||||
if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
return RunConfiguration::updateEnabledState();
|
||||
}
|
||||
|
||||
IosDeployStep *IosRunConfiguration::deployStep() const
|
||||
{
|
||||
DeployConfiguration *config = target()->activeDeployConfiguration();
|
||||
@@ -287,26 +270,8 @@ QString IosRunConfiguration::buildSystemTarget() const
|
||||
return static_cast<QmakeProject *>(target()->project())->mapProFilePathToTarget(m_profilePath);
|
||||
}
|
||||
|
||||
bool IosRunConfiguration::isEnabled() const
|
||||
{
|
||||
if (m_parseInProgress || !m_parseSuccess)
|
||||
return false;
|
||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
|
||||
return false;
|
||||
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
|
||||
if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse)
|
||||
return false;
|
||||
return RunConfiguration::isEnabled();
|
||||
}
|
||||
|
||||
QString IosRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file \"%1\" is currently being parsed.").arg(m_profilePath.fileName());
|
||||
if (!m_parseSuccess)
|
||||
return static_cast<QmakeProject *>(target()->project())
|
||||
->disabledReasonForRunConfiguration(m_profilePath);
|
||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
|
||||
return tr("Kit has incorrect device type for running on iOS devices.");
|
||||
|
@@ -58,7 +58,6 @@ public:
|
||||
QString applicationName() const;
|
||||
Utils::FileName bundleDirectory() const;
|
||||
Utils::FileName localExecutable() const;
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
IosDeviceType deviceType() const;
|
||||
void setDeviceType(const IosDeviceType &deviceType);
|
||||
@@ -75,18 +74,13 @@ signals:
|
||||
void localExecutableChanged();
|
||||
|
||||
private:
|
||||
void proFileUpdated(QmakeProjectManager::QmakeProFile *pro, bool success, bool parseInProgress);
|
||||
void deviceChanges();
|
||||
void init();
|
||||
void enabledCheck();
|
||||
friend class IosRunConfigurationWidget;
|
||||
void updateDisplayNames();
|
||||
void updateEnabledState() final;
|
||||
|
||||
Utils::FileName m_profilePath;
|
||||
QString m_lastDisabledReason;
|
||||
bool m_lastIsEnabled;
|
||||
bool m_parseInProgress;
|
||||
bool m_parseSuccess;
|
||||
IosDeviceType m_deviceType;
|
||||
};
|
||||
|
||||
|
@@ -123,3 +123,26 @@ QString ProjectExplorer::displayNameFromMap(const QVariantMap &map)
|
||||
{
|
||||
return map.value(QLatin1String(DISPLAY_NAME_KEY), QString()).toString();
|
||||
}
|
||||
|
||||
bool StatefulProjectConfiguration::isEnabled() const
|
||||
{
|
||||
return m_isEnabled;
|
||||
}
|
||||
|
||||
StatefulProjectConfiguration::StatefulProjectConfiguration(QObject *parent, Core::Id id) :
|
||||
ProjectConfiguration(parent, id)
|
||||
{ }
|
||||
|
||||
StatefulProjectConfiguration::StatefulProjectConfiguration(QObject *parent,
|
||||
const StatefulProjectConfiguration *source) :
|
||||
ProjectConfiguration(parent, source),
|
||||
m_isEnabled(source->m_isEnabled)
|
||||
{ }
|
||||
|
||||
void StatefulProjectConfiguration::setEnabled(bool enabled)
|
||||
{
|
||||
if (enabled == m_isEnabled)
|
||||
return;
|
||||
m_isEnabled = enabled;
|
||||
emit enabledChanged();
|
||||
}
|
||||
|
@@ -81,6 +81,30 @@ private:
|
||||
Utils::MacroExpander m_macroExpander;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT StatefulProjectConfiguration : public ProjectConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StatefulProjectConfiguration() = default;
|
||||
|
||||
bool isEnabled() const;
|
||||
|
||||
virtual QString disabledReason() const = 0;
|
||||
|
||||
signals:
|
||||
void enabledChanged();
|
||||
|
||||
protected:
|
||||
StatefulProjectConfiguration(QObject *parent, Core::Id id);
|
||||
StatefulProjectConfiguration(QObject *parent, const StatefulProjectConfiguration *source);
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
private:
|
||||
bool m_isEnabled;
|
||||
};
|
||||
|
||||
// helper functions:
|
||||
PROJECTEXPLORER_EXPORT Core::Id idFromMap(const QVariantMap &map);
|
||||
PROJECTEXPLORER_EXPORT QString displayNameFromMap(const QVariantMap &map);
|
||||
|
@@ -172,21 +172,24 @@ void IRunConfigurationAspect::resetProjectToGlobalSettings()
|
||||
A run configuration specifies how a target should be run, while a runner
|
||||
does the actual running.
|
||||
|
||||
All RunControls and the target hold a shared pointer to the run
|
||||
configuration. That is, the lifetime of the run configuration might exceed
|
||||
the life of the target.
|
||||
The user might still have a RunControl running (or output tab of that RunControl open)
|
||||
and yet unloaded the target.
|
||||
The target owns the RunConfiguraitons and a RunControl will need to copy all
|
||||
necessary data as the RunControl may continue to exist after the RunConfiguration
|
||||
has been destroyed.
|
||||
|
||||
Also, a run configuration might be already removed from the list of run
|
||||
configurations
|
||||
for a target, but still be runnable via the output tab.
|
||||
A RunConfiguration disables itself when the project is parsing or has no parsing
|
||||
data available. The disabledReason() method can be used to get a user-facing string
|
||||
describing why the RunConfiguration considers itself unfit for use.
|
||||
|
||||
Override updateEnabledState() to change the enabled state handling. Override
|
||||
disabledReasons() to provide better/more descriptions to the user.
|
||||
|
||||
Connect signals that may change enabled state of your RunConfiguration to updateEnabledState.
|
||||
*/
|
||||
|
||||
static std::vector<RunConfiguration::AspectFactory> theAspectFactories;
|
||||
|
||||
RunConfiguration::RunConfiguration(Target *target, Core::Id id) :
|
||||
ProjectConfiguration(target, id)
|
||||
StatefulProjectConfiguration(target, id)
|
||||
{
|
||||
Q_ASSERT(target);
|
||||
ctor();
|
||||
@@ -196,7 +199,7 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id) :
|
||||
}
|
||||
|
||||
RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
|
||||
ProjectConfiguration(target, source)
|
||||
StatefulProjectConfiguration(target, source)
|
||||
{
|
||||
Q_ASSERT(target);
|
||||
ctor();
|
||||
@@ -212,6 +215,22 @@ RunConfiguration::~RunConfiguration()
|
||||
qDeleteAll(m_aspects);
|
||||
}
|
||||
|
||||
QString RunConfiguration::disabledReason() const
|
||||
{
|
||||
if (target()->project()->isParsing())
|
||||
return tr("The Project is currently being parsed.");
|
||||
if (!target()->project()->hasParsingData())
|
||||
return tr("The project could not be fully parsed.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
void RunConfiguration::updateEnabledState()
|
||||
{
|
||||
Project *p = target()->project();
|
||||
|
||||
setEnabled(!p->isParsing() && p->hasParsingData());
|
||||
}
|
||||
|
||||
void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
|
||||
{
|
||||
theAspectFactories.push_back(aspectFactory);
|
||||
@@ -225,6 +244,17 @@ void RunConfiguration::addExtraAspect(IRunConfigurationAspect *aspect)
|
||||
|
||||
void RunConfiguration::ctor()
|
||||
{
|
||||
connect(target()->project(), &Project::parsingStarted,
|
||||
this, [this]() { updateEnabledState(); });
|
||||
connect(target()->project(), &Project::parsingFinished,
|
||||
this, [this]() { updateEnabledState(); });
|
||||
|
||||
connect(target(), &Target::addedRunConfiguration,
|
||||
this, [this](const RunConfiguration *rc) {
|
||||
if (rc == this)
|
||||
updateEnabledState();
|
||||
});
|
||||
|
||||
connect(this, &RunConfiguration::enabledChanged,
|
||||
this, &RunConfiguration::requestRunActionsUpdate);
|
||||
|
||||
@@ -259,20 +289,6 @@ RunConfiguration *RunConfiguration::startupRunConfiguration()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*!
|
||||
Checks whether a run configuration is enabled.
|
||||
*/
|
||||
|
||||
bool RunConfiguration::isEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QString RunConfiguration::disabledReason() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool RunConfiguration::isConfigured() const
|
||||
{
|
||||
return true;
|
||||
@@ -287,7 +303,6 @@ RunConfiguration::ConfigurationState RunConfiguration::ensureConfigured(QString
|
||||
return UnConfigured;
|
||||
}
|
||||
|
||||
|
||||
BuildConfiguration *RunConfiguration::activeBuildConfiguration() const
|
||||
{
|
||||
if (!target())
|
||||
|
@@ -199,15 +199,15 @@ private:
|
||||
};
|
||||
|
||||
// Documentation inside.
|
||||
class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
|
||||
class PROJECTEXPLORER_EXPORT RunConfiguration : public StatefulProjectConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
~RunConfiguration() override;
|
||||
|
||||
virtual bool isEnabled() const;
|
||||
virtual QString disabledReason() const;
|
||||
QString disabledReason() const override;
|
||||
|
||||
virtual QWidget *createConfigurationWidget() = 0;
|
||||
|
||||
virtual bool isConfigured() const;
|
||||
@@ -252,7 +252,6 @@ public:
|
||||
}
|
||||
|
||||
signals:
|
||||
void enabledChanged();
|
||||
void requestRunActionsUpdate();
|
||||
void configurationFinished();
|
||||
|
||||
@@ -263,6 +262,8 @@ protected:
|
||||
/// convenience function to get current build configuration.
|
||||
BuildConfiguration *activeBuildConfiguration() const;
|
||||
|
||||
virtual void updateEnabledState();
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
|
@@ -156,8 +156,6 @@ public:
|
||||
QWidget *createConfigurationWidget() override;
|
||||
QVariantMap toMap() const override;
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
bool isEnabled() const override { return m_enabled; }
|
||||
QString disabledReason() const override;
|
||||
Runnable runnable() const override;
|
||||
|
||||
bool supportsDebugger() const { return true; }
|
||||
@@ -165,7 +163,6 @@ public:
|
||||
QString arguments() const;
|
||||
QString interpreter() const { return m_interpreter; }
|
||||
void setInterpreter(const QString &interpreter) { m_interpreter = interpreter; }
|
||||
void setEnabled(bool b);
|
||||
|
||||
private:
|
||||
friend class PythonRunConfigurationFactory;
|
||||
@@ -174,15 +171,13 @@ private:
|
||||
|
||||
QString m_interpreter;
|
||||
QString m_mainScript;
|
||||
bool m_enabled;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
PythonRunConfiguration::PythonRunConfiguration(Target *parent, Core::Id id) :
|
||||
RunConfiguration(parent, id),
|
||||
m_mainScript(scriptFromId(id)),
|
||||
m_enabled(true)
|
||||
m_mainScript(scriptFromId(id))
|
||||
{
|
||||
Environment sysEnv = Environment::systemEnvironment();
|
||||
const QString exec = sysEnv.searchInPath("python").toString();
|
||||
@@ -197,8 +192,7 @@ PythonRunConfiguration::PythonRunConfiguration(Target *parent, Core::Id id) :
|
||||
PythonRunConfiguration::PythonRunConfiguration(Target *parent, PythonRunConfiguration *source) :
|
||||
RunConfiguration(parent, source),
|
||||
m_interpreter(source->interpreter()),
|
||||
m_mainScript(source->m_mainScript),
|
||||
m_enabled(source->m_enabled)
|
||||
m_mainScript(source->m_mainScript)
|
||||
{
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
@@ -220,10 +214,7 @@ bool PythonRunConfiguration::fromMap(const QVariantMap &map)
|
||||
|
||||
QString PythonRunConfiguration::defaultDisplayName() const
|
||||
{
|
||||
QString result = tr("Run %1").arg(m_mainScript);
|
||||
if (!m_enabled)
|
||||
result += ' ' + tr("(disabled)");
|
||||
return result;
|
||||
return tr("Run %1").arg(m_mainScript);
|
||||
}
|
||||
|
||||
QWidget *PythonRunConfiguration::createConfigurationWidget()
|
||||
@@ -231,22 +222,6 @@ QWidget *PythonRunConfiguration::createConfigurationWidget()
|
||||
return new PythonRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
void PythonRunConfiguration::setEnabled(bool b)
|
||||
{
|
||||
if (m_enabled == b)
|
||||
return;
|
||||
m_enabled = b;
|
||||
emit enabledChanged();
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
QString PythonRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (!m_enabled)
|
||||
return tr("The script is currently disabled.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
Runnable PythonRunConfiguration::runnable() const
|
||||
{
|
||||
StandardRunnable r;
|
||||
|
@@ -44,11 +44,11 @@
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/persistentsettings.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include "api/runenvironment.h"
|
||||
|
||||
@@ -140,34 +140,15 @@ QbsRunConfiguration::QbsRunConfiguration(Target *parent, QbsRunConfiguration *so
|
||||
ctor();
|
||||
}
|
||||
|
||||
bool QbsRunConfiguration::isEnabled() const
|
||||
{
|
||||
QbsProject *project = static_cast<QbsProject *>(target()->project());
|
||||
return !project->isParsing() && project->hasParseResult();
|
||||
}
|
||||
|
||||
QString QbsRunConfiguration::disabledReason() const
|
||||
{
|
||||
QbsProject *project = static_cast<QbsProject *>(target()->project());
|
||||
if (project->isParsing())
|
||||
return tr("The .qbs files are currently being parsed.");
|
||||
|
||||
if (!project->hasParseResult())
|
||||
return tr("Parsing of .qbs files has failed.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
void QbsRunConfiguration::ctor()
|
||||
{
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
QbsProject *project = static_cast<QbsProject *>(target()->project());
|
||||
connect(project, &Project::parsingStarted, this, &RunConfiguration::enabledChanged);
|
||||
connect(project, &Project::parsingFinished, this, [this](bool success) {
|
||||
auto terminalAspect = extraAspect<TerminalAspect>();
|
||||
if (success && !terminalAspect->isUserSet())
|
||||
terminalAspect->setUseTerminal(isConsoleApplication());
|
||||
emit enabledChanged();
|
||||
});
|
||||
connect(BuildManager::instance(), &BuildManager::buildStateChanged, this,
|
||||
[this, project](Project *p) {
|
||||
|
@@ -64,8 +64,6 @@ class QbsRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
public:
|
||||
QbsRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
||||
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
|
@@ -58,26 +58,20 @@ QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *parent, Core:
|
||||
: AndroidRunConfiguration(parent, id)
|
||||
, m_proFilePath(path)
|
||||
{
|
||||
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
|
||||
m_parseSuccess = project->validParse(m_proFilePath);
|
||||
m_parseInProgress = project->parseInProgress(m_proFilePath);
|
||||
init();
|
||||
ctor();
|
||||
}
|
||||
|
||||
QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *parent, QmakeAndroidRunConfiguration *source)
|
||||
: AndroidRunConfiguration(parent, source)
|
||||
, m_proFilePath(source->m_proFilePath)
|
||||
, m_parseSuccess(source->m_parseSuccess)
|
||||
, m_parseInProgress(source->m_parseInProgress)
|
||||
{
|
||||
init();
|
||||
ctor();
|
||||
}
|
||||
|
||||
void QmakeAndroidRunConfiguration::init()
|
||||
void QmakeAndroidRunConfiguration::ctor()
|
||||
{
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
connect(qmakeProject(), &QmakeProject::proFileUpdated,
|
||||
this, &QmakeAndroidRunConfiguration::proFileUpdated);
|
||||
QTC_CHECK(!m_proFilePath.isEmpty());
|
||||
}
|
||||
|
||||
bool QmakeAndroidRunConfiguration::fromMap(const QVariantMap &map)
|
||||
@@ -86,24 +80,17 @@ bool QmakeAndroidRunConfiguration::fromMap(const QVariantMap &map)
|
||||
QTC_ASSERT(project, return false);
|
||||
const QDir projectDir = QDir(project->projectDirectory().toString());
|
||||
m_proFilePath = Utils::FileName::fromUserInput(projectDir.filePath(map.value(PRO_FILE_KEY).toString()));
|
||||
m_parseSuccess = project->validParse(m_proFilePath);
|
||||
m_parseInProgress = project->parseInProgress(m_proFilePath);
|
||||
|
||||
return AndroidRunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QVariantMap QmakeAndroidRunConfiguration::toMap() const
|
||||
{
|
||||
QmakeProject *project = qmakeProject();
|
||||
if (m_proFilePath.isEmpty()) {
|
||||
if (!project->rootProjectNode())
|
||||
return QVariantMap();
|
||||
m_proFilePath = project->rootProjectNode()->filePath();
|
||||
}
|
||||
|
||||
const QDir projectDir = QDir(project->projectDirectory().toString());
|
||||
QVariantMap map(AndroidRunConfiguration::toMap());
|
||||
|
||||
const QDir projectDir = QDir(target()->project()->projectDirectory().toString());
|
||||
map.insert(PRO_FILE_KEY, projectDir.relativeFilePath(m_proFilePath.toString()));
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -120,18 +107,13 @@ QString QmakeAndroidRunConfiguration::defaultDisplayName()
|
||||
return QFileInfo(pathFromId(id())).completeBaseName();
|
||||
}
|
||||
|
||||
bool QmakeAndroidRunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_parseSuccess && !m_parseInProgress;
|
||||
}
|
||||
|
||||
QString QmakeAndroidRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
if (qmakeProject()->isParsing())
|
||||
return tr("The .pro file \"%1\" is currently being parsed.")
|
||||
.arg(m_proFilePath.fileName());
|
||||
|
||||
if (!m_parseSuccess)
|
||||
if (!qmakeProject()->hasParsingData())
|
||||
return qmakeProject()->disabledReasonForRunConfiguration(m_proFilePath);
|
||||
return QString();
|
||||
}
|
||||
@@ -141,27 +123,6 @@ QString QmakeAndroidRunConfiguration::buildSystemTarget() const
|
||||
return qmakeProject()->mapProFilePathToTarget(m_proFilePath);
|
||||
}
|
||||
|
||||
void QmakeAndroidRunConfiguration::proFileUpdated(QmakeProjectManager::QmakeProFile *pro,
|
||||
bool success, bool parseInProgress)
|
||||
{
|
||||
QmakeProject *project = qmakeProject();
|
||||
if (m_proFilePath.isEmpty() && project->rootProjectNode())
|
||||
m_proFilePath = project->rootProjectNode()->filePath();
|
||||
|
||||
if (m_proFilePath != pro->filePath())
|
||||
return;
|
||||
|
||||
bool enabled = isEnabled();
|
||||
QString reason = disabledReason();
|
||||
m_parseSuccess = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled() || reason != disabledReason())
|
||||
emit enabledChanged();
|
||||
|
||||
if (!parseInProgress)
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
QmakeProject *QmakeAndroidRunConfiguration::qmakeProject() const
|
||||
{
|
||||
Target *t = target();
|
||||
|
@@ -48,7 +48,6 @@ public:
|
||||
|
||||
Utils::FileName proFilePath() const;
|
||||
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
|
||||
QString buildSystemTarget() const final;
|
||||
@@ -61,13 +60,10 @@ protected:
|
||||
QString defaultDisplayName();
|
||||
|
||||
private:
|
||||
void proFileUpdated(QmakeProjectManager::QmakeProFile *pro, bool success, bool parseInProgress);
|
||||
QmakeProjectManager::QmakeProject *qmakeProject() const;
|
||||
void init();
|
||||
void ctor();
|
||||
|
||||
mutable Utils::FileName m_proFilePath;
|
||||
bool m_parseSuccess;
|
||||
bool m_parseInProgress;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -87,9 +87,6 @@ DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Core:
|
||||
addExtraAspect(new TerminalAspect(this, QStringLiteral("Qt4ProjectManager.Qt4RunConfiguration.UseTerminal")));
|
||||
addExtraAspect(new WorkingDirectoryAspect(this,
|
||||
QStringLiteral("Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory")));
|
||||
QmakeProject *project = qmakeProject();
|
||||
m_parseSuccess = project->validParse(m_proFilePath);
|
||||
m_parseInProgress = project->parseInProgress(m_proFilePath);
|
||||
|
||||
ctor();
|
||||
}
|
||||
@@ -98,44 +95,11 @@ DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Deskt
|
||||
RunConfiguration(parent, source),
|
||||
m_proFilePath(source->m_proFilePath),
|
||||
m_isUsingDyldImageSuffix(source->m_isUsingDyldImageSuffix),
|
||||
m_isUsingLibrarySearchPath(source->m_isUsingLibrarySearchPath),
|
||||
m_parseSuccess(source->m_parseSuccess),
|
||||
m_parseInProgress(source->m_parseInProgress)
|
||||
m_isUsingLibrarySearchPath(source->m_isUsingLibrarySearchPath)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
bool DesktopQmakeRunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_parseSuccess && !m_parseInProgress;
|
||||
}
|
||||
|
||||
QString DesktopQmakeRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file \"%1\" is currently being parsed.")
|
||||
.arg(m_proFilePath.fileName());
|
||||
|
||||
if (!m_parseSuccess)
|
||||
return qmakeProject()->disabledReasonForRunConfiguration(m_proFilePath);
|
||||
return QString();
|
||||
}
|
||||
|
||||
void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFile *pro, bool success, bool parseInProgress)
|
||||
{
|
||||
if (m_proFilePath != pro->filePath())
|
||||
return;
|
||||
const bool enabled = isEnabled();
|
||||
const QString reason = disabledReason();
|
||||
m_parseSuccess = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled() || reason != disabledReason())
|
||||
emit enabledChanged();
|
||||
|
||||
if (!parseInProgress)
|
||||
updateTargetInformation();
|
||||
}
|
||||
|
||||
void DesktopQmakeRunConfiguration::proFileEvaluated()
|
||||
{
|
||||
// We depend on all .pro files for the LD_LIBRARY_PATH so we emit a signal for all .pro files
|
||||
@@ -165,8 +129,8 @@ void DesktopQmakeRunConfiguration::ctor()
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
QmakeProject *project = qmakeProject();
|
||||
connect(project, &QmakeProject::proFileUpdated,
|
||||
this, &DesktopQmakeRunConfiguration::proFileUpdated);
|
||||
connect(project, &Project::parsingFinished,
|
||||
this, &DesktopQmakeRunConfiguration::updateTargetInformation);
|
||||
connect(project, &QmakeProject::proFilesEvaluated,
|
||||
this, &DesktopQmakeRunConfiguration::proFileEvaluated);
|
||||
|
||||
@@ -337,9 +301,6 @@ bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map)
|
||||
m_isUsingDyldImageSuffix = map.value(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), false).toBool();
|
||||
m_isUsingLibrarySearchPath = map.value(QLatin1String(USE_LIBRARY_SEARCH_PATH), true).toBool();
|
||||
|
||||
m_parseSuccess = qmakeProject()->validParse(m_proFilePath);
|
||||
m_parseInProgress = qmakeProject()->parseInProgress(m_proFilePath);
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
|
@@ -58,8 +58,6 @@ class DesktopQmakeRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
public:
|
||||
DesktopQmakeRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
||||
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
@@ -94,7 +92,6 @@ protected:
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
|
||||
private:
|
||||
void proFileUpdated(QmakeProjectManager::QmakeProFile *pro, bool success, bool parseInProgress);
|
||||
void proFileEvaluated();
|
||||
void updateTargetInformation();
|
||||
|
||||
@@ -113,8 +110,6 @@ private:
|
||||
// Cached startup sub project information
|
||||
bool m_isUsingDyldImageSuffix = false;
|
||||
bool m_isUsingLibrarySearchPath = true;
|
||||
bool m_parseSuccess = false;
|
||||
bool m_parseInProgress = false;
|
||||
};
|
||||
|
||||
class DesktopQmakeRunConfigurationWidget : public QWidget
|
||||
|
@@ -733,22 +733,6 @@ QmakeProFileNode *QmakeProject::rootProjectNode() const
|
||||
return static_cast<QmakeProFileNode *>(Project::rootProjectNode());
|
||||
}
|
||||
|
||||
bool QmakeProject::validParse(const FileName &proFilePath) const
|
||||
{
|
||||
if (!rootProFile())
|
||||
return false;
|
||||
const QmakeProFile *pro = rootProFile()->findProFile(proFilePath);
|
||||
return pro && pro->validParse();
|
||||
}
|
||||
|
||||
bool QmakeProject::parseInProgress(const FileName &proFilePath) const
|
||||
{
|
||||
if (!rootProFile())
|
||||
return false;
|
||||
const QmakeProFile *pro = rootProFile()->findProFile(proFilePath);
|
||||
return pro && pro->parseInProgress();
|
||||
}
|
||||
|
||||
QList<QmakeProFile *>
|
||||
QmakeProject::collectAllProFiles(QmakeProFile *file, Parsing parse,
|
||||
const QList<ProjectType> &projectTypes)
|
||||
|
@@ -68,8 +68,6 @@ public:
|
||||
bool supportsKit(ProjectExplorer::Kit *k, QString *errorMesage) const final;
|
||||
|
||||
QmakeProFileNode *rootProjectNode() const final;
|
||||
bool validParse(const Utils::FileName &proFilePath) const;
|
||||
bool parseInProgress(const Utils::FileName &proFilePath) const;
|
||||
|
||||
virtual QStringList filesGeneratedFrom(const QString &file) const final;
|
||||
|
||||
|
@@ -101,7 +101,7 @@ void QmlProject::addedRunConfiguration(RunConfiguration *rc)
|
||||
// they have been added to a project
|
||||
QmlProjectRunConfiguration *qmlrc = qobject_cast<QmlProjectRunConfiguration *>(rc);
|
||||
if (qmlrc)
|
||||
qmlrc->updateEnabled();
|
||||
qmlrc->updateEnabledState();
|
||||
}
|
||||
|
||||
QDir QmlProject::projectDir() const
|
||||
|
@@ -53,8 +53,7 @@ const char M_CURRENT_FILE[] = "CurrentFile";
|
||||
|
||||
QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *parent, Id id) :
|
||||
RunConfiguration(parent, id),
|
||||
m_scriptFile(QLatin1String(M_CURRENT_FILE)),
|
||||
m_isEnabled(false)
|
||||
m_scriptFile(QLatin1String(M_CURRENT_FILE))
|
||||
{
|
||||
addExtraAspect(new QmlProjectEnvironmentAspect(this));
|
||||
|
||||
@@ -79,22 +78,18 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *parent,
|
||||
m_currentFileFilename(source->m_currentFileFilename),
|
||||
m_mainScriptFilename(source->m_mainScriptFilename),
|
||||
m_scriptFile(source->m_scriptFile),
|
||||
m_qmlViewerArgs(source->m_qmlViewerArgs),
|
||||
m_isEnabled(source->m_isEnabled)
|
||||
m_qmlViewerArgs(source->m_qmlViewerArgs)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
bool QmlProjectRunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_isEnabled;
|
||||
}
|
||||
|
||||
QString QmlProjectRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (!m_isEnabled)
|
||||
if (mainScript().isEmpty())
|
||||
return tr("No script file to execute.");
|
||||
if (!QFileInfo(executable()).exists())
|
||||
return tr("No qmlviewer or qmlscene found.");
|
||||
return QString();
|
||||
return RunConfiguration::disabledReason();
|
||||
}
|
||||
|
||||
void QmlProjectRunConfiguration::ctor()
|
||||
@@ -106,13 +101,13 @@ void QmlProjectRunConfiguration::ctor()
|
||||
this, [this] { changeCurrentFile(); });
|
||||
|
||||
connect(target(), &Target::kitChanged,
|
||||
this, &QmlProjectRunConfiguration::updateEnabled);
|
||||
this, &QmlProjectRunConfiguration::updateEnabledState);
|
||||
|
||||
if (id() == Constants::QML_SCENE_RC_ID)
|
||||
setDisplayName(tr("QML Scene", "QMLRunConfiguration display name."));
|
||||
else
|
||||
setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name."));
|
||||
updateEnabled();
|
||||
updateEnabledState();
|
||||
}
|
||||
|
||||
QString QmlProjectRunConfiguration::executable() const
|
||||
@@ -215,7 +210,7 @@ void QmlProjectRunConfiguration::setScriptSource(MainScriptSource source,
|
||||
m_mainScriptFilename
|
||||
= target()->project()->projectDirectory().toString() + QLatin1Char('/') + m_scriptFile;
|
||||
}
|
||||
updateEnabled();
|
||||
updateEnabledState();
|
||||
|
||||
emit scriptSourceChanged();
|
||||
}
|
||||
@@ -258,10 +253,10 @@ void QmlProjectRunConfiguration::changeCurrentFile(IEditor *editor)
|
||||
|
||||
if (editor)
|
||||
m_currentFileFilename = editor->document()->filePath().toString();
|
||||
updateEnabled();
|
||||
updateEnabledState();
|
||||
}
|
||||
|
||||
void QmlProjectRunConfiguration::updateEnabled()
|
||||
void QmlProjectRunConfiguration::updateEnabledState()
|
||||
{
|
||||
bool qmlFileFound = false;
|
||||
if (mainScriptSource() == FileInEditor) {
|
||||
@@ -293,11 +288,10 @@ void QmlProjectRunConfiguration::updateEnabled()
|
||||
qmlFileFound = !mainScript().isEmpty();
|
||||
}
|
||||
|
||||
bool newValue = QFileInfo::exists(executable()) && qmlFileFound;
|
||||
m_isEnabled = newValue;
|
||||
|
||||
// Always emit change signal to force reevaluation of run/debug buttons
|
||||
emit enabledChanged();
|
||||
if (QFileInfo::exists(executable()) && qmlFileFound)
|
||||
RunConfiguration::updateEnabledState();
|
||||
else
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
bool QmlProjectRunConfiguration::isValidVersion(QtSupport::BaseQtVersion *version)
|
||||
|
@@ -70,7 +70,6 @@ public:
|
||||
QString mainScript() const;
|
||||
|
||||
// RunConfiguration
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
virtual QWidget *createConfigurationWidget() override;
|
||||
Utils::OutputFormatter *createOutputFormatter() const override;
|
||||
@@ -84,13 +83,12 @@ protected:
|
||||
QmlProjectRunConfiguration(ProjectExplorer::Target *parent,
|
||||
QmlProjectRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map) override;
|
||||
void setEnabled(bool value);
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
void changeCurrentFile(Core::IEditor* = 0);
|
||||
void updateEnabled();
|
||||
void updateEnabledState() final;
|
||||
|
||||
QString executable() const;
|
||||
QString commandLineArguments() const;
|
||||
@@ -106,8 +104,6 @@ private:
|
||||
|
||||
QString m_scriptFile;
|
||||
QString m_qmlViewerArgs;
|
||||
|
||||
bool m_isEnabled;
|
||||
};
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
@@ -41,7 +41,6 @@ public:
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
bool isEnabled() const override { return true; }
|
||||
bool isConfigured() const override;
|
||||
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
|
@@ -115,11 +115,6 @@ void RemoteLinuxRunConfiguration::init()
|
||||
this, &RemoteLinuxRunConfiguration::handleBuildSystemDataUpdated);
|
||||
}
|
||||
|
||||
bool RemoteLinuxRunConfiguration::isEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QWidget *RemoteLinuxRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return new RemoteLinuxRunConfigurationWidget(this);
|
||||
|
@@ -51,7 +51,6 @@ public:
|
||||
const QString &targetName);
|
||||
~RemoteLinuxRunConfiguration() override;
|
||||
|
||||
bool isEnabled() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
Utils::OutputFormatter *createOutputFormatter() const override;
|
||||
|
||||
|
@@ -38,7 +38,6 @@ public:
|
||||
explicit WinRtRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
|
||||
|
||||
QWidget *createConfigurationWidget() override;
|
||||
bool isEnabled() const override { return true; } // Always enabled like DLL run control
|
||||
QVariantMap toMap() const override;
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
|
||||
|
Reference in New Issue
Block a user