Numworks Epsilon  1.4.1
Graphing Calculator Operating System
language_controller.cpp
Go to the documentation of this file.
1 #include "language_controller.h"
2 #include "../global_preferences.h"
3 #include "../apps_container.h"
4 
5 namespace OnBoarding {
6 
7 LanguageController::LanguageController(Responder * parentResponder, LogoController * logoController, UpdateController * updateController) :
8  Shared::LanguageController(parentResponder, (Ion::Display::Height - I18n::NumberOfLanguages*Metric::ParameterCellHeight)/2),
9 #if EPSILON_SOFTWARE_UPDATE_PROMPT
10  m_updateController(updateController),
11 #endif
12  m_logoController(logoController)
13 {
14 }
15 
18  app()->displayModalViewController(m_logoController, 0.5f, 0.5f);
19 }
20 
23 #if EPSILON_SOFTWARE_UPDATE_PROMPT
24  app()->displayModalViewController(m_updateController, 0.5f, 0.5f);
25 #else
26  AppsContainer * appsContainer = (AppsContainer *)app()->container();
27  appsContainer->refreshPreferences();
28  appsContainer->switchTo(appsContainer->appSnapshotAtIndex(0));
29 #endif
30  return true;
31  }
32  if (event == Ion::Events::Back) {
33  return true;
34  }
35  return false;
36 }
37 
38 }
Definition: i18n.h:6
void displayModalViewController(ViewController *vc, float verticalAlignment, float horizontalAlignment, KDCoordinate topMargin=0, KDCoordinate leftMargin=0, KDCoordinate bottomMargin=0, KDCoordinate rightMargin=0)
Definition: app.cpp:85
virtual App::Snapshot * appSnapshotAtIndex(int index)=0
void switchTo(App::Snapshot *snapshot) override
void Display(const char *input)
Definition: display.cpp:11
constexpr Event Back
Definition: events.h:66
LanguageController(Responder *parentResponder, LogoController *logoController, UpdateController *updateController)
bool handleEvent(Ion::Events::Event event) override
const Container * container() const
Definition: app.cpp:102
Definition: metric.h:6
bool handleEvent(Ion::Events::Event event) override
void refreshPreferences()
App * app()
Definition: responder.cpp:77
Definition: backlight.h:6
constexpr int Height
Definition: display.h:27