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