2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-06-11 13:37:10 +02:00
|
|
|
*
|
|
|
|
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
2019-04-18 23:17:49 +02:00
|
|
|
* Copyright 2019, Adriaan de Groot <groot@kde.org>
|
2014-06-11 13:37:10 +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/>.
|
|
|
|
*/
|
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
#ifndef WELCOMEPAGE_H
|
|
|
|
#define WELCOMEPAGE_H
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2019-05-10 17:46:20 +02:00
|
|
|
#include "locale/LabelModel.h"
|
|
|
|
|
|
|
|
#include <QStyledItemDelegate>
|
2014-06-27 18:00:27 +02:00
|
|
|
#include <QWidget>
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2014-11-20 09:40:55 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
2015-05-13 12:44:11 +02:00
|
|
|
class WelcomePage;
|
2014-11-20 09:40:55 +01:00
|
|
|
}
|
2014-11-10 12:40:00 +01:00
|
|
|
|
2017-12-02 15:56:03 +01:00
|
|
|
class CheckerContainer;
|
2015-05-14 18:02:26 +02:00
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
class WelcomePage : public QWidget
|
2014-06-11 13:37:10 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-12-02 15:56:03 +01:00
|
|
|
explicit WelcomePage( QWidget* parent = nullptr );
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2019-04-18 23:17:49 +02:00
|
|
|
/// @brief Configure the buttons for URLs from the branding configuration
|
2015-04-02 12:28:40 +02:00
|
|
|
void setUpLinks( bool showSupportUrl,
|
|
|
|
bool showKnownIssuesUrl,
|
|
|
|
bool showReleaseNotesUrl );
|
|
|
|
|
2019-04-18 23:17:49 +02:00
|
|
|
/// @brief Results of requirements checking
|
2017-12-02 15:56:03 +01:00
|
|
|
bool verdict() const;
|
|
|
|
|
2014-11-10 12:40:00 +01:00
|
|
|
protected:
|
|
|
|
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
|
|
|
|
|
|
|
|
private:
|
2019-04-18 23:17:49 +02:00
|
|
|
/// @brief Fill the list of languages with the available translations
|
2015-05-14 18:02:26 +02:00
|
|
|
void initLanguages();
|
2019-04-18 23:17:49 +02:00
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
Ui::WelcomePage* ui;
|
2017-12-02 15:56:03 +01:00
|
|
|
CheckerContainer* m_checkingWidget;
|
2019-05-10 17:46:20 +02:00
|
|
|
CalamaresUtils::Locale::LabelModel *m_languages;
|
2014-06-11 13:37:10 +02:00
|
|
|
};
|
|
|
|
|
2019-05-10 17:46:20 +02:00
|
|
|
/** @brief Delegate to display language information in two columns.
|
|
|
|
*
|
|
|
|
* Displays the native language name and the English language name.
|
|
|
|
*/
|
|
|
|
class LocaleTwoColumnDelegate : public QStyledItemDelegate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using QStyledItemDelegate::QStyledItemDelegate;
|
|
|
|
|
|
|
|
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const override;
|
|
|
|
} ;
|
|
|
|
|
2015-05-13 12:44:11 +02:00
|
|
|
#endif // WELCOMEPAGE_H
|