Bläddra i källkod

Update Toggles and Translations

Alex Voinea 5 år sedan
förälder
incheckning
2e0034d915
3 ändrade filer med 20 tillägg och 11 borttagningar
  1. 7 0
      Firmware/messages.c
  2. 7 0
      Firmware/messages.h
  3. 6 11
      Firmware/ultralcd.cpp

+ 7 - 0
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"; ////

+ 7 - 0
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[];

+ 6 - 11
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();
 }