[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:
parent
07c096673d
commit
a080e47f4b
@ -199,6 +199,11 @@ Config::Config( QObject* parent )
|
|||||||
{ "set-timezone", location->region() + '/' + location->zone() } );
|
{ "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() {}
|
Config::~Config() {}
|
||||||
@ -351,6 +356,13 @@ Config::currentLCStatus() const
|
|||||||
.arg( localeLabel( m_selectedLocaleConfiguration.lc_numeric ) );
|
.arg( localeLabel( m_selectedLocaleConfiguration.lc_numeric ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
Config::prettyStatus() const
|
||||||
|
{
|
||||||
|
QStringList l { currentLocationStatus(), currentLanguageStatus(), currentLCStatus() };
|
||||||
|
return l.join( QStringLiteral( "<br/>" ) );
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
getLocaleGenLines( const QVariantMap& configurationMap, QStringList& localeGenLines )
|
getLocaleGenLines( const QVariantMap& configurationMap, QStringList& localeGenLines )
|
||||||
{
|
{
|
||||||
|
@ -51,6 +51,9 @@ class Config : public QObject
|
|||||||
Q_PROPERTY( QString currentLanguageCode READ currentLanguageCode WRITE setLanguageExplicitly NOTIFY currentLanguageCodeChanged )
|
Q_PROPERTY( QString currentLanguageCode READ currentLanguageCode WRITE setLanguageExplicitly NOTIFY currentLanguageCodeChanged )
|
||||||
Q_PROPERTY( QString currentLCCode READ currentLCCode WRITE setLCLocaleExplicitly NOTIFY currentLCCodeChanged )
|
Q_PROPERTY( QString currentLCCode READ currentLCCode WRITE setLCLocaleExplicitly NOTIFY currentLCCodeChanged )
|
||||||
|
|
||||||
|
// This is a long human-readable string with all three statuses
|
||||||
|
Q_PROPERTY( QString prettyStatus READ prettyStatus NOTIFY prettyStatusChanged FINAL )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Config( QObject* parent = nullptr );
|
Config( QObject* parent = nullptr );
|
||||||
~Config();
|
~Config();
|
||||||
@ -79,6 +82,9 @@ public:
|
|||||||
/// The human-readable description of what locale (LC_*) is used
|
/// The human-readable description of what locale (LC_*) is used
|
||||||
QString currentLCStatus() const;
|
QString currentLCStatus() const;
|
||||||
|
|
||||||
|
/// The human-readable summary of what the module will do
|
||||||
|
QString prettyStatus() const;
|
||||||
|
|
||||||
const QStringList& supportedLocales() const { return m_localeGenLines; }
|
const QStringList& supportedLocales() const { return m_localeGenLines; }
|
||||||
CalamaresUtils::Locale::CStringListModel* regionModel() const { return m_regionModel.get(); }
|
CalamaresUtils::Locale::CStringListModel* regionModel() const { return m_regionModel.get(); }
|
||||||
CalamaresUtils::Locale::CStringListModel* zonesModel() const { return m_zonesModel.get(); }
|
CalamaresUtils::Locale::CStringListModel* zonesModel() const { return m_zonesModel.get(); }
|
||||||
@ -122,6 +128,7 @@ signals:
|
|||||||
void currentLocationStatusChanged( const QString& ) const;
|
void currentLocationStatusChanged( const QString& ) const;
|
||||||
void currentLanguageStatusChanged( const QString& ) const;
|
void currentLanguageStatusChanged( const QString& ) const;
|
||||||
void currentLCStatusChanged( const QString& ) const;
|
void currentLCStatusChanged( const QString& ) const;
|
||||||
|
void prettyStatusChanged( const QString& ) const;
|
||||||
void currentLanguageCodeChanged( const QString& ) const;
|
void currentLanguageCodeChanged( const QString& ) const;
|
||||||
void currentLCCodeChanged( const QString& ) const;
|
void currentLCCodeChanged( const QString& ) const;
|
||||||
|
|
||||||
|
@ -89,8 +89,7 @@ LocaleViewStep::prettyName() const
|
|||||||
QString
|
QString
|
||||||
LocaleViewStep::prettyStatus() const
|
LocaleViewStep::prettyStatus() const
|
||||||
{
|
{
|
||||||
QStringList l { m_config->currentLocationStatus(), m_config->currentLanguageStatus(), m_config->currentLCStatus() };
|
return m_config->prettyStatus();
|
||||||
return l.join( QStringLiteral( "<br/>" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,8 +44,7 @@ LocaleQmlViewStep::prettyName() const
|
|||||||
QString
|
QString
|
||||||
LocaleQmlViewStep::prettyStatus() const
|
LocaleQmlViewStep::prettyStatus() const
|
||||||
{
|
{
|
||||||
QStringList l { m_config->currentLocationStatus(), m_config->currentLanguageStatus(), m_config->currentLCStatus() };
|
return m_config->prettyStatus();
|
||||||
return l.join( QStringLiteral( "<br/>" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Loading…
Reference in New Issue
Block a user