source: calamares/trunk/fuentes/src/modules/keyboard/KeyboardPage.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 2014-2016, Teo Mrnjavac <teo@kde.org>
4 *   Copyright 2017, Adriaan de Groot <groot@kde.org>
5 *
6 *   Portions from the Manjaro Installation Framework
7 *   by Roland Singer <roland@manjaro.org>
8 *   Copyright (C) 2007 Free Software Foundation, Inc.
9 *
10 *   Calamares is free software: you can redistribute it and/or modify
11 *   it under the terms of the GNU General Public License as published by
12 *   the Free Software Foundation, either version 3 of the License, or
13 *   (at your option) any later version.
14 *
15 *   Calamares is distributed in the hope that it will be useful,
16 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 *   GNU General Public License for more details.
19 *
20 *   You should have received a copy of the GNU General Public License
21 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#ifndef KEYBOARDPAGE_H
25#define KEYBOARDPAGE_H
26
27#include "keyboardwidget/keyboardglobal.h"
28
29#include "Typedefs.h"
30
31#include <QListWidgetItem>
32#include <QWidget>
33#include <QTimer>
34
35namespace Ui
36{
37class Page_Keyboard;
38}
39
40class KeyBoardPreview;
41
42class KeyboardPage : public QWidget
43{
44    Q_OBJECT
45public:
46    explicit KeyboardPage( QWidget* parent = nullptr );
47    virtual ~KeyboardPage();
48
49    void init();
50
51    QString prettyStatus() const;
52
53    QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
54                                            const QString& convertedKeymapPath,
55                                            bool writeEtcDefaultKeyboard );
56
57    void onActivate();
58    void finalize();
59
60protected slots:
61    void onListLayoutCurrentItemChanged( const QModelIndex& current,
62                                         const QModelIndex& previous );
63    void onListVariantCurrentItemChanged( QListWidgetItem* current,
64                                          QListWidgetItem* previous );
65
66private:
67    /// Guess a layout based on the split-apart locale
68    void guessLayout( const QStringList& langParts );
69    void updateVariants( const QPersistentModelIndex& currentItem,
70                         QString currentVariant = QString() );
71
72    Ui::Page_Keyboard* ui;
73    KeyBoardPreview* m_keyboardPreview;
74    int m_defaultIndex;
75    QMap< QString, QString > m_models;
76
77    QString m_selectedLayout;
78    QString m_selectedVariant;
79    QTimer m_setxkbmapTimer;
80};
81
82#endif // KEYBOARDPAGE_H
Note: See TracBrowser for help on using the repository browser.