From 8c6be2b389655f3681d6fd1c44f1d554614f2bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Fri, 10 Jan 2020 11:57:52 +0100 Subject: [PATCH] HOTFIX LED COLOR RED --- apps/apps_container.cpp | 9 ++++++--- apps/settings/base.de.i18n | 1 + apps/settings/base.en.i18n | 1 + apps/settings/base.es.i18n | 1 + apps/settings/base.fr.i18n | 1 + apps/settings/base.pt.i18n | 1 + apps/settings/main_controller_prompt_beta.cpp | 4 ++-- apps/settings/main_controller_prompt_none.cpp | 4 ++-- apps/settings/main_controller_prompt_update.cpp | 4 ++-- apps/settings/sub_menu/preferences_controller.cpp | 5 +++++ apps/settings/sub_menu/preferences_controller.h | 2 +- poincare/include/poincare/preferences.h | 9 +++++---- poincare/src/preferences.cpp | 2 +- 13 files changed, 29 insertions(+), 15 deletions(-) diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index f08efd05b5a..53037e734fc 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -368,15 +368,18 @@ void AppsContainer::activateExamMode(GlobalPreferences::ExamMode examMode) { Preferences * preferences = Preferences::sharedPreferences(); switch ((int)preferences->colorOfLED()) { case 0: - Ion::LED::setColor(KDColorWhite); + Ion::LED::setColor(KDColorRed); break; case 1: - Ion::LED::setColor(KDColorGreen); + Ion::LED::setColor(KDColorWhite); break; case 2: - Ion::LED::setColor(KDColorBlue); + Ion::LED::setColor(KDColorGreen); break; case 3: + Ion::LED::setColor(KDColorBlue); + break; + case 4: Ion::LED::setColor(KDColorYellow); break; } diff --git a/apps/settings/base.de.i18n b/apps/settings/base.de.i18n index cf1e413b878..7ed8d71f518 100644 --- a/apps/settings/base.de.i18n +++ b/apps/settings/base.de.i18n @@ -33,6 +33,7 @@ ExamModeMode = "Modus" ExamModeModeStandard = "Standard " ExamModeModeNoSym = "Ohne symbolisch " ExamModeModeDutch = "Niederländisch " +ColorRed = "Rot " ColorWhite = "Weiss " ColorBlue = "Blau " ColorGreen = "Grün " diff --git a/apps/settings/base.en.i18n b/apps/settings/base.en.i18n index 811b3acf28b..709e6f752b1 100644 --- a/apps/settings/base.en.i18n +++ b/apps/settings/base.en.i18n @@ -33,6 +33,7 @@ ExamModeMode = "Mode" ExamModeModeStandard = "Standard " ExamModeModeNoSym = "No sym " ExamModeModeDutch = "Dutch " +ColorRed = "Red " ColorWhite = "White " ColorBlue = "Blue " ColorGreen = "Green " diff --git a/apps/settings/base.es.i18n b/apps/settings/base.es.i18n index 4ecd529aa64..d7378776c69 100644 --- a/apps/settings/base.es.i18n +++ b/apps/settings/base.es.i18n @@ -33,6 +33,7 @@ ExamModeMode = "Modo" ExamModeModeStandard = "Estándar " ExamModeModeNoSym = "Sin simbólico " ExamModeModeDutch = "Holandés " +ColorRed = "Rojo " ColorWhite = "Blanco " ColorBlue = "Azul " ColorGreen = "Verde " diff --git a/apps/settings/base.fr.i18n b/apps/settings/base.fr.i18n index f2c8b0a39aa..a09fbc7265e 100644 --- a/apps/settings/base.fr.i18n +++ b/apps/settings/base.fr.i18n @@ -33,6 +33,7 @@ ExamModeMode = "Mode" ExamModeModeStandard = "Standard " ExamModeModeNoSym = "Sans symbolique " ExamModeModeDutch = "Néerlandais " +ColorRed = "Rouge " ColorWhite = "Blanc " ColorBlue = "Bleu " ColorGreen = "Vert " diff --git a/apps/settings/base.pt.i18n b/apps/settings/base.pt.i18n index 8194baeffcf..45a01416104 100644 --- a/apps/settings/base.pt.i18n +++ b/apps/settings/base.pt.i18n @@ -33,6 +33,7 @@ ExamModeMode = "Modo" ExamModeModeStandard = "Padrão " ExamModeModeNoSym = "Sem simbólico " ExamModeModeDutch = "Holandês " +ColorRed = "Vermelho " ColorWhite = "Branco " ColorBlue = "Azul " ColorGreen = "Verde " diff --git a/apps/settings/main_controller_prompt_beta.cpp b/apps/settings/main_controller_prompt_beta.cpp index 12d153c33e3..03a7e3f6fc4 100644 --- a/apps/settings/main_controller_prompt_beta.cpp +++ b/apps/settings/main_controller_prompt_beta.cpp @@ -4,7 +4,7 @@ namespace Settings { //sub-sub-menus -constexpr SettingsMessageTree s_ledColorChildren[4] = {SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)}; +constexpr SettingsMessageTree s_ledColorChildren[5] = {SettingsMessageTree(I18n::Message::ColorRed), SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)}; constexpr SettingsMessageTree s_examModeMode[3] = {SettingsMessageTree(I18n::Message::ExamModeModeStandard), SettingsMessageTree(I18n::Message::ExamModeModeNoSym), SettingsMessageTree(I18n::Message::ExamModeModeDutch)}; constexpr SettingsMessageTree s_contributorsChildren[7] = {SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::DannySimmons), SettingsMessageTree(I18n::Message::JoachimLeFournis), SettingsMessageTree(I18n::Message::JeanBaptisteBoric), SettingsMessageTree(I18n::Message::MaximeFriess), SettingsMessageTree(I18n::Message::David),SettingsMessageTree(I18n::Message::DamienNicolet)}; constexpr SettingsMessageTree s_modelAngleChildren[3] = {SettingsMessageTree(I18n::Message::Degrees), SettingsMessageTree(I18n::Message::Radian), SettingsMessageTree(I18n::Message::Gradians)}; @@ -15,7 +15,7 @@ constexpr SettingsMessageTree s_symbolChildren[4] = {SettingsMessageTree(I18n::M //sub-menus constexpr SettingsMessageTree s_modelMathOptionsChildren[5] = {SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren, 3), SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren, 4), SettingsMessageTree(I18n::Message::EditionMode, s_modelEditionModeChildren, 2), SettingsMessageTree(I18n::Message::ComplexFormat, s_modelComplexFormatChildren, 3), SettingsMessageTree(I18n::Message::SymbolMultiplication, s_symbolChildren, 4)}; -constexpr SettingsMessageTree s_modelExamChildren[3] = {SettingsMessageTree(I18n::Message::LEDColor, s_ledColorChildren, 4), SettingsMessageTree(I18n::Message::ExamModeMode, s_examModeMode, 3), SettingsMessageTree(I18n::Message::ActivateExamMode)}; +constexpr SettingsMessageTree s_modelExamChildren[3] = {SettingsMessageTree(I18n::Message::LEDColor, s_ledColorChildren, 5), SettingsMessageTree(I18n::Message::ExamModeMode, s_examModeMode, 3), SettingsMessageTree(I18n::Message::ActivateExamMode)}; constexpr SettingsMessageTree s_accessibilityChildren[6] = {SettingsMessageTree(I18n::Message::AccessibilityInvertColors), SettingsMessageTree(I18n::Message::AccessibilityMagnify),SettingsMessageTree(I18n::Message::AccessibilityGamma),SettingsMessageTree(I18n::Message::AccessibilityGammaRed),SettingsMessageTree(I18n::Message::AccessibilityGammaGreen),SettingsMessageTree(I18n::Message::AccessibilityGammaBlue)}; #ifdef USERNAME constexpr SettingsMessageTree s_modelAboutChildren[7] = {SettingsMessageTree(I18n::Message::Username), SettingsMessageTree(I18n::Message::SoftwareVersion), SettingsMessageTree(I18n::Message::CustomSoftwareVersion), SettingsMessageTree(I18n::Message::MicroPythonVersion), SettingsMessageTree(I18n::Message::SerialNumber), SettingsMessageTree(I18n::Message::FccId), SettingsMessageTree(I18n::Message::Contributors, s_contributorsChildren, 7)}; diff --git a/apps/settings/main_controller_prompt_none.cpp b/apps/settings/main_controller_prompt_none.cpp index faf94a896c9..ee577f37f45 100644 --- a/apps/settings/main_controller_prompt_none.cpp +++ b/apps/settings/main_controller_prompt_none.cpp @@ -5,7 +5,7 @@ namespace Settings { // TODO: factorize most parts of the final models with main_controller_prompt_beta and main_controller_prompt_update //sub-sub-menus -constexpr SettingsMessageTree s_ledColorChildren[4] = {SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)}; +constexpr SettingsMessageTree s_ledColorChildren[5] = {SettingsMessageTree(I18n::Message::ColorRed), SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)}; constexpr SettingsMessageTree s_examModeMode[3] = {SettingsMessageTree(I18n::Message::ExamModeModeStandard), SettingsMessageTree(I18n::Message::ExamModeModeNoSym), SettingsMessageTree(I18n::Message::ExamModeModeDutch)}; constexpr SettingsMessageTree s_contributorsChildren[7] = {SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::DannySimmons), SettingsMessageTree(I18n::Message::JoachimLeFournis), SettingsMessageTree(I18n::Message::JeanBaptisteBoric), SettingsMessageTree(I18n::Message::MaximeFriess), SettingsMessageTree(I18n::Message::David),SettingsMessageTree(I18n::Message::DamienNicolet)}; constexpr SettingsMessageTree s_modelAngleChildren[3] = {SettingsMessageTree(I18n::Message::Degrees), SettingsMessageTree(I18n::Message::Radian), SettingsMessageTree(I18n::Message::Gradians)}; @@ -16,7 +16,7 @@ constexpr SettingsMessageTree s_symbolChildren[4] = {SettingsMessageTree(I18n::M //sub-menus constexpr SettingsMessageTree s_modelMathOptionsChildren[5] = {SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren, 3), SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren, 4), SettingsMessageTree(I18n::Message::EditionMode, s_modelEditionModeChildren, 2), SettingsMessageTree(I18n::Message::ComplexFormat, s_modelComplexFormatChildren, 3), SettingsMessageTree(I18n::Message::SymbolMultiplication, s_symbolChildren, 4)}; -constexpr SettingsMessageTree s_modelExamChildren[3] = {SettingsMessageTree(I18n::Message::LEDColor, s_ledColorChildren, 4), SettingsMessageTree(I18n::Message::ExamModeMode, s_examModeMode, 3), SettingsMessageTree(I18n::Message::ActivateExamMode)}; +constexpr SettingsMessageTree s_modelExamChildren[3] = {SettingsMessageTree(I18n::Message::LEDColor, s_ledColorChildren, 5), SettingsMessageTree(I18n::Message::ExamModeMode, s_examModeMode, 3), SettingsMessageTree(I18n::Message::ActivateExamMode)}; constexpr SettingsMessageTree s_accessibilityChildren[6] = {SettingsMessageTree(I18n::Message::AccessibilityInvertColors), SettingsMessageTree(I18n::Message::AccessibilityMagnify),SettingsMessageTree(I18n::Message::AccessibilityGamma),SettingsMessageTree(I18n::Message::AccessibilityGammaRed),SettingsMessageTree(I18n::Message::AccessibilityGammaGreen),SettingsMessageTree(I18n::Message::AccessibilityGammaBlue)}; #ifdef USERNAME constexpr SettingsMessageTree s_modelAboutChildren[7] = {SettingsMessageTree(I18n::Message::Username), SettingsMessageTree(I18n::Message::SoftwareVersion), SettingsMessageTree(I18n::Message::CustomSoftwareVersion), SettingsMessageTree(I18n::Message::MicroPythonVersion), SettingsMessageTree(I18n::Message::SerialNumber), SettingsMessageTree(I18n::Message::FccId), SettingsMessageTree(I18n::Message::Contributors, s_contributorsChildren, 7)}; diff --git a/apps/settings/main_controller_prompt_update.cpp b/apps/settings/main_controller_prompt_update.cpp index 7b68df1a4b6..ae89f74bd1d 100644 --- a/apps/settings/main_controller_prompt_update.cpp +++ b/apps/settings/main_controller_prompt_update.cpp @@ -4,7 +4,7 @@ namespace Settings { //sub-sub-menus -constexpr SettingsMessageTree s_ledColorChildren[4] = {SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)}; +constexpr SettingsMessageTree s_ledColorChildren[5] = {SettingsMessageTree(I18n::Message::ColorRed), SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)}; constexpr SettingsMessageTree s_examModeMode[3] = {SettingsMessageTree(I18n::Message::ExamModeModeStandard), SettingsMessageTree(I18n::Message::ExamModeModeNoSym), SettingsMessageTree(I18n::Message::ExamModeModeDutch)}; constexpr SettingsMessageTree s_contributorsChildren[7] = {SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::DannySimmons), SettingsMessageTree(I18n::Message::JoachimLeFournis), SettingsMessageTree(I18n::Message::JeanBaptisteBoric), SettingsMessageTree(I18n::Message::MaximeFriess), SettingsMessageTree(I18n::Message::David),SettingsMessageTree(I18n::Message::DamienNicolet)}; constexpr SettingsMessageTree s_modelAngleChildren[3] = {SettingsMessageTree(I18n::Message::Degrees), SettingsMessageTree(I18n::Message::Radian), SettingsMessageTree(I18n::Message::Gradians)}; @@ -15,7 +15,7 @@ constexpr SettingsMessageTree s_symbolChildren[4] = {SettingsMessageTree(I18n::M //sub-menus constexpr SettingsMessageTree s_modelMathOptionsChildren[5] = {SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren, 3), SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren, 4), SettingsMessageTree(I18n::Message::EditionMode, s_modelEditionModeChildren, 2), SettingsMessageTree(I18n::Message::ComplexFormat, s_modelComplexFormatChildren, 3), SettingsMessageTree(I18n::Message::SymbolMultiplication, s_symbolChildren, 4)}; -constexpr SettingsMessageTree s_modelExamChildren[3] = {SettingsMessageTree(I18n::Message::LEDColor, s_ledColorChildren, 4), SettingsMessageTree(I18n::Message::ExamModeMode, s_examModeMode, 3), SettingsMessageTree(I18n::Message::ActivateExamMode)}; +constexpr SettingsMessageTree s_modelExamChildren[3] = {SettingsMessageTree(I18n::Message::LEDColor, s_ledColorChildren, 5), SettingsMessageTree(I18n::Message::ExamModeMode, s_examModeMode, 3), SettingsMessageTree(I18n::Message::ActivateExamMode)}; constexpr SettingsMessageTree s_accessibilityChildren[6] = {SettingsMessageTree(I18n::Message::AccessibilityInvertColors), SettingsMessageTree(I18n::Message::AccessibilityMagnify),SettingsMessageTree(I18n::Message::AccessibilityGamma),SettingsMessageTree(I18n::Message::AccessibilityGammaRed),SettingsMessageTree(I18n::Message::AccessibilityGammaGreen),SettingsMessageTree(I18n::Message::AccessibilityGammaBlue)}; #ifdef USERNAME constexpr SettingsMessageTree s_modelAboutChildren[7] = {SettingsMessageTree(I18n::Message::Username), SettingsMessageTree(I18n::Message::SoftwareVersion), SettingsMessageTree(I18n::Message::CustomSoftwareVersion), SettingsMessageTree(I18n::Message::MicroPythonVersion), SettingsMessageTree(I18n::Message::SerialNumber), SettingsMessageTree(I18n::Message::FccId), SettingsMessageTree(I18n::Message::Contributors, s_contributorsChildren, 7)}; diff --git a/apps/settings/sub_menu/preferences_controller.cpp b/apps/settings/sub_menu/preferences_controller.cpp index 62921e49ae2..75312ed832f 100644 --- a/apps/settings/sub_menu/preferences_controller.cpp +++ b/apps/settings/sub_menu/preferences_controller.cpp @@ -108,6 +108,11 @@ Layout PreferencesController::layoutForPreferences(I18n::Message message) { } // LED placeholders + case I18n::Message::ColorRed: + { + const char * text = " "; + return LayoutHelper::String(text, strlen(text), k_layoutFont); + } case I18n::Message::ColorWhite: { const char * text = " "; diff --git a/apps/settings/sub_menu/preferences_controller.h b/apps/settings/sub_menu/preferences_controller.h index 56ea131b63a..83837fc2dbf 100644 --- a/apps/settings/sub_menu/preferences_controller.h +++ b/apps/settings/sub_menu/preferences_controller.h @@ -15,7 +15,7 @@ class PreferencesController : public GenericSubController { void willDisplayCellForIndex(HighlightCell * cell, int index) override; KDCoordinate rowHeight(int j) override; protected: - constexpr static int k_totalNumberOfCell = 4; + constexpr static int k_totalNumberOfCell = 5; private: constexpr static const KDFont * k_layoutFont = KDFont::SmallFont; int initialSelectedRow() const override { return valueIndexForPreference(m_messageTreeModel->label()); } diff --git a/poincare/include/poincare/preferences.h b/poincare/include/poincare/preferences.h index 95505cf55a4..26821e04d78 100644 --- a/poincare/include/poincare/preferences.h +++ b/poincare/include/poincare/preferences.h @@ -37,10 +37,11 @@ class Preferences final { Gradian = 2 }; enum class LEDColor : uint8_t { - White = 0, - Green = 1, - Blue = 2, - Yellow = 3 + Red = 0, + White = 1, + Green = 2, + Blue = 3, + Yellow = 4 }; enum class SymbolMultiplication : uint8_t { Cross = 0, diff --git a/poincare/src/preferences.cpp b/poincare/src/preferences.cpp index 4cdb0613f45..2fcbc4797c3 100644 --- a/poincare/src/preferences.cpp +++ b/poincare/src/preferences.cpp @@ -13,7 +13,7 @@ Preferences::Preferences() : m_editionMode(EditionMode::Edition2D), m_complexFormat(Preferences::ComplexFormat::Real), m_numberOfSignificantDigits(PrintFloat::k_numberOfPrintedSignificantDigits), - m_colorOfLED(Preferences::LEDColor::White), + m_colorOfLED(Preferences::LEDColor::Red), m_symbolMultiplication(Preferences::SymbolMultiplication::Auto) {}