[apps/global_preferences] Added country preference

Change-Id: Ifbe09e2a24b4e1b9386f323bd5ebd9bed7fc8440
This commit is contained in:
Gabriel Ozouf
2020-06-18 17:22:46 +02:00
committed by Émilie Feral
parent d156c8c99e
commit 3f9b8f03af

View File

@@ -14,6 +14,8 @@ public:
static GlobalPreferences * sharedGlobalPreferences();
I18n::Language language() const { return m_language; }
void setLanguage(I18n::Language language) { m_language = language; }
I18n::Country country() const { return m_country; }
void setCountry(I18n::Country country) { m_country = country; }
bool isInExamMode() const { return (int8_t)examMode() > 0; }
ExamMode examMode() const;
void setExamMode(ExamMode examMode);
@@ -25,14 +27,17 @@ public:
void setFont(const KDFont * font) { m_font = font; }
constexpr static int NumberOfBrightnessStates = 12;
private:
static_assert(I18n::NumberOfLanguages > 0, "I18n::NumberOfLanguages is not superior to 0"); // There should already have be an error when processing an empty EPSILON_I18N flag
static_assert(I18n::NumberOfLanguages > 0, "I18n::NumberOfLanguages is not superior to 0"); // There should already have been an error when processing an empty EPSILON_I18N flag
static_assert(I18n::NumberOfCountries > 0, "I18n::NumberOfCountries is not superior to 0"); // There should already have been an error when processing an empty EPSILON_COUNTRIES flag
GlobalPreferences() :
m_language((I18n::Language)0),
m_country((I18n::Country)0),
m_examMode(ExamMode::Unknown),
m_showPopUp(true),
m_brightnessLevel(Ion::Backlight::MaxBrightness),
m_font(KDFont::LargeFont) {}
I18n::Language m_language;
I18n::Country m_country;
static_assert((int8_t)GlobalPreferences::ExamMode::Off == 0, "GlobalPreferences::isInExamMode() is not right");
static_assert((int8_t)GlobalPreferences::ExamMode::Unknown < 0, "GlobalPreferences::isInExamMode() is not right");
mutable ExamMode m_examMode;