Store keyboard layout information in GlobalStorage.
This commit is contained in:
parent
7680578b61
commit
cc2e49c6ae
@ -25,6 +25,9 @@
|
|||||||
#include "ui_KeyboardPage.h"
|
#include "ui_KeyboardPage.h"
|
||||||
#include "keyboardwidget/keyboardpreview.h"
|
#include "keyboardwidget/keyboardpreview.h"
|
||||||
|
|
||||||
|
#include "GlobalStorage.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@ -184,6 +187,20 @@ KeyboardPage::prettyStatus() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
KeyboardPage::finalize()
|
||||||
|
{
|
||||||
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
if ( !m_selectedLayout.isEmpty() )
|
||||||
|
{
|
||||||
|
gs->insert( "keyboardLayout", m_selectedLayout );
|
||||||
|
gs->insert( "keyboardVariant", m_selectedVariant ); //empty means default variant
|
||||||
|
}
|
||||||
|
|
||||||
|
//FIXME: also store keyboard model for something?
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
KeyboardPage::onListLayoutCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous )
|
KeyboardPage::onListLayoutCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous )
|
||||||
{
|
{
|
||||||
@ -242,5 +259,8 @@ KeyboardPage::onListVariantCurrentItemChanged( QListWidgetItem* current, QListWi
|
|||||||
// Set Xorg keyboard layout
|
// Set Xorg keyboard layout
|
||||||
QProcess::execute( QString( "setxkbmap -layout \"%1\" -variant \"%2\"" )
|
QProcess::execute( QString( "setxkbmap -layout \"%1\" -variant \"%2\"" )
|
||||||
.arg( layout, variant ).toUtf8() );
|
.arg( layout, variant ).toUtf8() );
|
||||||
|
|
||||||
|
m_selectedLayout = layout;
|
||||||
|
m_selectedVariant = variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ public:
|
|||||||
|
|
||||||
QString prettyStatus() const;
|
QString prettyStatus() const;
|
||||||
|
|
||||||
|
void finalize();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void onListLayoutCurrentItemChanged( QListWidgetItem* current,
|
void onListLayoutCurrentItemChanged( QListWidgetItem* current,
|
||||||
QListWidgetItem* previous );
|
QListWidgetItem* previous );
|
||||||
@ -63,6 +65,9 @@ private:
|
|||||||
KeyBoardPreview* m_keyboardPreview;
|
KeyBoardPreview* m_keyboardPreview;
|
||||||
int m_defaultIndex;
|
int m_defaultIndex;
|
||||||
QMap< QString, QString > m_models;
|
QMap< QString, QString > m_models;
|
||||||
|
|
||||||
|
QString m_selectedLayout;
|
||||||
|
QString m_selectedVariant;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEYBOARDPAGE_H
|
#endif // KEYBOARDPAGE_H
|
||||||
|
@ -104,5 +104,6 @@ KeyboardViewStep::jobs() const
|
|||||||
void
|
void
|
||||||
KeyboardViewStep::onLeave()
|
KeyboardViewStep::onLeave()
|
||||||
{
|
{
|
||||||
|
m_widget->finalize();
|
||||||
m_prettyStatus = m_widget->prettyStatus();
|
m_prettyStatus = m_widget->prettyStatus();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user