mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
[locale] Set *locale* GS key when needed
The code path for setting the locale / language automatically emits currentLanguageStatusChanged(), but the code that updates GS connects to currentLanguageCodeChaged(). This was altered in the 3.2.28 release cycle. Since then, automcatic locale selection wasn't setting *locale* in GS, so that a click-through kind of locale selection would not set it; then the packages module has no *locale* setting for localization packages. The combination of status and code signals (machine- and human- readable) is ok. Introduce a setter to the language that does the necessary signalling, so that setting the language automatically also DTRT. FIXES #1671
This commit is contained in:
parent
3444546159
commit
adb9f37cca
2 changed files with 15 additions and 5 deletions
|
@ -259,8 +259,7 @@ Config::setCurrentLocation( const CalamaresUtils::Locale::TimeZoneData* location
|
|||
auto newLocale = automaticLocaleConfiguration();
|
||||
if ( !m_selectedLocaleConfiguration.explicit_lang )
|
||||
{
|
||||
m_selectedLocaleConfiguration.setLanguage( newLocale.language() );
|
||||
emit currentLanguageStatusChanged( currentLanguageStatus() );
|
||||
setLanguage( newLocale.language() );
|
||||
}
|
||||
if ( !m_selectedLocaleConfiguration.explicit_lc )
|
||||
{
|
||||
|
@ -302,12 +301,21 @@ Config::localeConfiguration() const
|
|||
void
|
||||
Config::setLanguageExplicitly( const QString& language )
|
||||
{
|
||||
m_selectedLocaleConfiguration.setLanguage( language );
|
||||
m_selectedLocaleConfiguration.explicit_lang = true;
|
||||
setLanguage( language );
|
||||
}
|
||||
|
||||
void
|
||||
Config::setLanguage( const QString& language )
|
||||
{
|
||||
if ( language != m_selectedLocaleConfiguration.language() )
|
||||
{
|
||||
m_selectedLocaleConfiguration.setLanguage( language );
|
||||
|
||||
emit currentLanguageStatusChanged( currentLanguageStatus() );
|
||||
emit currentLanguageCodeChanged( currentLanguageCode() );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Config::setLCLocaleExplicitly( const QString& locale )
|
||||
|
|
|
@ -95,6 +95,8 @@ private:
|
|||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
/// Set the language, but do not mark it as user-choice
|
||||
void setLanguage( const QString& language );
|
||||
/// Set a language by user-choice, overriding future location changes
|
||||
void setLanguageExplicitly( const QString& language );
|
||||
/// Set LC (formats) by user-choice, overriding future location changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue