From 6049267cf6e3ccd7a7421f71227861daacb10169 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 25 Nov 2014 17:43:12 +0100 Subject: [PATCH] Load lcLocale value into GlobalStorage. Also allow localeGenPath setting in locale.conf. --- src/modules/locale/LocaleViewStep.cpp | 20 ++++++++++++++++++-- src/modules/locale/LocaleViewStep.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index 01758f1d6..3d39caf71 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -21,6 +21,8 @@ #include "LocalePage.h" #include "timezonewidget/localeglobal.h" #include "widgets/WaitingWidget.h" +#include "JobQueue.h" +#include "GlobalStorage.h" #include "utils/CalamaresUtilsGui.h" @@ -46,7 +48,9 @@ LocaleViewStep::LocaleViewStep( QObject* parent ) connect( &m_initWatcher, &QFutureWatcher< void >::finished, [=] { - m_actualWidget->init( m_startingTimezone.first, m_startingTimezone.second ); + m_actualWidget->init( m_startingTimezone.first, + m_startingTimezone.second, + m_localeGenPath ); m_widget->layout()->removeWidget( waitingWidget ); waitingWidget->deleteLater(); m_widget->layout()->addWidget( m_actualWidget ); @@ -92,7 +96,8 @@ LocaleViewStep::widget() void LocaleViewStep::next() { - //TODO: actually save those settings somewhere + Calamares::JobQueue::instance()->globalStorage()->insert( "lcLocale", + m_actualWidget->lcLocale() ); emit done(); } @@ -158,4 +163,15 @@ LocaleViewStep::setConfigurationMap( const QVariantMap& configurationMap ) m_startingTimezone = qMakePair( QStringLiteral( "Europe" ), QStringLiteral( "Berlin" ) ); } + + if ( configurationMap.contains( "localeGenPath" ) && + configurationMap.value( "localeGenPath" ).type() == QVariant::String && + !configurationMap.value( "localeGenPath" ).toString().isEmpty() ) + { + m_localeGenPath = configurationMap.value( "localeGenPath" ).toString(); + } + else + { + m_localeGenPath = QStringLiteral( "/etc/locale.gen" ); + } } diff --git a/src/modules/locale/LocaleViewStep.h b/src/modules/locale/LocaleViewStep.h index 3d8de2c85..da3ba4402 100644 --- a/src/modules/locale/LocaleViewStep.h +++ b/src/modules/locale/LocaleViewStep.h @@ -67,6 +67,7 @@ private: QString m_prettyStatus; QPair< QString, QString > m_startingTimezone; + QString m_localeGenPath; QList< Calamares::job_ptr > m_jobs; };