source: calamares/trunk/fuentes/src/modules/plasmalnf/PlasmaLnfPage.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.5 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2017, Adriaan de Groot <groot@kde.org>
4 *
5 *   Calamares is free software: you can redistribute it and/or modify
6 *   it under the terms of the GNU General Public License as published by
7 *   the Free Software Foundation, either version 3 of the License, or
8 *   (at your option) any later version.
9 *
10 *   Calamares is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef PLASMALNFPAGE_H
20#define PLASMALNFPAGE_H
21
22#include <QButtonGroup>
23#include <QList>
24#include <QString>
25#include <QStringList>
26#include <QWidget>
27
28#include "ThemeInfo.h"
29#include "ThemeWidget.h"
30
31namespace Ui
32{
33class PlasmaLnfPage;
34}
35
36/** @brief Page for selecting a Plasma Look-and-Feel theme.
37 *
38 * You must call setEnabledThemes -- either overload -- once
39 * to get the selection widgets. Note that calling that with
40 * an empty list will result in zero (0) selectable themes.
41 */
42class PlasmaLnfPage : public QWidget
43{
44    Q_OBJECT
45public:
46    explicit PlasmaLnfPage( QWidget* parent = nullptr );
47
48    void setLnfPath( const QString& path );
49    /** @brief enable only the listed themes.
50     *
51     * Shows the listed @p themes with full information (e.g. screenshot).
52     * If @p showAll is true, then also show all installed themes
53     * not explicitly listed (without a screenshot).
54     */
55    void setEnabledThemes( const ThemeInfoList& themes, bool showAll );
56    /** @brief enable all installed plasma themes. */
57    void setEnabledThemesAll();
58    /** @brief set which theme is to be preselected. */
59    void setPreselect( const QString& id );
60
61signals:
62    void plasmaThemeSelected( const QString& id );
63
64private:
65    /** @brief Intersect the list of enabled themes with the installed ones. */
66    void winnowThemes();
67    /** @brief Get the translated names for all enabled themes. */
68    void updateThemeNames();
69    /** @brief show enabled themes in the UI. */
70    void fillUi();
71
72    Ui::PlasmaLnfPage* ui;
73    QString m_lnfPath;
74    QString m_preselect;
75    bool m_showAll;  // If true, don't winnow according to enabledThemes
76    ThemeInfoList m_enabledThemes;
77
78    QButtonGroup *m_buttonGroup;
79    QList< ThemeWidget* > m_widgets;
80};
81
82#endif //PLASMALNFPAGE_H
Note: See TracBrowser for help on using the repository browser.