2013-09-10 19:19:31 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-09-10 19:19:31 +02: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.
|
2013-09-10 19:19:31 +02: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.
|
2013-09-10 19:19:31 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-09-10 19:19:31 +02:00
|
|
|
|
|
|
|
|
#include "androidconfigurations.h"
|
2017-03-30 14:43:13 +02:00
|
|
|
#include "androidtoolmanager.h"
|
2013-09-10 19:19:31 +02:00
|
|
|
|
|
|
|
|
#include <QVector>
|
|
|
|
|
#include <QDialog>
|
2014-04-11 13:31:01 +02:00
|
|
|
#include <QFutureWatcher>
|
2015-04-29 15:21:37 +02:00
|
|
|
#include <QTime>
|
2013-09-10 19:19:31 +02:00
|
|
|
|
2017-03-30 14:43:13 +02:00
|
|
|
#include <memory>
|
|
|
|
|
|
2013-09-10 19:19:31 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QModelIndex;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2015-04-10 18:08:51 +02:00
|
|
|
namespace Utils { class ProgressIndicator; }
|
|
|
|
|
|
2013-09-10 19:19:31 +02:00
|
|
|
namespace Android {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class AndroidDeviceModel;
|
2013-09-13 13:47:39 +02:00
|
|
|
namespace Ui { class AndroidDeviceDialog; }
|
2013-09-10 19:19:31 +02:00
|
|
|
|
|
|
|
|
class AndroidDeviceDialog : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2015-04-29 15:21:37 +02:00
|
|
|
explicit AndroidDeviceDialog(int apiLevel, const QString &abi, AndroidConfigurations::Options opts,
|
|
|
|
|
const QString &serialNumber, QWidget *parent = 0);
|
2013-09-10 19:19:31 +02:00
|
|
|
~AndroidDeviceDialog();
|
|
|
|
|
|
|
|
|
|
AndroidDeviceInfo device();
|
|
|
|
|
|
2015-12-04 10:03:45 +02:00
|
|
|
bool saveDeviceSelection() const;
|
2013-09-10 19:19:31 +02:00
|
|
|
|
2016-06-26 22:52:59 +03:00
|
|
|
private:
|
2013-09-10 19:19:31 +02:00
|
|
|
void refreshDeviceList();
|
|
|
|
|
void createAvd();
|
|
|
|
|
void clickedOnView(const QModelIndex &idx);
|
2014-03-06 17:35:11 +01:00
|
|
|
void showHelp();
|
2014-04-11 13:31:01 +02:00
|
|
|
void avdAdded();
|
2015-04-10 18:08:51 +02:00
|
|
|
void devicesRefreshed();
|
|
|
|
|
void enableOkayButton();
|
2015-04-29 15:21:37 +02:00
|
|
|
void defaultDeviceClear();
|
2015-04-10 18:08:51 +02:00
|
|
|
|
2013-09-10 19:19:31 +02:00
|
|
|
AndroidDeviceModel *m_model;
|
|
|
|
|
Ui::AndroidDeviceDialog *m_ui;
|
2015-04-10 18:08:51 +02:00
|
|
|
Utils::ProgressIndicator *m_progressIndicator;
|
2013-09-10 19:19:31 +02:00
|
|
|
int m_apiLevel;
|
|
|
|
|
QString m_abi;
|
2015-04-23 16:25:44 +02:00
|
|
|
QString m_avdNameFromAdd;
|
2015-04-29 15:21:37 +02:00
|
|
|
QString m_defaultDevice;
|
2017-03-30 14:43:13 +02:00
|
|
|
std::unique_ptr<AndroidToolManager> m_androidToolManager;
|
2015-12-04 10:03:45 +02:00
|
|
|
QVector<AndroidDeviceInfo> m_connectedDevices;
|
2015-04-10 18:08:51 +02:00
|
|
|
QFutureWatcher<AndroidConfig::CreateAvdInfo> m_futureWatcherAddDevice;
|
|
|
|
|
QFutureWatcher<QVector<AndroidDeviceInfo>> m_futureWatcherRefreshDevices;
|
2013-09-10 19:19:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|