calamares/src/modules/welcome/WelcomePage.h
Adriaan de Groot 1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
2020-08-26 02:28:38 +02:00

85 lines
1.9 KiB
C++

/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2014 Teo Mrnjavac <teo@kde.org>
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef WELCOMEPAGE_H
#define WELCOMEPAGE_H
#include "locale/LabelModel.h"
#include <QStyledItemDelegate>
#include <QWidget>
namespace Ui
{
class WelcomePage;
}
class CheckerContainer;
class Config;
class WelcomePage : public QWidget
{
Q_OBJECT
public:
explicit WelcomePage( Config* conf, QWidget* parent = nullptr );
enum class Button
{
Support,
Donate,
KnownIssues,
ReleaseNotes
};
/// @brief Configure the button @p n, to open @p url
void setupButton( Button b, const QString& url );
/// @brief Set international language-selector icon
void setLanguageIcon( QPixmap );
/// @brief Results of requirements checking
bool verdict() const;
/// @brief Change the language from an external source.
void externallySelectedLanguage( int row );
void init();
public slots:
void retranslate();
void showAboutBox();
protected:
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
private:
/// @brief Fill the list of languages with the available translations
void initLanguages();
Ui::WelcomePage* ui;
CheckerContainer* m_checkingWidget;
CalamaresUtils::Locale::LabelModel* m_languages;
Config* m_conf;
};
/** @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;
};
#endif // WELCOMEPAGE_H