QmlDesigner: Use Utils::AsynchronousMessageBox::warning

Warning which needs return value should be asynchronous because the event
loop of the blocking dialog leads to crashes.

Change-Id: I2e348f9351611dfd053cd3fbacfb6696401ee427
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2014-11-20 12:50:00 +01:00
committed by Tim Jenssen
parent 63487158f1
commit cd5a6c4bdf
13 changed files with 50 additions and 144 deletions

View File

@@ -44,6 +44,7 @@
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/icore.h>
#include <utils/messagebox.h>
#include <QMessageBox>
@@ -337,9 +338,8 @@ void DocumentManager::addFileToVersionControl(const QString &directoryPath, cons
Core::VcsManager::msgPromptToAddToVcs(QStringList(newFilePath), versionControl),
QMessageBox::Yes | QMessageBox::No);
if (button == QMessageBox::Yes && !versionControl->vcsAdd(newFilePath)) {
QMessageBox::warning(Core::ICore::mainWindow(),
Core::VcsManager::msgAddToVcsFailedTitle(),
Core::VcsManager::msgToAddToVcsFailed(QStringList(newFilePath), versionControl));
Utils::AsynchronousMessageBox::warning(Core::VcsManager::msgAddToVcsFailedTitle(),
Core::VcsManager::msgToAddToVcsFailed(QStringList(newFilePath), versionControl));
}
}
}