Commit e3e7c1e2 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fix and simplify enabling/disabling of target add/remove buttons

Reviewed-by: con
parent 435339f2
......@@ -273,7 +273,7 @@ void TargetSettingsPanelWidget::targetAdded(ProjectExplorer::Target *target)
}
}
m_selector->setAddButtonEnabled(m_project->possibleTargetIds().count() > 0);
m_selector->setAddButtonEnabled(m_project->supportedTargetIds().count() != m_targets.count());
m_selector->setRemoveButtonEnabled(m_project->targets().count() > 1);
}
......@@ -288,8 +288,8 @@ void TargetSettingsPanelWidget::aboutToRemoveTarget(ProjectExplorer::Target *tar
m_targets.removeAt(index);
m_selector->removeTarget(index);
m_selector->setAddButtonEnabled(m_project->possibleTargetIds().count() > 0);
m_selector->setRemoveButtonEnabled(m_project->targets().count() > 2); // target is not yet removed!
m_selector->setAddButtonEnabled(m_project->supportedTargetIds().count() != m_targets.count());
m_selector->setRemoveButtonEnabled(m_targets.count() > 1);
}
void TargetSettingsPanelWidget::activeTargetChanged(ProjectExplorer::Target *target)
......
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