forked from qt-creator/qt-creator
DeployConfiguration: Make it possible to enable/disable DCs
Allow DCs to be enabled/disabled. Add infrastructure to target to propagate enabled signals of BCs, RCs and DCs. Change-Id: I8ae27a943953228b18e61396a22a2d7a2e4e9694 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -94,6 +94,16 @@ DeployConfigurationWidget *DeployConfiguration::configurationWidget() const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DeployConfiguration::isEnabled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DeployConfiguration::disabledReason() const
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
bool DeployConfiguration::fromMap(const QVariantMap &map)
|
bool DeployConfiguration::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
if (!ProjectConfiguration::fromMap(map))
|
if (!ProjectConfiguration::fromMap(map))
|
||||||
|
|||||||
@@ -63,8 +63,14 @@ public:
|
|||||||
|
|
||||||
virtual DeployConfigurationWidget *configurationWidget() const;
|
virtual DeployConfigurationWidget *configurationWidget() const;
|
||||||
|
|
||||||
|
virtual bool isEnabled() const;
|
||||||
|
virtual QString disabledReason() const;
|
||||||
|
|
||||||
Target *target() const;
|
Target *target() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void enabledChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DeployConfiguration(Target *target, const QString &id);
|
DeployConfiguration(Target *target, const QString &id);
|
||||||
DeployConfiguration(Target *target, DeployConfiguration *source);
|
DeployConfiguration(Target *target, DeployConfiguration *source);
|
||||||
|
|||||||
@@ -129,6 +129,20 @@ void Target::changeBuildConfigurationEnabled()
|
|||||||
emit buildConfigurationEnabledChanged();
|
emit buildConfigurationEnabledChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Target::changeDeployConfigurationEnabled()
|
||||||
|
{
|
||||||
|
DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(sender());
|
||||||
|
if (dc == activeDeployConfiguration())
|
||||||
|
emit deployConfigurationEnabledChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Target::changeRunConfigurationEnabled()
|
||||||
|
{
|
||||||
|
RunConfiguration *rc = qobject_cast<RunConfiguration *>(sender());
|
||||||
|
if (rc == activeRunConfiguration())
|
||||||
|
emit runConfigurationEnabledChanged();
|
||||||
|
}
|
||||||
|
|
||||||
Project *Target::project() const
|
Project *Target::project() const
|
||||||
{
|
{
|
||||||
return static_cast<Project *>(parent());
|
return static_cast<Project *>(parent());
|
||||||
@@ -243,6 +257,8 @@ void Target::addDeployConfiguration(DeployConfiguration *dc)
|
|||||||
// add it
|
// add it
|
||||||
d->m_deployConfigurations.push_back(dc);
|
d->m_deployConfigurations.push_back(dc);
|
||||||
|
|
||||||
|
connect(dc, SIGNAL(enabledChanged()), this, SLOT(changeDeployConfigurationEnabled()));
|
||||||
|
|
||||||
emit addedDeployConfiguration(dc);
|
emit addedDeployConfiguration(dc);
|
||||||
|
|
||||||
if (!d->m_activeDeployConfiguration)
|
if (!d->m_activeDeployConfiguration)
|
||||||
@@ -293,6 +309,7 @@ void Target::setActiveDeployConfiguration(DeployConfiguration *dc)
|
|||||||
dc != d->m_activeDeployConfiguration)) {
|
dc != d->m_activeDeployConfiguration)) {
|
||||||
d->m_activeDeployConfiguration = dc;
|
d->m_activeDeployConfiguration = dc;
|
||||||
emit activeDeployConfigurationChanged(d->m_activeDeployConfiguration);
|
emit activeDeployConfigurationChanged(d->m_activeDeployConfiguration);
|
||||||
|
emit deployConfigurationEnabledChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,6 +358,9 @@ void Target::addRunConfiguration(RunConfiguration* runConfiguration)
|
|||||||
runConfiguration->setDisplayName(configurationDisplayName);
|
runConfiguration->setDisplayName(configurationDisplayName);
|
||||||
|
|
||||||
d->m_runConfigurations.push_back(runConfiguration);
|
d->m_runConfigurations.push_back(runConfiguration);
|
||||||
|
|
||||||
|
connect(runConfiguration, SIGNAL(enabledChanged()), this, SLOT(changeRunConfigurationEnabled()));
|
||||||
|
|
||||||
emit addedRunConfiguration(runConfiguration);
|
emit addedRunConfiguration(runConfiguration);
|
||||||
|
|
||||||
if (!activeRunConfiguration())
|
if (!activeRunConfiguration())
|
||||||
@@ -376,6 +396,7 @@ void Target::setActiveRunConfiguration(RunConfiguration* configuration)
|
|||||||
configuration != d->m_activeRunConfiguration)) {
|
configuration != d->m_activeRunConfiguration)) {
|
||||||
d->m_activeRunConfiguration = configuration;
|
d->m_activeRunConfiguration = configuration;
|
||||||
emit activeRunConfigurationChanged(d->m_activeRunConfiguration);
|
emit activeRunConfigurationChanged(d->m_activeRunConfiguration);
|
||||||
|
emit runConfigurationEnabledChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ public:
|
|||||||
virtual QList<ToolChain *> possibleToolChains(BuildConfiguration *) const;
|
virtual QList<ToolChain *> possibleToolChains(BuildConfiguration *) const;
|
||||||
virtual ToolChain *preferredToolChain(BuildConfiguration *) const;
|
virtual ToolChain *preferredToolChain(BuildConfiguration *) const;
|
||||||
|
|
||||||
|
|
||||||
virtual QVariantMap toMap() const;
|
virtual QVariantMap toMap() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -123,8 +122,6 @@ signals:
|
|||||||
|
|
||||||
// TODO clean up signal names
|
// TODO clean up signal names
|
||||||
// might be better to also have aboutToRemove signals
|
// might be better to also have aboutToRemove signals
|
||||||
void runConfigurationsEnabledStateChanged();
|
|
||||||
|
|
||||||
void removedRunConfiguration(ProjectExplorer::RunConfiguration *);
|
void removedRunConfiguration(ProjectExplorer::RunConfiguration *);
|
||||||
void addedRunConfiguration(ProjectExplorer::RunConfiguration *);
|
void addedRunConfiguration(ProjectExplorer::RunConfiguration *);
|
||||||
void activeRunConfigurationChanged(ProjectExplorer::RunConfiguration *);
|
void activeRunConfigurationChanged(ProjectExplorer::RunConfiguration *);
|
||||||
@@ -141,9 +138,11 @@ signals:
|
|||||||
/// environmentChanged() or if the active build configuration changes
|
/// environmentChanged() or if the active build configuration changes
|
||||||
void environmentChanged();
|
void environmentChanged();
|
||||||
|
|
||||||
/// convenience signal, emitted if either the active buildconfiguration emits
|
/// convenience signal, emitted if either the active configuration emits
|
||||||
/// enabledChanged() or if the active build configuration changes
|
/// enabledChanged() or if the active build configuration changes
|
||||||
void buildConfigurationEnabledChanged();
|
void buildConfigurationEnabledChanged();
|
||||||
|
void deployConfigurationEnabledChanged();
|
||||||
|
void runConfigurationEnabledChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Target(Project *parent, const QString &id);
|
Target(Project *parent, const QString &id);
|
||||||
@@ -155,6 +154,8 @@ protected:
|
|||||||
private slots:
|
private slots:
|
||||||
void changeEnvironment();
|
void changeEnvironment();
|
||||||
void changeBuildConfigurationEnabled();
|
void changeBuildConfigurationEnabled();
|
||||||
|
void changeDeployConfigurationEnabled();
|
||||||
|
void changeRunConfigurationEnabled();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TargetPrivate *d;
|
TargetPrivate *d;
|
||||||
|
|||||||
Reference in New Issue
Block a user