Files
Upsilon/apps/on_boarding/update_controller.cpp
Émilie Feral bc9c9e3c72 [apps/code][apps/onboarding] Home event always bring back to home except
in on boarding

Change-Id: I1a3af63cd6e9d267d9065fbf6591d46881752815
2017-08-17 16:21:22 +02:00

30 lines
1.0 KiB
C++

#include "update_controller.h"
#include "../apps_container.h"
#include <assert.h>
namespace OnBoarding {
static I18n::Message sOnBoardingMessages[] = {I18n::Message::UpdateAvailable, I18n::Message::UpdateMessage1, I18n::Message::UpdateMessage2, I18n::Message::UpdateMessage3, I18n::Message::UpdateMessage4};
static KDColor sOnBoardingColors[] = {KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::YellowDark};
UpdateController::UpdateController() :
MessageController(sOnBoardingMessages, sOnBoardingColors)
{
}
bool UpdateController::handleEvent(Ion::Events::Event event) {
if (event != Ion::Events::Back && event != Ion::Events::OnOff) {
app()->dismissModalViewController();
AppsContainer * appsContainer = (AppsContainer *)app()->container();
if (appsContainer->activeApp()->snapshot() == appsContainer->onBoardingAppSnapshot()) {
appsContainer->refreshPreferences();
appsContainer->switchTo(appsContainer->appSnapshotAtIndex(0));
}
return true;
}
return false;
}
}