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

Ask the user before removing Build-/Deploy- and RunConfigurations

Task-number: QTCREATORBUG-2208
parent 979adca1
......@@ -47,6 +47,7 @@
#include <QtGui/QInputDialog>
#include <QtGui/QLabel>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
#include <QtGui/QPushButton>
#include <QtGui/QVBoxLayout>
......@@ -316,6 +317,14 @@ void BuildSettingsWidget::cloneConfiguration()
void BuildSettingsWidget::deleteConfiguration()
{
QMessageBox msgBox(QMessageBox::Question, tr("Remove Build Configuration?"),
tr("Do you really want to delete build configuration %1.").arg(m_buildConfiguration->displayName()),
QMessageBox::Yes|QMessageBox::No, this);
msgBox.setDefaultButton(QMessageBox::No);
msgBox.setEscapeButton(QMessageBox::No);
if (!this || msgBox.exec() == QMessageBox::No)
return;
deleteConfiguration(m_buildConfiguration);
}
......
......@@ -46,6 +46,7 @@
#include <QtCore/QPair>
#include <QtGui/QInputDialog>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
namespace ProjectExplorer {
namespace Internal {
......@@ -254,6 +255,14 @@ void RunSettingsWidget::addRunConfiguration()
void RunSettingsWidget::removeRunConfiguration()
{
RunConfiguration *rc = m_target->activeRunConfiguration();
QMessageBox msgBox(QMessageBox::Question, tr("Remove Run Configuration?"),
tr("Do you really want to delete deploy configuration %1.").arg(rc->displayName()),
QMessageBox::Yes|QMessageBox::No, this);
msgBox.setDefaultButton(QMessageBox::No);
msgBox.setEscapeButton(QMessageBox::No);
if (!this || msgBox.exec() == QMessageBox::No)
return;
m_target->removeRunConfiguration(rc);
m_ui->removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
m_ui->renameRunButton->setEnabled(m_target->activeRunConfiguration());
......@@ -356,6 +365,14 @@ void RunSettingsWidget::addDeployConfiguration()
void RunSettingsWidget::removeDeployConfiguration()
{
DeployConfiguration *dc = m_target->activeDeployConfiguration();
QMessageBox msgBox(QMessageBox::Question, tr("Remove Deploy Configuration?"),
tr("Do you really want to delete deploy configuration %1.").arg(dc->displayName()),
QMessageBox::Yes|QMessageBox::No, this);
msgBox.setDefaultButton(QMessageBox::No);
msgBox.setEscapeButton(QMessageBox::No);
if (!this || msgBox.exec() == QMessageBox::No)
return;
m_target->removeDeployConfiguration(dc);
m_ui->removeDeployToolButton->setEnabled(m_target->deployConfigurations().size() > 1);
}
......
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