2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2015-09-10 18:21:51 +02:00
|
|
|
*
|
|
|
|
* Copyright 2015, Anke Boersma <demm@kaosx.us>
|
|
|
|
* Copyright 2015, Alexandre Arnt <qtgzmanager@gmail.com>
|
|
|
|
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
|
2018-06-15 11:59:11 +02:00
|
|
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
2015-09-10 18:21:51 +02:00
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LICENSEPAGE_H
|
|
|
|
#define LICENSEPAGE_H
|
|
|
|
|
2019-04-20 17:52:22 +02:00
|
|
|
#include "utils/NamedEnum.h"
|
|
|
|
|
2015-09-10 18:21:51 +02:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class LicensePage;
|
|
|
|
}
|
|
|
|
|
2019-04-20 17:52:22 +02:00
|
|
|
struct LicenseEntry
|
2015-09-10 18:21:51 +02:00
|
|
|
{
|
2019-03-22 18:53:00 +01:00
|
|
|
enum class Type
|
2015-09-10 18:21:51 +02:00
|
|
|
{
|
|
|
|
Software = 0,
|
|
|
|
Driver,
|
|
|
|
GpuDriver,
|
|
|
|
BrowserPlugin,
|
|
|
|
Codec,
|
|
|
|
Package
|
|
|
|
};
|
|
|
|
|
2019-04-20 17:52:22 +02:00
|
|
|
/// @brief Lookup table for the enums
|
|
|
|
const NamedEnumTable< Type >& typeNames();
|
|
|
|
|
2019-03-22 19:31:39 +01:00
|
|
|
LicenseEntry( const QVariantMap& conf );
|
|
|
|
LicenseEntry( const LicenseEntry& ) = default;
|
|
|
|
|
2019-04-20 17:52:22 +02:00
|
|
|
bool isValid() const { return !m_id.isEmpty(); }
|
2019-04-20 17:58:01 +02:00
|
|
|
bool isRequired() const { return m_required; }
|
2019-03-22 19:31:39 +01:00
|
|
|
|
2019-04-20 17:52:22 +02:00
|
|
|
QString m_id;
|
|
|
|
QString m_prettyName;
|
|
|
|
QString m_prettyVendor;
|
|
|
|
Type m_type;
|
|
|
|
QUrl m_url;
|
|
|
|
bool m_required;
|
2015-09-10 18:21:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class LicensePage : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit LicensePage( QWidget* parent = nullptr );
|
|
|
|
|
|
|
|
void setEntries( const QList< LicenseEntry >& entriesList );
|
|
|
|
|
|
|
|
bool isNextEnabled() const;
|
|
|
|
signals:
|
|
|
|
void nextStatusChanged( bool status );
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::LicensePage* ui;
|
|
|
|
|
|
|
|
bool m_isNextEnabled;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //LICENSEPAGE_H
|