m_buildTarget(target),
m_workingDirectory(workingDirectory),
m_title(title),
- m_baseEnvironmentBase(CMakeRunConfiguration::BuildEnvironmentBase)
+ m_baseEnvironmentBase(CMakeRunConfiguration::BuildEnvironmentBase),
+ m_enabled(true)
{
ctor();
}
m_title(source->m_title),
m_arguments(source->m_arguments),
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
- m_baseEnvironmentBase(source->m_baseEnvironmentBase)
+ m_baseEnvironmentBase(source->m_baseEnvironmentBase),
+ m_enabled(source->m_enabled)
{
ctor();
}
return bc->toolChainType();
}
-// Configuration widget
+void CMakeRunConfiguration::setEnabled(bool b)
+{
+ if (m_enabled == b)
+ return;
+ m_enabled = b;
+ emit isEnabledChanged(isEnabled());
+ setDisplayName(m_title + (m_enabled ? "" : tr(" (disabled)")));
+}
+bool CMakeRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *bc) const
+{
+ return m_enabled && LocalApplicationRunConfiguration::isEnabled(bc);
+}
+// Configuration widget
CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *cmakeRunConfiguration, QWidget *parent)
: QWidget(parent), m_ignoreChange(false), m_cmakeRunConfiguration(cmakeRunConfiguration)
{
QVariantMap toMap() const;
+ void setEnabled(bool b);
+
+ bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
+ using LocalApplicationRunConfiguration::isEnabled;
+
signals:
void baseEnvironmentChanged();
void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff);
QString m_arguments;
QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges;
BaseEnvironmentBase m_baseEnvironmentBase;
+ bool m_enabled;
};
class CMakeRunConfigurationWidget : public QWidget
foreach (CMakeRunConfiguration *rc, list) {
rc->setExecutable(ct.executable);
rc->setWorkingDirectory(ct.workingDirectory);
+ rc->setEnabled(true);
}
existingRunConfigurations.remove(ct.title);
} else {
existingRunConfigurations.constBegin();
for( ; it != existingRunConfigurations.constEnd(); ++it) {
CMakeRunConfiguration *rc = it.value();
- removeRunConfiguration(rc);
+ // The executables for those runconfigurations aren't build by the current buildconfiguration
+ // We just set a disable flag and show that in the display name
+ rc->setEnabled(false);
+ // removeRunConfiguration(rc);
}
if (runConfigurations().isEmpty()) {
// Oh no, no run configuration,