source: calamares/trunk/fuentes/src/modules/locale/LocalePage.h @ 7538

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

sync with github

File size: 2.2 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Teo Mrnjavac <teo@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 LOCALEPAGE_H
20#define LOCALEPAGE_H
21
22#include "Typedefs.h"
23
24#include "LocaleConfiguration.h"
25
26#include <QWidget>
27
28class QComboBox;
29class QLabel;
30class QPushButton;
31class TimeZoneWidget;
32
33class LocalePage : public QWidget
34{
35    Q_OBJECT
36public:
37    explicit LocalePage( QWidget* parent = nullptr );
38    virtual ~LocalePage();
39
40    void init( const QString& initialRegion,
41               const QString& initialZone,
42               const QString& localeGenPath );
43
44    QString prettyStatus() const;
45
46    QList< Calamares::job_ptr > createJobs();
47
48    QMap< QString, QString > localesMap();
49
50    void onActivate();
51
52private:
53    LocaleConfiguration guessLocaleConfiguration() const;
54    QString prettyLCLocale( const QString& localesMap ) const;
55
56    // For the given locale config, return two strings describing
57    // the settings for language and numbers.
58    std::pair< QString, QString > prettyLocaleStatus( const LocaleConfiguration& ) const;
59
60    void updateGlobalStorage();
61    void updateLocaleLabels();
62
63    TimeZoneWidget* m_tzWidget;
64    QComboBox* m_regionCombo;
65    QComboBox* m_zoneCombo;
66
67    QLabel* m_regionLabel;
68    QLabel* m_zoneLabel;
69    QLabel* m_localeLabel;
70    QPushButton* m_localeChangeButton;
71    QLabel* m_formatsLabel;
72    QPushButton* m_formatsChangeButton;
73
74    LocaleConfiguration m_selectedLocaleConfiguration;
75
76    QStringList m_localeGenLines;
77
78    bool m_blockTzWidgetSet;
79};
80
81#endif // LOCALEPAGE_H
Note: See TracBrowser for help on using the repository browser.