forked from qt-creator/qt-creator
Android: warn about essential packages not found
Task-number: QTCREATORBUG-23829 Change-Id: Ic3ebd606bfde48b0f7152869a437f2f711ce1d03 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -169,6 +169,13 @@ void AndroidSdkManagerWidget::setSdkManagerControlsEnabled(bool enable)
|
|||||||
void AndroidSdkManagerWidget::installEssentials()
|
void AndroidSdkManagerWidget::installEssentials()
|
||||||
{
|
{
|
||||||
m_sdkModel->selectMissingEssentials();
|
m_sdkModel->selectMissingEssentials();
|
||||||
|
if (!m_sdkModel->missingEssentials().isEmpty()) {
|
||||||
|
QMessageBox::warning(this,
|
||||||
|
tr("Android SDK Changes"),
|
||||||
|
tr("Qt Creator couldn't find the following essential packages: \"%1\".\n"
|
||||||
|
"Install them manually after the current operation is done.\n")
|
||||||
|
.arg(m_sdkModel->missingEssentials().join("\", \"")));
|
||||||
|
}
|
||||||
m_ui->applySelectionButton->click();
|
m_ui->applySelectionButton->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,6 +31,11 @@
|
|||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QLoggingCategory>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
static Q_LOGGING_CATEGORY(androidSdkModelLog, "qtc.android.sdkmodel", QtWarningMsg)
|
||||||
|
}
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -294,7 +299,9 @@ void AndroidSdkModel::selectMissingEssentials()
|
|||||||
|
|
||||||
// Select SDK platform
|
// Select SDK platform
|
||||||
for (const SdkPlatform *platform : m_sdkPlatforms) {
|
for (const SdkPlatform *platform : m_sdkPlatforms) {
|
||||||
if (pendingPkgs.contains(platform->sdkStylePath()) &&
|
if (!platform->installedLocation().isEmpty()) {
|
||||||
|
pendingPkgs.removeOne(platform->sdkStylePath());
|
||||||
|
} else if (pendingPkgs.contains(platform->sdkStylePath()) &&
|
||||||
platform->installedLocation().isEmpty()) {
|
platform->installedLocation().isEmpty()) {
|
||||||
auto i = index(0, 0, index(1, 0));
|
auto i = index(0, 0, index(1, 0));
|
||||||
m_changeState << platform;
|
m_changeState << platform;
|
||||||
@@ -304,6 +311,9 @@ void AndroidSdkModel::selectMissingEssentials()
|
|||||||
if (pendingPkgs.isEmpty())
|
if (pendingPkgs.isEmpty())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_missingEssentials = pendingPkgs;
|
||||||
|
qCDebug(androidSdkModelLog) << "Couldn't find some essential packages:" << m_missingEssentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<const AndroidSdkPackage *> AndroidSdkModel::userSelection() const
|
QList<const AndroidSdkPackage *> AndroidSdkModel::userSelection() const
|
||||||
|
@@ -70,6 +70,8 @@ public:
|
|||||||
QList<const AndroidSdkPackage *> userSelection() const;
|
QList<const AndroidSdkPackage *> userSelection() const;
|
||||||
void resetSelection();
|
void resetSelection();
|
||||||
|
|
||||||
|
QStringList missingEssentials() const { return m_missingEssentials; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void clearContainers();
|
void clearContainers();
|
||||||
void refreshData();
|
void refreshData();
|
||||||
@@ -80,6 +82,7 @@ private:
|
|||||||
QList<const SdkPlatform *> m_sdkPlatforms;
|
QList<const SdkPlatform *> m_sdkPlatforms;
|
||||||
QList<const AndroidSdkPackage *> m_tools;
|
QList<const AndroidSdkPackage *> m_tools;
|
||||||
QSet<const AndroidSdkPackage *> m_changeState;
|
QSet<const AndroidSdkPackage *> m_changeState;
|
||||||
|
QStringList m_missingEssentials;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user