/* === This file is part of Calamares - === * * SPDX-FileCopyrightText: 2007 Free Software Foundation, Inc. * SPDX-FileCopyrightText: 2014-2016 Teo Mrnjavac * SPDX-FileCopyrightText: 2017 Adriaan de Groot * SPDX-License-Identifier: GPL-3.0-or-later * * Portions from the Manjaro Installation Framework * by Roland Singer * 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 #include #include namespace Ui { class Page_Keyboard; } class KeyBoardPreview; class KeyboardPage : public QWidget { Q_OBJECT public: explicit KeyboardPage( QWidget* parent = nullptr ); ~KeyboardPage() override; void init(); QString prettyStatus() const; Calamares::JobList createJobs( const QString& xOrgConfFileName, const QString& convertedKeymapPath, bool writeEtcDefaultKeyboard ); void onActivate(); void finalize(); protected slots: 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 ); void updateVariants( const QPersistentModelIndex& currentItem, QString currentVariant = QString() ); Ui::Page_Keyboard* ui; KeyBoardPreview* m_keyboardPreview; int m_defaultIndex; QMap< QString, QString > m_models; QString m_selectedLayout; QString m_selectedVariant; QTimer m_setxkbmapTimer; }; #endif // KEYBOARDPAGE_H