mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/on_boarding] Remember language choice
When choosing a language and then pressing back from the country menu to get back to the language menu, the previously selected language remains selected. Change-Id: I018c51cce09d47b15bb4864c135d381a94b2a72f
This commit is contained in:
committed by
Émilie Feral
parent
54c28fc87f
commit
64e7057d50
@@ -7,7 +7,7 @@ namespace OnBoarding {
|
||||
|
||||
int LocalizationController::indexOfCellToSelectOnReset() const {
|
||||
return mode() == Mode::Language ?
|
||||
0 :
|
||||
Shared::LocalizationController::indexOfCellToSelectOnReset() :
|
||||
IndexOfCountry(I18n::DefaultCountryForLanguage[static_cast<uint8_t>(GlobalPreferences::sharedGlobalPreferences()->language())]);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Settings {
|
||||
|
||||
int LocalizationController::indexOfCellToSelectOnReset() const {
|
||||
return mode() == Mode::Language ?
|
||||
static_cast<int>(GlobalPreferences::sharedGlobalPreferences()->language()) :
|
||||
Shared::LocalizationController::indexOfCellToSelectOnReset() :
|
||||
IndexOfCountry(GlobalPreferences::sharedGlobalPreferences()->country());
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,11 @@ void LocalizationController::setMode(LocalizationController::Mode mode) {
|
||||
m_contentView.modeHasChanged();
|
||||
}
|
||||
|
||||
int LocalizationController::indexOfCellToSelectOnReset() const {
|
||||
assert(mode() == Mode::Language);
|
||||
return static_cast<int>(GlobalPreferences::sharedGlobalPreferences()->language());
|
||||
}
|
||||
|
||||
const char * LocalizationController::title() {
|
||||
if (mode() == Mode::Language) {
|
||||
return I18n::translate(I18n::Message::Language);
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
Mode mode() const { return m_mode; }
|
||||
void setMode(Mode mode);
|
||||
|
||||
virtual int indexOfCellToSelectOnReset() const = 0;
|
||||
virtual int indexOfCellToSelectOnReset() const;
|
||||
virtual bool shouldDisplayTitle() const = 0;
|
||||
bool shouldDisplayWarning() const { return mode() == Mode::Country; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user