forked from qt-creator/qt-creator
Ask the user before removing Build-/Deploy- and RunConfigurations
Task-number: QTCREATORBUG-2208
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user