2014-10-15 15:09:11 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-10-15 15:09:11 +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.
|
2014-10-15 15:09:11 +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.
|
2014-10-15 15:09:11 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-10-15 15:09:11 +02:00
|
|
|
|
|
|
|
|
#include "jsonwizard.h"
|
|
|
|
|
#include "../targetsetuppage.h"
|
|
|
|
|
|
2015-06-16 13:44:48 +02:00
|
|
|
#include <QVector>
|
|
|
|
|
|
2014-10-15 15:09:11 +02:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
|
|
|
|
// Documentation inside.
|
|
|
|
|
class JsonKitsPage : public TargetSetupPage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2016-04-13 15:52:14 +02:00
|
|
|
JsonKitsPage(QWidget *parent = nullptr);
|
2014-10-15 15:09:11 +02:00
|
|
|
|
2016-04-13 15:52:14 +02:00
|
|
|
void initializePage() override;
|
|
|
|
|
void cleanupPage() override;
|
2014-10-15 15:09:11 +02:00
|
|
|
|
2014-11-21 14:00:25 +01:00
|
|
|
void setUnexpandedProjectPath(const QString &path);
|
|
|
|
|
QString unexpandedProjectPath() const;
|
|
|
|
|
|
2015-06-16 13:44:48 +02:00
|
|
|
void setRequiredFeatures(const QVariant &data);
|
|
|
|
|
void setPreferredFeatures(const QVariant &data);
|
|
|
|
|
|
|
|
|
|
class ConditionalFeature {
|
|
|
|
|
public:
|
2015-06-24 12:32:28 +02:00
|
|
|
ConditionalFeature() = default;
|
2015-06-24 16:14:45 +02:00
|
|
|
ConditionalFeature(const QString &f, const QVariant &c) : feature(f), condition(c)
|
2015-06-16 13:44:48 +02:00
|
|
|
{ }
|
|
|
|
|
|
2015-06-24 16:14:45 +02:00
|
|
|
QString feature;
|
2015-06-16 13:44:48 +02:00
|
|
|
QVariant condition;
|
|
|
|
|
};
|
|
|
|
|
static QVector<ConditionalFeature> parseFeatures(const QVariant &data,
|
2018-11-15 10:32:56 +01:00
|
|
|
QString *errorMessage = nullptr);
|
2015-06-16 13:44:48 +02:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2014-10-15 15:09:11 +02:00
|
|
|
void setupProjectFiles(const JsonWizard::GeneratorFiles &files);
|
|
|
|
|
|
2014-11-21 14:00:25 +01:00
|
|
|
QString m_unexpandedProjectPath;
|
2015-06-16 13:44:48 +02:00
|
|
|
|
|
|
|
|
QVector<ConditionalFeature> m_requiredFeatures;
|
|
|
|
|
QVector<ConditionalFeature> m_preferredFeatures;
|
|
|
|
|
|
2015-11-27 11:31:35 +01:00
|
|
|
QSet<Core::Id> evaluate(const QVector<ConditionalFeature> &list, const QVariant &defaultSet,
|
2016-04-13 15:52:14 +02:00
|
|
|
JsonWizard *wiz);
|
2014-10-15 15:09:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ProjectExplorer
|