[locale] Add prettyStatus to Config

- this is present in the previous config, and helps make the modules
  consistent by returning prettyStatus in both ViewSteps.
This commit is contained in:
Adriaan de Groot 2020-07-24 11:53:32 +02:00
parent 07c096673d
commit a080e47f4b
4 changed files with 21 additions and 4 deletions

View file

@ -199,6 +199,11 @@ Config::Config( QObject* parent )
{ "set-timezone", location->region() + '/' + location->zone() } );
}
} );
auto prettyStatusNotify = [&]() { emit prettyStatusChanged( prettyStatus() ); };
connect( this, &Config::currentLanguageStatusChanged, prettyStatusNotify );
connect( this, &Config::currentLCStatusChanged, prettyStatusNotify );
connect( this, &Config::currentLocationStatusChanged, prettyStatusNotify );
}
Config::~Config() {}
@ -351,6 +356,13 @@ Config::currentLCStatus() const
.arg( localeLabel( m_selectedLocaleConfiguration.lc_numeric ) );
}
QString
Config::prettyStatus() const
{
QStringList l { currentLocationStatus(), currentLanguageStatus(), currentLCStatus() };
return l.join( QStringLiteral( "<br/>" ) );
}
static inline void
getLocaleGenLines( const QVariantMap& configurationMap, QStringList& localeGenLines )
{