2013-09-26 18:38:44 +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-26 18:38:44 +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-26 18:38:44 +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-26 18:38:44 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-09-26 18:38:44 +02:00
|
|
|
|
2018-07-02 18:40:29 +02:00
|
|
|
#include "android_global.h"
|
|
|
|
|
|
2014-09-22 16:20:51 +03:00
|
|
|
#include <utils/fileutils.h>
|
2013-09-26 18:38:44 +02:00
|
|
|
#include <utils/pathchooser.h>
|
|
|
|
|
#include <utils/wizard.h>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QComboBox;
|
2014-03-12 15:20:39 +01:00
|
|
|
class QLabel;
|
2015-01-16 13:22:47 +01:00
|
|
|
class QFormLayout;
|
2013-09-26 18:38:44 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2020-01-08 22:47:06 +01:00
|
|
|
namespace Utils {
|
|
|
|
|
class InfoLabel;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-26 18:38:44 +02:00
|
|
|
namespace ProjectExplorer { class Target; }
|
|
|
|
|
|
2018-07-02 18:40:29 +02:00
|
|
|
namespace Android {
|
2013-09-26 18:38:44 +02:00
|
|
|
|
|
|
|
|
class CreateAndroidManifestWizard;
|
|
|
|
|
|
|
|
|
|
class NoApplicationProFilePage : public QWizardPage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
NoApplicationProFilePage(CreateAndroidManifestWizard *wizard);
|
|
|
|
|
private:
|
|
|
|
|
CreateAndroidManifestWizard *m_wizard;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ChooseProFilePage : public QWizardPage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2018-07-02 18:12:25 +02:00
|
|
|
explicit ChooseProFilePage(CreateAndroidManifestWizard *wizard);
|
|
|
|
|
|
2016-06-26 22:52:59 +03:00
|
|
|
private:
|
2013-09-26 18:38:44 +02:00
|
|
|
void nodeSelected(int index);
|
|
|
|
|
private:
|
|
|
|
|
CreateAndroidManifestWizard *m_wizard;
|
|
|
|
|
QComboBox *m_comboBox;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ChooseDirectoryPage : public QWizardPage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
ChooseDirectoryPage(CreateAndroidManifestWizard *wizard);
|
2015-01-16 13:22:47 +01:00
|
|
|
void initializePage();
|
2014-03-12 15:20:39 +01:00
|
|
|
protected:
|
|
|
|
|
bool isComplete() const;
|
2016-06-26 22:52:59 +03:00
|
|
|
private:
|
2014-03-12 15:20:39 +01:00
|
|
|
void checkPackageSourceDir();
|
2013-09-26 18:38:44 +02:00
|
|
|
private:
|
|
|
|
|
CreateAndroidManifestWizard *m_wizard;
|
|
|
|
|
Utils::PathChooser *m_androidPackageSourceDir;
|
2020-01-08 22:47:06 +01:00
|
|
|
Utils::InfoLabel *m_sourceDirectoryWarning;
|
2015-01-16 13:22:47 +01:00
|
|
|
QLabel *m_label;
|
|
|
|
|
QFormLayout *m_layout;
|
2014-03-12 15:20:39 +01:00
|
|
|
bool m_complete;
|
2013-09-26 18:38:44 +02:00
|
|
|
};
|
|
|
|
|
|
2018-07-02 18:40:29 +02:00
|
|
|
class ANDROID_EXPORT CreateAndroidManifestWizard : public Utils::Wizard
|
2013-09-26 18:38:44 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
CreateAndroidManifestWizard(ProjectExplorer::Target *target);
|
|
|
|
|
|
2018-07-02 18:12:25 +02:00
|
|
|
QString buildKey() const;
|
|
|
|
|
void setBuildKey(const QString &buildKey);
|
2013-09-26 18:38:44 +02:00
|
|
|
|
|
|
|
|
void accept();
|
2014-09-22 16:20:51 +03:00
|
|
|
bool copyGradle();
|
2013-09-26 18:38:44 +02:00
|
|
|
|
|
|
|
|
void setDirectory(const QString &directory);
|
2014-09-22 16:20:51 +03:00
|
|
|
void setCopyGradle(bool copy);
|
|
|
|
|
|
2018-07-02 18:12:25 +02:00
|
|
|
ProjectExplorer::Target *target() const;
|
|
|
|
|
|
2013-09-26 18:38:44 +02:00
|
|
|
private:
|
2014-09-22 16:20:51 +03:00
|
|
|
enum CopyState {
|
|
|
|
|
Ask,
|
|
|
|
|
OverwriteAll,
|
|
|
|
|
SkipAll
|
|
|
|
|
};
|
|
|
|
|
bool copy(const QFileInfo &src, const QFileInfo &dst, QStringList *addedFiles);
|
|
|
|
|
|
2013-09-26 18:38:44 +02:00
|
|
|
void createAndroidManifestFile();
|
2014-09-22 16:20:51 +03:00
|
|
|
void createAndroidTemplateFiles();
|
2013-09-26 18:38:44 +02:00
|
|
|
ProjectExplorer::Target *m_target;
|
2018-07-02 18:12:25 +02:00
|
|
|
QString m_buildKey;
|
2013-09-26 18:38:44 +02:00
|
|
|
QString m_directory;
|
2014-09-22 16:20:51 +03:00
|
|
|
CopyState m_copyState;
|
|
|
|
|
bool m_copyGradle;
|
2013-09-26 18:38:44 +02:00
|
|
|
};
|
2014-06-25 15:42:11 +02:00
|
|
|
|
2018-07-02 18:40:29 +02:00
|
|
|
} // namespace Android
|