Merge remote-tracking branch 'pablohc/refactor/pr-1258-cover-overlay' into mybuild

# Conflicts:
#	lib/I18n/translations/english.yaml
#	scripts/gen_i18n.py
#	src/CrossPointSettings.h
#	src/SettingsList.h
#	src/activities/boot_sleep/SleepActivity.cpp
#	src/activities/boot_sleep/SleepActivity.h
This commit is contained in:
jpirnay
2026-03-30 16:12:00 +02:00
10 changed files with 41730 additions and 478 deletions
+13
View File
@@ -143,6 +143,19 @@ bool JsonSettingsIO::loadSettings(CrossPointSettings& s, const char* json, bool*
applyLegacyStatusBarSettings(s);
}
// Legacy migration: sleepCoverOverlay was a Toggle (0=off, 1=on). Now it's a 4-way Enum:
// {WHITE(0), GRAY(1), BLACK(2), OFF(3)}. Translate old values before the generic loop clamps.
if (!doc["sleepCoverOverlay"].isNull()) {
uint8_t legacyOverlay = doc["sleepCoverOverlay"] | (uint8_t)0;
if (legacyOverlay == 0) {
s.sleepCoverOverlay = 3; // OFF
doc["sleepCoverOverlay"] = 3;
if (needsResave) *needsResave = true;
} else if (legacyOverlay == 1) {
s.sleepCoverOverlay = 1; // GRAY (old "on" = gray dither)
}
}
for (const auto& info : getSettingsList()) {
if (!info.key) continue;
// Dynamic entries (KOReader etc.) are stored in their own files — skip.