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());
|
QFileInfo info(m_config.emulatorToolPath().toString());
|
||||||
if (!info.exists()) {
|
if (!info.exists()) {
|
||||||
QMessageBox::critical(Core::ICore::dialogParent(),
|
const QString emulatorToolPath = m_config.emulatorToolPath().toUserOutput();
|
||||||
tr("Emulator Tool Is Missing"),
|
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [emulatorToolPath] {
|
||||||
tr("Install the missing emulator tool (%1) to the"
|
QMessageBox::critical(Core::ICore::dialogParent(),
|
||||||
" installed Android SDK.")
|
AndroidAvdManager::tr("Emulator Tool Is Missing"),
|
||||||
.arg(m_config.emulatorToolPath().toString()));
|
AndroidAvdManager::tr(
|
||||||
|
"Install the missing emulator tool (%1) to the"
|
||||||
|
" installed Android SDK.")
|
||||||
|
.arg(emulatorToolPath));
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,10 +287,13 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
|||||||
avdProcess->setProcessChannelMode(QProcess::MergedChannels);
|
avdProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||||
QObject::connect(avdProcess, &QtcProcess::done, avdProcess, [avdProcess] {
|
QObject::connect(avdProcess, &QtcProcess::done, avdProcess, [avdProcess] {
|
||||||
if (avdProcess->exitCode()) {
|
if (avdProcess->exitCode()) {
|
||||||
const QString title = QCoreApplication::translate("Android::Internal::AndroidAvdManager",
|
const QString errorOutput = QString::fromLatin1(avdProcess->readAllStandardOutput());
|
||||||
"AVD Start Error");
|
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [errorOutput] {
|
||||||
QMessageBox::critical(Core::ICore::dialogParent(), title,
|
const QString title
|
||||||
QString::fromLatin1(avdProcess->readAllStandardOutput()));
|
= QCoreApplication::translate("Android::Internal::AndroidAvdManager",
|
||||||
|
"AVD Start Error");
|
||||||
|
QMessageBox::critical(Core::ICore::dialogParent(), title, errorOutput);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
avdProcess->deleteLater();
|
avdProcess->deleteLater();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user