Blame view

build3/apps/on_boarding/update_controller.cpp 1 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  #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;
  }
  
  }