mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Classes LanguageController and CountryController have been fused into one class LocalizationController, as they were very similar. This allows the Settings and OnBoarding apps to only keep one controller for both functions. Change-Id: Ic23f300c37122249d34caaf18a633b5815240a78
34 lines
912 B
C++
34 lines
912 B
C++
#include "localization_controller.h"
|
|
#include <algorithm>
|
|
#include <apps/apps_container.h>
|
|
|
|
namespace OnBoarding {
|
|
|
|
bool LocalizationController::handleEvent(Ion::Events::Event event) {
|
|
if (Shared::LocalizationController::handleEvent(event)) {
|
|
if (mode() == Mode::Language) {
|
|
setMode(Mode::Country);
|
|
viewWillAppear();
|
|
} else {
|
|
assert(mode() == Mode::Country);
|
|
AppsContainer * appsContainer = AppsContainer::sharedAppsContainer();
|
|
if (appsContainer->promptController()) {
|
|
Container::activeApp()->displayModalViewController(appsContainer->promptController(), 0.5f, 0.5f);
|
|
} else {
|
|
appsContainer->switchTo(appsContainer->appSnapshotAtIndex(0));
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
if (event == Ion::Events::Back) {
|
|
if (mode() == Mode::Country) {
|
|
setMode(Mode::Language);
|
|
viewWillAppear();
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|