forked from qt-creator/qt-creator
Fix various crashes
Task-Number: QTCREATORBUG-6365 Change-Id: I19a200e3c811eef83d591f6eacca3e48eb0fba8f Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
|
||||
#include <QtCore/QMargins>
|
||||
#include <QtCore/QTimer>
|
||||
@@ -370,6 +372,29 @@ void BuildSettingsWidget::deleteConfiguration(BuildConfiguration *deleteConfigur
|
||||
m_target->buildConfigurations().size() <= 1)
|
||||
return;
|
||||
|
||||
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
|
||||
if (bm->isBuilding(deleteConfiguration)) {
|
||||
QMessageBox box;
|
||||
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Build Configuration"), QMessageBox::AcceptRole);
|
||||
QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole);
|
||||
box.setDefaultButton(cancelClose);
|
||||
box.setWindowTitle(tr("Remove Build Configuration %1?").arg(deleteConfiguration->displayName()));
|
||||
box.setText(tr("The build configuration <b>%1</b> is currently being built.").arg(deleteConfiguration->displayName()));
|
||||
box.setInformativeText(tr("Do you want to cancel the build process and remove the Build Configuration anyway?"));
|
||||
box.exec();
|
||||
if (box.clickedButton() != closeAnyway)
|
||||
return;
|
||||
bm->cancel();
|
||||
} else {
|
||||
QMessageBox msgBox(QMessageBox::Question, tr("Remove Build Configuration?"),
|
||||
tr("Do you really want to delete build configuration <b>%1</b>?").arg(deleteConfiguration->displayName()),
|
||||
QMessageBox::Yes|QMessageBox::No, this);
|
||||
msgBox.setDefaultButton(QMessageBox::No);
|
||||
msgBox.setEscapeButton(QMessageBox::No);
|
||||
if (msgBox.exec() == QMessageBox::No)
|
||||
return;
|
||||
}
|
||||
|
||||
m_target->removeBuildConfiguration(deleteConfiguration);
|
||||
|
||||
updateBuildSettings();
|
||||
|
||||
Reference in New Issue
Block a user