[locale] Update global locale setting when it changes

- use debugging to be a little more chatty
 - when changing the system language on the locale page,
   the global locale setting should change, too.
This commit is contained in:
Adriaan de Groot 2019-01-07 18:49:08 +01:00
parent bc398756f5
commit 9d871fb9db

View file

@ -137,6 +137,7 @@ LocalePage::LocalePage( QWidget* parent )
connect( m_tzWidget, &TimeZoneWidget::locationChanged,
[this]( LocaleGlobal::Location location )
{
cDebug() << "Updating location from TZ widget to" << location;
m_blockTzWidgetSet = true;
// Set region index
@ -173,6 +174,7 @@ LocalePage::LocalePage( QWidget* parent )
{
m_selectedLocaleConfiguration.lang = dlg->selectedLCLocale();
m_selectedLocaleConfiguration.explicit_lang = true;
this->updateGlobalLocale();
this->updateLocaleLabels();
}
@ -441,6 +443,7 @@ LocalePage::onActivate()
{
auto newLocale = guessLocaleConfiguration();
m_selectedLocaleConfiguration.lang = newLocale.lang;
updateGlobalLocale();
updateLocaleLabels();
}
}
@ -487,6 +490,7 @@ LocalePage::updateGlobalLocale()
{
auto *gs = Calamares::JobQueue::instance()->globalStorage();
const QString bcp47 = m_selectedLocaleConfiguration.toBcp47();
cDebug() << "Updating global locale setting to" << bcp47;
gs->insert( "locale", bcp47 );
}