forked from qt-creator/qt-creator
ProjectExplorer: Do not forbid removal of the last run configuration
The presence of a run configuration is not technically required: E.g. if you disable auto-creation of run configurations in the settings, you won't have any in the first place. It therefore makes little sense to force users to keep at least one of them once they are there. Change-Id: I2ce0379ebc43f44326db53d324d4db9e9b92ef03 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -144,7 +144,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) :
|
||||
m_runConfigurationCombo->setModel(model);
|
||||
m_runConfigurationCombo->setCurrentIndex(model->indexFor(rc));
|
||||
|
||||
m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
|
||||
updateRemoveToolButton();
|
||||
m_renameRunButton->setEnabled(rc);
|
||||
m_cloneRunButton->setEnabled(rc);
|
||||
|
||||
@@ -188,7 +188,7 @@ void RunSettingsWidget::showAddRunConfigDialog()
|
||||
QTC_CHECK(newRC->id() == rci.factory->runConfigurationId());
|
||||
m_target->addRunConfiguration(newRC);
|
||||
m_target->setActiveRunConfiguration(newRC);
|
||||
m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
|
||||
updateRemoveToolButton();
|
||||
}
|
||||
|
||||
void RunSettingsWidget::cloneRunConfiguration()
|
||||
@@ -226,7 +226,7 @@ void RunSettingsWidget::removeRunConfiguration()
|
||||
return;
|
||||
|
||||
m_target->removeRunConfiguration(rc);
|
||||
m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
|
||||
updateRemoveToolButton();
|
||||
m_renameRunButton->setEnabled(m_target->activeRunConfiguration());
|
||||
m_cloneRunButton->setEnabled(m_target->activeRunConfiguration());
|
||||
}
|
||||
@@ -370,7 +370,7 @@ void RunSettingsWidget::renameDeployConfiguration()
|
||||
void RunSettingsWidget::updateRemoveToolButton()
|
||||
{
|
||||
m_removeDeployToolButton->setEnabled(m_target->deployConfigurations().count() > 1);
|
||||
m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
|
||||
m_removeRunToolButton->setEnabled(!m_target->runConfigurations().isEmpty());
|
||||
}
|
||||
|
||||
void RunSettingsWidget::updateDeployConfiguration(DeployConfiguration *dc)
|
||||
|
Reference in New Issue
Block a user