2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2014-03-24 16:31:28 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2022-07-22 10:32:08 +02:00
|
|
|
|
2020-01-08 14:55:16 +02:00
|
|
|
#include "androidconfigurations.h"
|
2015-05-06 15:58:46 +02:00
|
|
|
|
2014-03-24 16:31:28 +01:00
|
|
|
#include <QDialog>
|
2022-07-22 10:53:42 +02:00
|
|
|
#include <QRegularExpression>
|
2015-05-06 15:58:46 +02:00
|
|
|
#include <QTimer>
|
2014-03-24 16:31:28 +01:00
|
|
|
|
2022-07-21 18:54:08 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QComboBox;
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
class QDialogButtonBox;
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
class QSpinBox;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Utils { class InfoLabel; }
|
|
|
|
|
|
2014-03-24 16:31:28 +01:00
|
|
|
namespace Android {
|
|
|
|
|
class AndroidConfig;
|
2017-04-03 11:11:17 +02:00
|
|
|
class SdkPlatform;
|
2014-03-24 16:31:28 +01:00
|
|
|
|
2014-06-25 15:42:11 +02:00
|
|
|
namespace Internal {
|
2017-08-18 08:22:34 +02:00
|
|
|
class AndroidSdkManager;
|
2014-03-24 16:31:28 +01:00
|
|
|
class AvdDialog : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2021-09-26 16:57:59 +03:00
|
|
|
explicit AvdDialog(const AndroidConfig &config, QWidget *parent = nullptr);
|
|
|
|
|
int exec() override;
|
2014-03-24 16:31:28 +01:00
|
|
|
|
2021-09-26 16:57:59 +03:00
|
|
|
enum DeviceType { Phone, Tablet, Automotive, TV, Wear, PhoneOrTablet };
|
2020-01-08 14:55:16 +02:00
|
|
|
|
2021-09-26 16:57:59 +03:00
|
|
|
ProjectExplorer::IDevice::Ptr device() const;
|
2020-01-08 14:55:16 +02:00
|
|
|
|
|
|
|
|
const SystemImage *systemImage() const;
|
2014-03-24 16:31:28 +01:00
|
|
|
QString name() const;
|
|
|
|
|
QString abi() const;
|
2020-01-08 14:55:16 +02:00
|
|
|
QString deviceDefinition() const;
|
2014-03-24 16:31:28 +01:00
|
|
|
int sdcardSize() const;
|
|
|
|
|
bool isValid() const;
|
2015-05-06 15:58:46 +02:00
|
|
|
|
2014-03-24 16:31:28 +01:00
|
|
|
private:
|
2020-01-08 14:55:16 +02:00
|
|
|
void parseDeviceDefinitionsList();
|
|
|
|
|
void updateDeviceDefinitionComboBox();
|
2016-06-26 22:52:59 +03:00
|
|
|
void updateApiLevelComboBox();
|
2018-07-25 12:19:15 +02:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
2015-05-06 15:58:46 +02:00
|
|
|
|
2021-09-26 16:57:59 +03:00
|
|
|
static AvdDialog::DeviceType tagToDeviceType(const QString &type_tag);
|
|
|
|
|
|
|
|
|
|
struct DeviceDefinitionStruct
|
|
|
|
|
{
|
|
|
|
|
QString name_id;
|
|
|
|
|
QString type_str;
|
|
|
|
|
DeviceType deviceType;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
CreateAvdInfo m_createdAvdInfo;
|
2015-05-06 15:58:46 +02:00
|
|
|
QTimer m_hideTipTimer;
|
2020-03-18 13:32:28 +01:00
|
|
|
QRegularExpression m_allowedNameChars;
|
2020-01-08 14:55:16 +02:00
|
|
|
QList<DeviceDefinitionStruct> m_deviceDefinitionsList;
|
2021-10-25 15:58:02 +03:00
|
|
|
const AndroidConfig &m_androidConfig;
|
|
|
|
|
AndroidSdkManager m_sdkManager;
|
2022-07-21 18:54:08 +02:00
|
|
|
QMap<AvdDialog::DeviceType, QString> m_deviceTypeToStringMap;
|
|
|
|
|
|
|
|
|
|
QComboBox *m_abiComboBox;
|
|
|
|
|
QSpinBox *m_sdcardSizeSpinBox;
|
|
|
|
|
QLineEdit *m_nameLineEdit;
|
|
|
|
|
QComboBox *m_targetApiComboBox;
|
|
|
|
|
QComboBox *m_deviceDefinitionComboBox;
|
|
|
|
|
Utils::InfoLabel *m_warningText;
|
|
|
|
|
QComboBox *m_deviceDefinitionTypeComboBox;
|
|
|
|
|
QCheckBox *m_overwriteCheckBox;
|
|
|
|
|
QDialogButtonBox *m_buttonBox;
|
2014-03-24 16:31:28 +01:00
|
|
|
};
|
2022-07-21 18:54:08 +02:00
|
|
|
|
|
|
|
|
} // Internal
|
|
|
|
|
} // Android
|