mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 02:45:37 -04:00
[keyboard] Move configuration to the Config object
- information from the configuration file -> Config object - job creation -> Config object Ignore keyboardq for now.
This commit is contained in:
parent
0f6602cad7
commit
c7c7e6a6c1
6 changed files with 60 additions and 51 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "utils/String.h"
|
||||
#include "utils/Variant.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QProcess>
|
||||
|
@ -214,16 +215,16 @@ Config::prettyStatus() const
|
|||
}
|
||||
|
||||
Calamares::JobList
|
||||
Config::createJobs( const QString& xOrgConfFileName, const QString& convertedKeymapPath, bool writeEtcDefaultKeyboard )
|
||||
Config::createJobs()
|
||||
{
|
||||
QList< Calamares::job_ptr > list;
|
||||
|
||||
Calamares::Job* j = new SetKeyboardLayoutJob( m_selectedModel,
|
||||
m_selectedLayout,
|
||||
m_selectedVariant,
|
||||
xOrgConfFileName,
|
||||
convertedKeymapPath,
|
||||
writeEtcDefaultKeyboard );
|
||||
m_xOrgConfFileName,
|
||||
m_convertedKeymapPath,
|
||||
m_writeEtcDefaultKeyboard );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
|
||||
return list;
|
||||
|
@ -393,3 +394,41 @@ Config::updateVariants( const QPersistentModelIndex& currentItem, QString curren
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{
|
||||
using namespace CalamaresUtils;
|
||||
|
||||
if ( configurationMap.contains( "xOrgConfFileName" )
|
||||
&& configurationMap.value( "xOrgConfFileName" ).type() == QVariant::String
|
||||
&& !getString( configurationMap, "xOrgConfFileName" ).isEmpty() )
|
||||
{
|
||||
m_xOrgConfFileName = getString( configurationMap, "xOrgConfFileName" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xOrgConfFileName = "00-keyboard.conf";
|
||||
}
|
||||
|
||||
if ( configurationMap.contains( "convertedKeymapPath" )
|
||||
&& configurationMap.value( "convertedKeymapPath" ).type() == QVariant::String
|
||||
&& !getString( configurationMap, "convertedKeymapPath" ).isEmpty() )
|
||||
{
|
||||
m_convertedKeymapPath = getString( configurationMap, "convertedKeymapPath" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_convertedKeymapPath = QString();
|
||||
}
|
||||
|
||||
if ( configurationMap.contains( "writeEtcDefaultKeyboard" )
|
||||
&& configurationMap.value( "writeEtcDefaultKeyboard" ).type() == QVariant::Bool )
|
||||
{
|
||||
m_writeEtcDefaultKeyboard = getBool( configurationMap, "writeEtcDefaultKeyboard", true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_writeEtcDefaultKeyboard = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue