forked from qt-creator/qt-creator
Android: Don't show message boxes in non-GUI thread
Delay them to the GUI thread. Task-number: QTCREATORBUG-27369 Change-Id: I2879de69ec1756ad55d3ae3aba8e233138bf3ed1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -267,11 +267,15 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
||||
{
|
||||
QFileInfo info(m_config.emulatorToolPath().toString());
|
||||
if (!info.exists()) {
|
||||
const QString emulatorToolPath = m_config.emulatorToolPath().toUserOutput();
|
||||
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [emulatorToolPath] {
|
||||
QMessageBox::critical(Core::ICore::dialogParent(),
|
||||
tr("Emulator Tool Is Missing"),
|
||||
tr("Install the missing emulator tool (%1) to the"
|
||||
AndroidAvdManager::tr("Emulator Tool Is Missing"),
|
||||
AndroidAvdManager::tr(
|
||||
"Install the missing emulator tool (%1) to the"
|
||||
" installed Android SDK.")
|
||||
.arg(m_config.emulatorToolPath().toString()));
|
||||
.arg(emulatorToolPath));
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -283,10 +287,13 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
||||
avdProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
QObject::connect(avdProcess, &QtcProcess::done, avdProcess, [avdProcess] {
|
||||
if (avdProcess->exitCode()) {
|
||||
const QString title = QCoreApplication::translate("Android::Internal::AndroidAvdManager",
|
||||
const QString errorOutput = QString::fromLatin1(avdProcess->readAllStandardOutput());
|
||||
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [errorOutput] {
|
||||
const QString title
|
||||
= QCoreApplication::translate("Android::Internal::AndroidAvdManager",
|
||||
"AVD Start Error");
|
||||
QMessageBox::critical(Core::ICore::dialogParent(), title,
|
||||
QString::fromLatin1(avdProcess->readAllStandardOutput()));
|
||||
QMessageBox::critical(Core::ICore::dialogParent(), title, errorOutput);
|
||||
});
|
||||
}
|
||||
avdProcess->deleteLater();
|
||||
});
|
||||
|
Reference in New Issue
Block a user