Make writeEtcDefaultKeyboard an option in keyboard.conf.
This commit is contained in:
parent
431e6b8c03
commit
2a74fc423f
@ -202,7 +202,8 @@ KeyboardPage::prettyStatus() const
|
|||||||
|
|
||||||
QList< Calamares::job_ptr >
|
QList< Calamares::job_ptr >
|
||||||
KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath )
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard )
|
||||||
{
|
{
|
||||||
QList< Calamares::job_ptr > list;
|
QList< Calamares::job_ptr > list;
|
||||||
QString selectedModel = m_models.value( ui->comboBoxModel->currentText(),
|
QString selectedModel = m_models.value( ui->comboBoxModel->currentText(),
|
||||||
@ -212,7 +213,8 @@ KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
|||||||
m_selectedLayout,
|
m_selectedLayout,
|
||||||
m_selectedVariant,
|
m_selectedVariant,
|
||||||
xOrgConfFileName,
|
xOrgConfFileName,
|
||||||
convertedKeymapPath );
|
convertedKeymapPath,
|
||||||
|
writeEtcDefaultKeyboard );
|
||||||
list.append( Calamares::job_ptr( j ) );
|
list.append( Calamares::job_ptr( j ) );
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
@ -50,7 +50,8 @@ public:
|
|||||||
QString prettyStatus() const;
|
QString prettyStatus() const;
|
||||||
|
|
||||||
QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
|
QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath );
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard );
|
||||||
|
|
||||||
void onActivate();
|
void onActivate();
|
||||||
void finalize();
|
void finalize();
|
||||||
|
@ -123,7 +123,9 @@ void
|
|||||||
KeyboardViewStep::onLeave()
|
KeyboardViewStep::onLeave()
|
||||||
{
|
{
|
||||||
m_widget->finalize();
|
m_widget->finalize();
|
||||||
m_jobs = m_widget->createJobs( m_xOrgConfFileName, m_convertedKeymapPath );
|
m_jobs = m_widget->createJobs( m_xOrgConfFileName,
|
||||||
|
m_convertedKeymapPath,
|
||||||
|
m_writeEtcDefaultKeyboard );
|
||||||
m_prettyStatus = m_widget->prettyStatus();
|
m_prettyStatus = m_widget->prettyStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,4 +159,14 @@ KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
{
|
{
|
||||||
m_convertedKeymapPath = QString();
|
m_convertedKeymapPath = QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "writeEtcDefaultKeyboard" ) &&
|
||||||
|
configurationMap.value( "writeEtcDefaultKeyboard" ).type() == QVariant::Bool )
|
||||||
|
{
|
||||||
|
m_writeEtcDefaultKeyboard = configurationMap.value( "writeEtcDefaultKeyboard" ).toBool();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_writeEtcDefaultKeyboard = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@ private:
|
|||||||
|
|
||||||
QString m_xOrgConfFileName;
|
QString m_xOrgConfFileName;
|
||||||
QString m_convertedKeymapPath;
|
QString m_convertedKeymapPath;
|
||||||
|
bool m_writeEtcDefaultKeyboard;
|
||||||
|
|
||||||
QList< Calamares::job_ptr > m_jobs;
|
QList< Calamares::job_ptr > m_jobs;
|
||||||
};
|
};
|
||||||
|
@ -40,13 +40,15 @@ SetKeyboardLayoutJob::SetKeyboardLayoutJob( const QString& model,
|
|||||||
const QString& layout,
|
const QString& layout,
|
||||||
const QString& variant,
|
const QString& variant,
|
||||||
const QString& xOrgConfFileName,
|
const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath )
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard)
|
||||||
: Calamares::Job()
|
: Calamares::Job()
|
||||||
, m_model( model )
|
, m_model( model )
|
||||||
, m_layout( layout )
|
, m_layout( layout )
|
||||||
, m_variant( variant )
|
, m_variant( variant )
|
||||||
, m_xOrgConfFileName( xOrgConfFileName )
|
, m_xOrgConfFileName( xOrgConfFileName )
|
||||||
, m_convertedKeymapPath( convertedKeymapPath )
|
, m_convertedKeymapPath( convertedKeymapPath )
|
||||||
|
, m_writeEtcDefaultKeyboard( writeEtcDefaultKeyboard )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +324,7 @@ SetKeyboardLayoutJob::exec()
|
|||||||
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for X11." ),
|
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for X11." ),
|
||||||
tr( "Failed to write to %1" ).arg( keyboardConfPath ) );
|
tr( "Failed to write to %1" ).arg( keyboardConfPath ) );
|
||||||
|
|
||||||
if ( !defaultKeyboardPath.isEmpty() )
|
if ( !defaultKeyboardPath.isEmpty() && m_writeEtcDefaultKeyboard )
|
||||||
{
|
{
|
||||||
if ( !writeDefaultKeyboardData( defaultKeyboardPath ) )
|
if ( !writeDefaultKeyboardData( defaultKeyboardPath ) )
|
||||||
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration to existing /etc/default directory." ),
|
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration to existing /etc/default directory." ),
|
||||||
|
@ -31,7 +31,8 @@ public:
|
|||||||
const QString& layout,
|
const QString& layout,
|
||||||
const QString& variant,
|
const QString& variant,
|
||||||
const QString& xOrgConfFileName,
|
const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath );
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard );
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
Calamares::JobResult exec() override;
|
Calamares::JobResult exec() override;
|
||||||
@ -49,6 +50,7 @@ private:
|
|||||||
QString m_variant;
|
QString m_variant;
|
||||||
QString m_xOrgConfFileName;
|
QString m_xOrgConfFileName;
|
||||||
QString m_convertedKeymapPath;
|
QString m_convertedKeymapPath;
|
||||||
|
const bool m_writeEtcDefaultKeyboard;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SETKEYBOARDLAYOUTJOB_H */
|
#endif /* SETKEYBOARDLAYOUTJOB_H */
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
# The default value is the name used by upstream systemd-localed.
|
# The default value is the name used by upstream systemd-localed.
|
||||||
# Relative paths are assumed to be relative to /etc/X11/xorg.conf.d
|
# Relative paths are assumed to be relative to /etc/X11/xorg.conf.d
|
||||||
xOrgConfFileName: "/etc/X11/xorg.conf.d/00-keyboard.conf"
|
xOrgConfFileName: "/etc/X11/xorg.conf.d/00-keyboard.conf"
|
||||||
|
|
||||||
# The path to search for keymaps converted from X11 to kbd format
|
# The path to search for keymaps converted from X11 to kbd format
|
||||||
# Leave this empty if the setting does not make sense on your distribution.
|
# Leave this empty if the setting does not make sense on your distribution.
|
||||||
convertedKeymapPath: "/lib/kbd/keymaps/xkb"
|
convertedKeymapPath: "/lib/kbd/keymaps/xkb"
|
||||||
|
|
||||||
|
# Write keymap configuration to /etc/default/keyboard, usually
|
||||||
|
# found on Debian-related systems.
|
||||||
|
# Defaults to true if nothing is set.
|
||||||
|
#writeEtcDefaultKeyboard: true
|
||||||
|
Loading…
Reference in New Issue
Block a user