diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index d886f1eec..52378b0b4 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -142,6 +142,9 @@ loadLocales( const QString& localeGenPath ) Config::Config( QObject* parent ) : QObject( parent ) + , m_regionModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >( + CalamaresUtils::Locale::TZRegion::fromZoneTab() ) ) + , m_zonesModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >() ) { } diff --git a/src/modules/locale/Config.h b/src/modules/locale/Config.h index 34aa8b92f..a98ecc73d 100644 --- a/src/modules/locale/Config.h +++ b/src/modules/locale/Config.h @@ -21,12 +21,18 @@ #ifndef LOCALE_CONFIG_H #define LOCALE_CONFIG_H +#include "locale/TimeZone.h" + #include +#include + class Config : public QObject { Q_OBJECT Q_PROPERTY( const QStringList& supportedLocales READ supportedLocales CONSTANT FINAL ) + Q_PROPERTY( CalamaresUtils::Locale::CStringListModel* zonesModel READ zonesModel CONSTANT FINAL ) + Q_PROPERTY( CalamaresUtils::Locale::CStringListModel* regionModel READ regionModel CONSTANT FINAL ) public: Config( QObject* parent = nullptr ); @@ -36,10 +42,17 @@ public: public Q_SLOTS: const QStringList& supportedLocales() const { return m_localeGenLines; } + CalamaresUtils::Locale::CStringListModel* regionModel() const { return m_regionModel.get(); } + CalamaresUtils::Locale::CStringListModel* zonesModel() const { return m_zonesModel.get(); } private: /// A list of supported locale identifiers (e.g. "en_US.UTF-8") QStringList m_localeGenLines; + + /// The regions (America, Asia, Europe ..) + std::unique_ptr< CalamaresUtils::Locale::CStringListModel > m_regionModel; + /// The zones for the current region (e.g. America/New_York) + std::unique_ptr< CalamaresUtils::Locale::CStringListModel > m_zonesModel; };