Skip to content

Commit

Permalink
HOTFIX LED COLOR RED
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Jan 14, 2020
1 parent a08a46d commit 8c6be2b
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 15 deletions.
9 changes: 6 additions & 3 deletions apps/apps_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions apps/settings/base.de.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ExamModeMode = "Modus"
ExamModeModeStandard = "Standard "
ExamModeModeNoSym = "Ohne symbolisch "
ExamModeModeDutch = "Niederländisch "
ColorRed = "Rot "
ColorWhite = "Weiss "
ColorBlue = "Blau "
ColorGreen = "Grün "
Expand Down
1 change: 1 addition & 0 deletions apps/settings/base.en.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ExamModeMode = "Mode"
ExamModeModeStandard = "Standard "
ExamModeModeNoSym = "No sym "
ExamModeModeDutch = "Dutch "
ColorRed = "Red "
ColorWhite = "White "
ColorBlue = "Blue "
ColorGreen = "Green "
Expand Down
1 change: 1 addition & 0 deletions apps/settings/base.es.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ExamModeMode = "Modo"
ExamModeModeStandard = "Estándar "
ExamModeModeNoSym = "Sin simbólico "
ExamModeModeDutch = "Holandés "
ColorRed = "Rojo "
ColorWhite = "Blanco "
ColorBlue = "Azul "
ColorGreen = "Verde "
Expand Down
1 change: 1 addition & 0 deletions apps/settings/base.fr.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ExamModeMode = "Mode"
ExamModeModeStandard = "Standard "
ExamModeModeNoSym = "Sans symbolique "
ExamModeModeDutch = "Néerlandais "
ColorRed = "Rouge "
ColorWhite = "Blanc "
ColorBlue = "Bleu "
ColorGreen = "Vert "
Expand Down
1 change: 1 addition & 0 deletions apps/settings/base.pt.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ExamModeMode = "Modo"
ExamModeModeStandard = "Padrão "
ExamModeModeNoSym = "Sem simbólico "
ExamModeModeDutch = "Holandês "
ColorRed = "Vermelho "
ColorWhite = "Branco "
ColorBlue = "Azul "
ColorGreen = "Verde "
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/main_controller_prompt_beta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand All @@ -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)};
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/main_controller_prompt_none.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand All @@ -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)};
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/main_controller_prompt_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand All @@ -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)};
Expand Down
5 changes: 5 additions & 0 deletions apps/settings/sub_menu/preferences_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = " ";
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/sub_menu/preferences_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()); }
Expand Down
9 changes: 5 additions & 4 deletions poincare/include/poincare/preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion poincare/src/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{}

Expand Down

0 comments on commit 8c6be2b

Please sign in to comment.