forked from qt-creator/qt-creator
Android: Check for missing emulator tool
Task-number: QTCREATORBUG-20160 Change-Id: I481adfe9a7a1b2c9c151d01d2fe1b010735c898b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "androidtoolmanager.h"
|
#include "androidtoolmanager.h"
|
||||||
|
|
||||||
|
#include "coreplugin/icore.h"
|
||||||
#include "utils/algorithm.h"
|
#include "utils/algorithm.h"
|
||||||
#include "utils/qtcassert.h"
|
#include "utils/qtcassert.h"
|
||||||
#include "utils/runextensions.h"
|
#include "utils/runextensions.h"
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -270,6 +272,15 @@ QString AndroidAvdManager::startAvd(const QString &name) const
|
|||||||
|
|
||||||
bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
||||||
{
|
{
|
||||||
|
QFileInfo info(m_config.emulatorToolPath().toString());
|
||||||
|
if (!info.exists()) {
|
||||||
|
QMessageBox::critical(Core::ICore::dialogParent(),
|
||||||
|
tr("Emulator Tool Is Missing"),
|
||||||
|
tr("Install the missing emulator tool (%1) to the"
|
||||||
|
" installed Android SDK.")
|
||||||
|
.arg(m_config.emulatorToolPath().toString()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
QProcess *avdProcess = new QProcess();
|
QProcess *avdProcess = new QProcess();
|
||||||
QObject::connect(avdProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
QObject::connect(avdProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
||||||
avdProcess, &QObject::deleteLater);
|
avdProcess, &QObject::deleteLater);
|
||||||
|
@@ -36,6 +36,8 @@ class AvdManagerOutputParser;
|
|||||||
|
|
||||||
class AndroidAvdManager
|
class AndroidAvdManager
|
||||||
{
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidAvdManager)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AndroidAvdManager(const AndroidConfig& config = AndroidConfigurations::currentConfig());
|
AndroidAvdManager(const AndroidConfig& config = AndroidConfigurations::currentConfig());
|
||||||
~AndroidAvdManager();
|
~AndroidAvdManager();
|
||||||
|
Reference in New Issue
Block a user