forked from qt-creator/qt-creator
Android: Add more informative fields to AVD manager UI
Task-number: QTCREATORBUG-23284 Change-Id: Ic93de1c05731360b85925acd23bdca12edc56069 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -58,6 +58,10 @@ const char avdInfoPathKey[] = "Path:";
|
|||||||
const char avdInfoAbiKey[] = "abi.type";
|
const char avdInfoAbiKey[] = "abi.type";
|
||||||
const char avdInfoTargetKey[] = "target";
|
const char avdInfoTargetKey[] = "target";
|
||||||
const char avdInfoErrorKey[] = "Error:";
|
const char avdInfoErrorKey[] = "Error:";
|
||||||
|
const char avdInfoSdcardKey[] = "Sdcard";
|
||||||
|
const char avdInfoTargetTypeKey[] = "Target";
|
||||||
|
const char avdInfoDeviceKey[] = "Device";
|
||||||
|
const char avdInfoSkinKey[] = "Skin";
|
||||||
const char googleApiTag[] = "google_apis";
|
const char googleApiTag[] = "google_apis";
|
||||||
|
|
||||||
const int avdCreateTimeoutMs = 30000;
|
const int avdCreateTimeoutMs = 30000;
|
||||||
@@ -453,6 +457,14 @@ bool AvdManagerOutputParser::parseAvd(const QStringList &deviceInfo, AndroidDevi
|
|||||||
else
|
else
|
||||||
qCDebug(avdManagerLog) << "Avd Parsing: Cannot find sdk API:" << avdInfoFile.toString();
|
qCDebug(avdManagerLog) << "Avd Parsing: Cannot find sdk API:" << avdInfoFile.toString();
|
||||||
}
|
}
|
||||||
|
} else if (valueForKey(avdInfoDeviceKey, line, &value)) {
|
||||||
|
avd->avdDevice = value.remove(0, 2);
|
||||||
|
} else if (valueForKey(avdInfoTargetTypeKey, line, &value)) {
|
||||||
|
avd->avdTarget = value.remove(0, 2);
|
||||||
|
} else if (valueForKey(avdInfoSkinKey, line, &value)) {
|
||||||
|
avd->avdSkin = value.remove(0, 2);
|
||||||
|
} else if (valueForKey(avdInfoSdcardKey, line, &value)) {
|
||||||
|
avd->avdSdcardSize = value.remove(0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -63,6 +63,11 @@ public:
|
|||||||
QString serialNumber;
|
QString serialNumber;
|
||||||
QString avdname;
|
QString avdname;
|
||||||
QStringList cpuAbi;
|
QStringList cpuAbi;
|
||||||
|
QString avdTarget;
|
||||||
|
QString avdDevice;
|
||||||
|
QString avdSkin;
|
||||||
|
QString avdSdcardSize;
|
||||||
|
|
||||||
int sdk = -1;
|
int sdk = -1;
|
||||||
enum State { OkState, UnAuthorizedState, OfflineState };
|
enum State { OkState, UnAuthorizedState, OfflineState };
|
||||||
State state = OfflineState;
|
State state = OfflineState;
|
||||||
|
@@ -177,15 +177,23 @@ QVariant AvdModel::data(const QModelIndex &index, int role) const
|
|||||||
{
|
{
|
||||||
if (role != Qt::DisplayRole || !index.isValid())
|
if (role != Qt::DisplayRole || !index.isValid())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
|
const AndroidDeviceInfo currentRow = m_list.at(index.row());
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0:
|
case 0:
|
||||||
return m_list[index.row()].avdname;
|
return currentRow.avdname;
|
||||||
case 1:
|
case 1:
|
||||||
return QString::fromLatin1("API %1").arg(m_list[index.row()].sdk);
|
return currentRow.sdk;
|
||||||
case 2: {
|
case 2: {
|
||||||
QStringList cpuAbis = m_list[index.row()].cpuAbi;
|
QStringList cpuAbis = currentRow.cpuAbi;
|
||||||
return cpuAbis.isEmpty() ? QVariant() : QVariant(cpuAbis.first());
|
return cpuAbis.isEmpty() ? QVariant() : QVariant(cpuAbis.first());
|
||||||
}
|
}
|
||||||
|
case 3:
|
||||||
|
return currentRow.avdDevice;
|
||||||
|
case 4:
|
||||||
|
return currentRow.avdTarget;
|
||||||
|
case 5:
|
||||||
|
return currentRow.avdSdcardSize;
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@@ -198,9 +206,15 @@ QVariant AvdModel::headerData(int section, Qt::Orientation orientation, int role
|
|||||||
//: AVD - Android Virtual Device
|
//: AVD - Android Virtual Device
|
||||||
return tr("AVD Name");
|
return tr("AVD Name");
|
||||||
case 1:
|
case 1:
|
||||||
return tr("AVD Target");
|
return tr("API");
|
||||||
case 2:
|
case 2:
|
||||||
return tr("CPU/ABI");
|
return tr("CPU/ABI");
|
||||||
|
case 3:
|
||||||
|
return tr("Device type");
|
||||||
|
case 4:
|
||||||
|
return tr("Target");
|
||||||
|
case 5:
|
||||||
|
return tr("SD-card size");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QAbstractItemModel::headerData(section, orientation, role );
|
return QAbstractItemModel::headerData(section, orientation, role );
|
||||||
@@ -213,7 +227,7 @@ int AvdModel::rowCount(const QModelIndex &/*parent*/) const
|
|||||||
|
|
||||||
int AvdModel::columnCount(const QModelIndex &/*parent*/) const
|
int AvdModel::columnCount(const QModelIndex &/*parent*/) const
|
||||||
{
|
{
|
||||||
return 3;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidSettingsWidget::AndroidSettingsWidget()
|
AndroidSettingsWidget::AndroidSettingsWidget()
|
||||||
|
Reference in New Issue
Block a user