diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index bee6ddd4e..bd60f10fd 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -214,9 +214,8 @@ void AppsContainer::run() { * and it is visible when reflashing a N0100 (there is some noise on the * screen before the logo appears). */ Ion::Display::pushRectUniform(screenRect, KDColorWhite); - // TODO if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) { - activateExamMode(); + activateExamMode(GlobalPreferences::sharedGlobalPreferences()->examMode()); } refreshPreferences(); @@ -326,9 +325,10 @@ void AppsContainer::redrawWindow() { m_window.redraw(); } -void AppsContainer::activateExamMode() { +void AppsContainer::activateExamMode(GlobalPreferences::ExamMode examMode) { + assert(examMode == GlobalPreferences::ExamMode::Standard || examMode == GlobalPreferences::ExamMode::Dutch); reset(); - Ion::LED::setColor(KDColorRed); + Ion::LED::setColor(examMode == GlobalPreferences::ExamMode::Dutch ? KDColorOrange : KDColorRed); Ion::LED::setBlinking(1000, 0.1f); } diff --git a/apps/apps_container.h b/apps/apps_container.h index 834d7e336..4cd05c7f8 100644 --- a/apps/apps_container.h +++ b/apps/apps_container.h @@ -13,6 +13,7 @@ #include "exam_pop_up_controller_delegate.h" #include "battery_timer.h" #include "suspend_timer.h" +#include "global_preferences.h" #include "backlight_dimming_timer.h" #include "shared/global_context.h" #include "on_boarding/pop_up_controller.h" @@ -46,7 +47,7 @@ public: void setShiftAlphaStatus(Ion::Events::ShiftAlphaStatus newStatus); OnBoarding::PopUpController * promptController(); void redrawWindow(); - void activateExamMode(); + void activateExamMode(GlobalPreferences::ExamMode examMode); // Exam pop-up controller delegate void examDeactivatingPopUpIsDismissed() override; // Ion::StorageDelegate diff --git a/apps/exam_pop_up_controller.cpp b/apps/exam_pop_up_controller.cpp index a51286e81..6ed85321c 100644 --- a/apps/exam_pop_up_controller.cpp +++ b/apps/exam_pop_up_controller.cpp @@ -51,10 +51,11 @@ ExamPopUpController::ContentView::ContentView(Responder * parentResponder) : m_okButton(parentResponder, I18n::Message::Ok, Invocation([](void * context, void * sender) { ExamPopUpController * controller = (ExamPopUpController *)context; // TODO - GlobalPreferences::sharedGlobalPreferences()->setExamMode(controller->isActivatingExamMode() ? GlobalPreferences::ExamMode::Dutch : GlobalPreferences::ExamMode::Off); + GlobalPreferences::ExamMode mode = controller->isActivatingExamMode() ? GlobalPreferences::ExamMode::Dutch : GlobalPreferences::ExamMode::Off; + GlobalPreferences::sharedGlobalPreferences()->setExamMode(mode); AppsContainer * container = AppsContainer::sharedAppsContainer(); if (controller->isActivatingExamMode()) { - container->activateExamMode(); + container->activateExamMode(mode); } else { Ion::LED::setColor(KDColorBlack); Ion::LED::updateColorWithPlugAndCharge(); diff --git a/apps/on_boarding/logo_controller.cpp b/apps/on_boarding/logo_controller.cpp index 56aabfb2d..13df87e4d 100644 --- a/apps/on_boarding/logo_controller.cpp +++ b/apps/on_boarding/logo_controller.cpp @@ -49,8 +49,8 @@ void LogoController::viewDidDisappear() { Ion::LED::setColor(m_previousLEDColor); /* TODO: instead of setting again the exam mode, put the previous led color * AND BLINKING.*/ - if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) { // TODO - AppsContainer::sharedAppsContainer()->activateExamMode(); + if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) { + AppsContainer::sharedAppsContainer()->activateExamMode(GlobalPreferences::sharedGlobalPreferences()->examMode()); } } ViewController::viewDidDisappear();