keyboard: Write the keyboard model and layout settings to the root mount point.

This is implemented as a new SetKeyboardLayout job that does the work.

Portions of the code are adapted from systemd-localed's source code,
which is under a compatible license (LGPLv2.1+, can be converted to our
GPLv3+ license). I ported it from C to to C++/Qt and made some minor
tweaks to the mapping logic (from X11 to vconsole layouts) though.

Fixes #31.

Tested on a Fedora Remix (Kannolo 21) with the default module settings
(finds the converted X11 keymaps for the virtual console) and with
convertedKeymapPath: "" (does the legacy keymap conversion as expected).
This commit is contained in:
Kevin Kofler 2014-11-11 02:58:14 +01:00
parent 54feddb330
commit 4f9f7d7858
10 changed files with 441 additions and 1 deletions

View file

@ -24,6 +24,7 @@
#include "ui_KeyboardPage.h"
#include "keyboardwidget/keyboardpreview.h"
#include "SetKeyboardLayoutJob.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
@ -188,6 +189,22 @@ KeyboardPage::prettyStatus() const
}
QList< Calamares::job_ptr >
KeyboardPage::createJobs()
{
QList< Calamares::job_ptr > list;
QString selectedModel = m_models.value( ui->comboBoxModel->currentText(),
"pc105" );
Calamares::Job* j = new SetKeyboardLayoutJob( selectedModel,
m_selectedLayout,
m_selectedVariant );
list.append( Calamares::job_ptr( j ) );
return list;
}
void
KeyboardPage::finalize()
{