2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2014-03-24 16:31:28 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-03-24 16:31:28 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2014-03-24 16:31:28 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2014-03-24 16:31:28 +01:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2017-08-18 08:22:34 +02:00
|
|
|
#include "androidconfigurations.h"
|
2014-03-24 16:31:28 +01:00
|
|
|
#include "ui_addnewavddialog.h"
|
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>
|
2015-05-06 15:58:46 +02:00
|
|
|
#include <QTimer>
|
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:
|
2020-01-08 14:55:16 +02:00
|
|
|
explicit AvdDialog(int minApiLevel,
|
|
|
|
|
AndroidSdkManager *sdkManager,
|
|
|
|
|
const QStringList &abis,
|
|
|
|
|
const AndroidConfig &config,
|
2018-07-25 12:19:15 +02:00
|
|
|
QWidget *parent = nullptr);
|
2014-03-24 16:31:28 +01:00
|
|
|
|
2020-01-08 14:55:16 +02:00
|
|
|
enum DeviceType { TV, Phone, Wear, Tablet, Automotive, PhoneOrTablet };
|
|
|
|
|
|
|
|
|
|
const QMap<DeviceType, QString> DeviceTypeToStringMap{
|
|
|
|
|
{TV, "TV"},
|
|
|
|
|
{Phone, "Phone"},
|
|
|
|
|
{Wear, "Wear"},
|
|
|
|
|
{Tablet, "Tablet"},
|
|
|
|
|
{Automotive, "Automotive"}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct DeviceDefinitionStruct
|
|
|
|
|
{
|
|
|
|
|
QString name_id;
|
|
|
|
|
QString type_str;
|
|
|
|
|
DeviceType deviceType;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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;
|
2020-01-08 14:55:16 +02:00
|
|
|
static AvdDialog::DeviceType tagToDeviceType(const QString &type_tag);
|
2017-08-18 08:22:34 +02:00
|
|
|
static CreateAvdInfo gatherCreateAVDInfo(QWidget *parent, AndroidSdkManager *sdkManager,
|
2020-01-08 14:55:16 +02:00
|
|
|
const AndroidConfig &config,
|
2019-08-26 14:19:07 +03:00
|
|
|
int minApiLevel = 0, const QStringList &abis = {});
|
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
|
|
|
|
2014-03-24 16:31:28 +01:00
|
|
|
Ui::AddNewAVDDialog m_avdDialog;
|
2017-08-18 08:22:34 +02:00
|
|
|
AndroidSdkManager *m_sdkManager;
|
2014-03-24 16:31:28 +01:00
|
|
|
int m_minApiLevel;
|
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;
|
|
|
|
|
AndroidConfig m_androidConfig;
|
2014-03-24 16:31:28 +01:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|