From 545ed79444a63134ebeaa13bdbf94da9f99adc48 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 22 Aug 2019 14:40:59 -0400 Subject: [PATCH] Add the LED color switch to exam_pop_up_controller. --- apps/exam_pop_up_controller.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/exam_pop_up_controller.cpp b/apps/exam_pop_up_controller.cpp index 2bb8e08d1..dd93a0b4e 100644 --- a/apps/exam_pop_up_controller.cpp +++ b/apps/exam_pop_up_controller.cpp @@ -3,6 +3,9 @@ #include #include "global_preferences.h" #include +#include + +using namespace Poincare; ExamPopUpController::ExamPopUpController(ExamPopUpControllerDelegate * delegate) : ViewController(nullptr), @@ -56,10 +59,24 @@ ExamPopUpController::ContentView::ContentView(Responder * parentResponder) : ExamPopUpController * controller = (ExamPopUpController *)context; GlobalPreferences::ExamMode nextExamMode = controller->isActivatingExamMode() ? GlobalPreferences::ExamMode::Activate : GlobalPreferences::ExamMode::Deactivate; GlobalPreferences::sharedGlobalPreferences()->setExamMode(nextExamMode); + Preferences * preferences = Preferences::sharedPreferences(); AppsContainer * container = (AppsContainer *)controller->app()->container(); if (controller->isActivatingExamMode()) { container->reset(); - Ion::LED::setColor(KDColorBlue); + switch ((int)preferences->colorOfLED()) { + case 0: + Ion::LED::setColor(KDColorWhite); + break; + case 1: + Ion::LED::setColor(KDColorGreen); + break; + case 2: + Ion::LED::setColor(KDColorBlue); + break; + case 3: + Ion::LED::setColor(KDColorYellow); + break; + } Ion::LED::setBlinking(1000, 0.1f); } else { Ion::LED::setColor(KDColorBlack);