Commit 8fd395fe authored by con's avatar con
Browse files

Update the enabled state of run configurations on toolchain change.

And if Qt version changed.
parent 936ba4c0
......@@ -148,6 +148,7 @@ signals:
void fileListChanged();
void activeBuildConfigurationChanged();
void activeRunConfigurationChanged();
void runConfigurationsEnabledStateChanged();
void removedRunConfiguration(const QString &name);
void addedRunConfiguration(const QString &name);
// This signal is jut there for updating the tree list in the buildsettings wizard
......
......@@ -1887,15 +1887,17 @@ void ProjectExplorerPlugin::populateRunConfigurationMenu()
foreach (const Project *pro, m_session->projects()) {
foreach (QSharedPointer<RunConfiguration> runConfiguration, pro->runConfigurations()) {
const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name());
QAction *act = new QAction(title, m_runConfigurationActionGroup);
act->setCheckable(true);
act->setData(qVariantFromValue(runConfiguration));
act->setChecked(runConfiguration == activeRunConfiguration);
m_runConfigurationMenu->addAction(act);
if (debug)
qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name()
<< "active:" << (runConfiguration == activeRunConfiguration);
if (runConfiguration->isEnabled()) {
const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name());
QAction *act = new QAction(title, m_runConfigurationActionGroup);
act->setCheckable(true);
act->setData(qVariantFromValue(runConfiguration));
act->setChecked(runConfiguration == activeRunConfiguration);
m_runConfigurationMenu->addAction(act);
if (debug)
qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name()
<< "active:" << (runConfiguration == activeRunConfiguration);
}
}
}
......
......@@ -196,6 +196,8 @@ RunSettingsWidget::RunSettingsWidget(Project *project)
connect(m_project, SIGNAL(activeRunConfigurationChanged()),
this, SLOT(activeRunConfigurationChanged()));
connect(m_project, SIGNAL(runConfigurationsEnabledStateChanged()),
this, SLOT(initRunConfigurationComboBox()));
initRunConfigurationComboBox();
const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations();
......
......@@ -7,16 +7,13 @@
* QtVersion:
* gui for overriding the default make target if necessary,
make arguments --> make options
* more general "debug / release" configuration to be used in toolchain???
* build parser should be defined/created by toolchain, not make step
* Debugging helpers
* must probably be compiled for different toolchains
* Run Configurations
* enabled property doesn't update correctly
* missing signals qtVersionChanged + toolChainChanged
* handling of active run config getting disabled
* handling of active run config getting disabled not optimal yet
* Run on device
* makesis, signsis and applicationinstaller don't report errors back
......
......@@ -834,6 +834,7 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const
void Qt4Project::setQtVersion(const QString &buildConfiguration, int id)
{
setValue(buildConfiguration, "QtVersionId", id);
updateActiveRunConfiguration();
}
void Qt4Project::setToolChainType(const QString &buildConfiguration, ProjectExplorer::ToolChain::ToolChainType type)
......@@ -841,16 +842,32 @@ void Qt4Project::setToolChainType(const QString &buildConfiguration, ProjectExpl
setValue(buildConfiguration, "ToolChain", (int)type);
delete m_toolChain;
m_toolChain = 0;
updateActiveRunConfiguration();
}
void Qt4Project::updateActiveRunConfiguration()
{
if (!activeRunConfiguration()->isEnabled()) {
foreach (QSharedPointer<RunConfiguration> runConfiguration, runConfigurations()) {
if (runConfiguration->isEnabled()) {
setActiveRunConfiguration(runConfiguration);
}
}
}
emit runConfigurationsEnabledStateChanged();
emit invalidateCachedTargetInformation();
}
ProjectExplorer::ToolChain::ToolChainType Qt4Project::toolChainType(const QString &buildConfiguration) const
{
ProjectExplorer::ToolChain::ToolChainType type =
const ProjectExplorer::ToolChain::ToolChainType originalType =
(ProjectExplorer::ToolChain::ToolChainType)value(buildConfiguration, "ToolChain").toInt();
ProjectExplorer::ToolChain::ToolChainType type = originalType;
const QtVersion *version = qtVersion(buildConfiguration);
if (!version->possibleToolChainTypes().contains(type)) // use default tool chain
type = version->defaultToolchainType();
const_cast<Qt4Project *>(this)->setToolChainType(buildConfiguration, type);
if (type != originalType)
const_cast<Qt4Project *>(this)->setToolChainType(buildConfiguration, type);
return type;
}
......
......@@ -233,6 +233,7 @@ private:
void addDefaultBuild();
static QString qmakeVarName(ProjectExplorer::FileType type);
void updateActiveRunConfiguration();
Qt4Manager *m_manager;
Internal::Qt4ProFileNode *m_rootProjectNode;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment