Commit fadc6ef2 authored by dt's avatar dt
Browse files

TargetSetupPage: On error only expand if selected

Also on selecting, expand if there are errors

Task-Nr: QTCREATORBUG-4327
parent fb824677
......@@ -511,9 +511,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f
this, SLOT(addImportClicked()));
connect(m_detailsWidget, SIGNAL(checked(bool)),
this, SIGNAL(selectedToggled()));
connect(m_detailsWidget, SIGNAL(checked(bool)),
widget, SLOT(setEnabled(bool)));
this, SLOT(targetCheckBoxToggled(bool)));
connect(m_shadowBuildEnabled, SIGNAL(toggled(bool)),
this, SLOT(shadowBuildingToggled()));
connect(m_buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)),
......@@ -539,13 +537,31 @@ void Qt4DefaultTargetSetupWidget::setTargetSelected(bool b)
{
// Only check target if there are build configurations possible
b == b && !buildConfigurationInfos().isEmpty();
m_ignoreChange = true;
m_detailsWidget->setChecked(b);
m_ignoreChange = false;
// We want the shadow build option to be visible
if (b && (m_shadowBuildEnabled->isVisibleTo(m_shadowBuildEnabled->parentWidget())
|| m_buildConfigurationComboBox->isVisibleTo(m_buildConfigurationComboBox->parentWidget())))
m_detailsWidget->setState(Utils::DetailsWidget::Expanded);
}
void Qt4DefaultTargetSetupWidget::targetCheckBoxToggled(bool b)
{
if (m_ignoreChange)
return;
m_detailsWidget->widget()->setEnabled(b);
if (b) {
foreach (bool error, m_issues) {
if (error) {
m_detailsWidget->setState(Utils::DetailsWidget::Expanded);
break;
}
}
}
emit selectedToggled();
}
QString Qt4DefaultTargetSetupWidget::displayNameFrom(const BuildConfigurationInfo &info)
{
QString buildType;
......@@ -742,7 +758,7 @@ void Qt4DefaultTargetSetupWidget::setBuildConfigurationInfos(const QList<BuildCo
foundIssues |= reportIssues(i);
}
m_ignoreChange = false;
if (foundIssues)
if (foundIssues && isTargetSelected())
m_detailsWidget->setState(Utils::DetailsWidget::Expanded);
}
......@@ -828,7 +844,7 @@ void Qt4DefaultTargetSetupWidget::setupWidgets()
bool issue = reportIssues(i);
foundIssues |= issue;
}
if (foundIssues)
if (foundIssues && isTargetSelected())
m_detailsWidget->setState(Utils::DetailsWidget::Expanded);
m_ignoreChange = false;
}
......
......@@ -143,6 +143,7 @@ private slots:
void shadowBuildingToggled();
void buildConfigurationComboBoxChanged();
void qtVersionChanged();
void targetCheckBoxToggled(bool b);
private:
void updateWidgetVisibility();
......
Supports Markdown
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