calamares/src/modules/keyboard/KeyboardPage.h

69 lines
1.8 KiB
C
Raw Normal View History

/* === This file is part of Calamares - <https://calamares.io> ===
*
2020-08-22 01:19:58 +02:00
* SPDX-FileCopyrightText: 2007 Free Software Foundation, Inc.
* SPDX-FileCopyrightText: 2014-2016 Teo Mrnjavac <teo@kde.org>
* SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Portions from the Manjaro Installation Framework
* by Roland Singer <roland@manjaro.org>
* Copyright (C) 2007 Free Software Foundation, Inc.
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef KEYBOARDPAGE_H
#define KEYBOARDPAGE_H
#include "Job.h"
#include <QListWidgetItem>
#include <QTimer>
#include <QWidget>
namespace Ui
{
class Page_Keyboard;
}
class KeyBoardPreview;
class KeyboardPage : public QWidget
{
Q_OBJECT
public:
explicit KeyboardPage( QWidget* parent = nullptr );
~KeyboardPage() override;
void init();
2014-07-08 18:25:39 +02:00
QString prettyStatus() const;
2020-03-26 15:57:02 +01:00
Calamares::JobList
createJobs( const QString& xOrgConfFileName, const QString& convertedKeymapPath, bool writeEtcDefaultKeyboard );
2014-11-26 18:56:09 +01:00
void onActivate();
void finalize();
protected slots:
2020-03-26 15:57:02 +01:00
void onListLayoutCurrentItemChanged( const QModelIndex& current, const QModelIndex& previous );
void onListVariantCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous );
private:
/// Guess a layout based on the split-apart locale
void guessLayout( const QStringList& langParts );
2020-03-26 15:57:02 +01:00
void updateVariants( const QPersistentModelIndex& currentItem, QString currentVariant = QString() );
2015-02-26 01:57:19 +01:00
Ui::Page_Keyboard* ui;
KeyBoardPreview* m_keyboardPreview;
int m_defaultIndex;
QMap< QString, QString > m_models;
QString m_selectedLayout;
QString m_selectedVariant;
QTimer m_setxkbmapTimer;
};
2020-03-26 15:57:02 +01:00
#endif // KEYBOARDPAGE_H