Blame view

Modif/epsilon-master/apps/on_boarding/language_controller.cpp 1.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
30
31
32
33
34
35
36
37
  #include "language_controller.h"
  #include "../global_preferences.h"
  #include "../apps_container.h"
  
  namespace OnBoarding {
  
  LanguageController::LanguageController(Responder * parentResponder, LogoController * logoController, UpdateController * updateController) :
    Shared::LanguageController(parentResponder, (Ion::Display::Height - I18n::NumberOfLanguages*Metric::ParameterCellHeight)/2),
  #if EPSILON_SOFTWARE_UPDATE_PROMPT
    m_updateController(updateController),
  #endif
    m_logoController(logoController)
  {
  }
  
  void LanguageController::reinitOnBoarding() {
    resetSelection();
    app()->displayModalViewController(m_logoController, 0.5f, 0.5f);
  }
  
  bool LanguageController::handleEvent(Ion::Events::Event event) {
    if (Shared::LanguageController::handleEvent(event)) {
  #if EPSILON_SOFTWARE_UPDATE_PROMPT
      app()->displayModalViewController(m_updateController, 0.5f, 0.5f);
  #else
      AppsContainer * appsContainer = (AppsContainer *)app()->container();
      appsContainer->switchTo(appsContainer->appSnapshotAtIndex(0));
  #endif
      return true;
    }
    if (event == Ion::Events::Back) {
      return true;
    }
    return false;
  }
  
  }