mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 18:05:36 -04:00
[welcome] Provide API for updating the country
- Changing country will pre-select the language most likely for that country (it doesn't, yet, since we don't have the data).
This commit is contained in:
parent
cb7c38daba
commit
2a448c057d
2 changed files with 25 additions and 3 deletions
|
@ -126,9 +126,11 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
CalamaresUtils::getString( geoip, "url" ),
|
CalamaresUtils::getString( geoip, "url" ),
|
||||||
CalamaresUtils::getString( geoip, "selector" ) );
|
CalamaresUtils::getString( geoip, "selector" ) );
|
||||||
auto* future = new FWString();
|
auto* future = new FWString();
|
||||||
connect( future, &FWString::finished, [f=future, h=handler]()
|
connect( future, &FWString::finished, [view=this, f=future, h=handler]()
|
||||||
{
|
{
|
||||||
cDebug() << "GeoIP result for welcome=" << f->future().result();
|
QString countryResult = f->future().result();
|
||||||
|
cDebug() << "GeoIP result for welcome=" << countryResult;
|
||||||
|
view->setCountry( countryResult );
|
||||||
f->deleteLater();
|
f->deleteLater();
|
||||||
delete h;
|
delete h;
|
||||||
} );
|
} );
|
||||||
|
@ -136,7 +138,20 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Calamares::RequirementsList WelcomeViewStep::checkRequirements()
|
Calamares::RequirementsList
|
||||||
|
WelcomeViewStep::checkRequirements()
|
||||||
{
|
{
|
||||||
return m_requirementsChecker->checkRequirements();
|
return m_requirementsChecker->checkRequirements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
WelcomeViewStep::setCountry( const QString& countryCode )
|
||||||
|
{
|
||||||
|
if ( countryCode.length() != 2 )
|
||||||
|
{
|
||||||
|
cDebug() << "Unusable country code" << countryCode;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cDebug() << "TODO: update country" << countryCode;
|
||||||
|
}
|
||||||
|
|
|
@ -54,6 +54,13 @@ public:
|
||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||||
|
|
||||||
|
/** @brief Sets the country that Calamares is running in.
|
||||||
|
*
|
||||||
|
* This (ideally) sets up language and locale settings that are right for
|
||||||
|
* the given 2-letter country code.
|
||||||
|
*/
|
||||||
|
void setCountry( const QString& );
|
||||||
|
|
||||||
Calamares::RequirementsList checkRequirements() override;
|
Calamares::RequirementsList checkRequirements() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue