From 2e0034d915b073d11807eb815e63a7c4374cd9c7 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Sun, 17 Nov 2019 09:53:14 +0200 Subject: [PATCH] Update Toggles and Translations --- Firmware/messages.c | 7 +++++++ Firmware/messages.h | 7 +++++++ Firmware/ultralcd.cpp | 17 ++++++----------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Firmware/messages.c b/Firmware/messages.c index f38c2939..9d878f6e 100644 --- a/Firmware/messages.c +++ b/Firmware/messages.c @@ -128,6 +128,13 @@ const char MSG_SOUND_BLIND[] PROGMEM_I1 = ISTR("Assist"); //// const char MSG_MESH[] PROGMEM_I1 = ISTR("Mesh"); //// const char MSG_Z_PROBE_NR[] PROGMEM_I1 = ISTR("Z-probe nr."); //// const char MSG_MAGNETS_COMP[] PROGMEM_I1 = ISTR("Magnets comp."); //// +const char MSG_BRIGHTNESS[] PROGMEM_I1 = ISTR("Brightness"); //// +const char MSG_BL_HIGH[] PROGMEM_I1 = ISTR("Level Bright"); //// +const char MSG_BL_LOW[] PROGMEM_I1 = ISTR("Level Dimmed"); //// +const char MSG_TIMEOUT[] PROGMEM_I1 = ISTR("Timeout"); //// +const char MSG_BRIGHT[] PROGMEM_I1 = ISTR("Bright"); //// +const char MSG_DIM[] PROGMEM_I1 = ISTR("Dim"); //// +const char MSG_AUTO[] PROGMEM_I1 = ISTR("Auto"); //// //not internationalized messages const char MSG_SD_WORKDIR_FAIL[] PROGMEM_N1 = "workDir open failed"; //// diff --git a/Firmware/messages.h b/Firmware/messages.h index 30671533..4de5c7cf 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -128,6 +128,13 @@ extern const char MSG_SOUND_BLIND[]; extern const char MSG_MESH[]; extern const char MSG_Z_PROBE_NR[]; extern const char MSG_MAGNETS_COMP[]; +extern const char MSG_BRIGHTNESS[]; +extern const char MSG_BL_HIGH[]; +extern const char MSG_BL_LOW[]; +extern const char MSG_TIMEOUT[]; +extern const char MSG_BRIGHT[]; +extern const char MSG_DIM[]; +extern const char MSG_AUTO[]; //not internationalized messages extern const char MSG_BROWNOUT_RESET[]; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 1c2be1ac..0a721cfd 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5787,7 +5787,7 @@ static void lcd_settings_menu() #ifdef LCD_BL_PIN if (backlightSupport) { - MENU_ITEM_SUBMENU_P(_i("Brightness"), lcd_backlight_menu); + MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN @@ -7113,7 +7113,7 @@ static void lcd_tune_menu() #ifdef LCD_BL_PIN if (backlightSupport) { - MENU_ITEM_SUBMENU_P(_i("Brightness"), lcd_backlight_menu); + MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); @@ -7186,15 +7186,10 @@ static void lcd_backlight_menu() ); MENU_ITEM_BACK_P(_T(MSG_BACK)); - MENU_ITEM_EDIT_int3_P(_i("Level Bright"), &backlightLevel_HIGH, backlightLevel_LOW, 255); - MENU_ITEM_EDIT_int3_P(_i("Level Dimmed"), &backlightLevel_LOW, 0, backlightLevel_HIGH); - switch (backlightMode) - { - case BACKLIGHT_MODE_BRIGHT: MENU_ITEM_FUNCTION_P(_i("Mode [Bright]"), backlight_mode_toggle); break; - case BACKLIGHT_MODE_DIM: MENU_ITEM_FUNCTION_P(_i("Mode [Dim]"), backlight_mode_toggle); break; - default: MENU_ITEM_FUNCTION_P(_i("Mode [Auto]"), backlight_mode_toggle); break; - } - MENU_ITEM_EDIT_int3_P(_i("Timeout"), &backlightTimer_period, 1, 999); + MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); + MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); + MENU_ITEM_TOGGLE_P(_T(MSG_MODE), ((backlightMode==BACKLIGHT_MODE_BRIGHT) ? _T(MSG_BRIGHT) : ((backlightMode==BACKLIGHT_MODE_DIM) ? _T(MSG_DIM) : _T(MSG_AUTO))), backlight_mode_toggle); + MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); MENU_END(); }