Add Backup & Reset sub-page with factory reset (developer feature)

Moves the previously standalone "Backup settings"/"Restore settings"
buttons out of the System menu into a new "Backup & Reset" sub-page
(replaced in the System menu by a single folder button, placed
directly above "Info"), and adds a third entry "Reset settings" - a
factory reset for developers/testers that deletes the entire
Flightradar folder from the SD card (settings, logbook, location
presets, WiFi, calibration - everything) and restarts the device. The
next boot picks up isFirstRun automatically (via the missing
SD_SETTINGS_FILE) and runs the full first-time setup again, exactly
like on the very first boot - no need to pull the SD card.

Since this is irreversible, it requires a full-screen red warning
confirmation first, reusing the same overlay previously built only for
the flight-logbook enable warning (confirmLogbookEnable() generalized
to confirmWarningScreen(), taking title/body StringIds as parameters).

New SdStorage::deleteDirectoryRecursive() and
SettingsBackup::factoryReset() implement the actual deletion + restart.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Eiswolf-BG
2026-08-12 05:34:22 +02:00
parent 3c12b7bdfb
commit 9d2930bd8b
12 changed files with 219 additions and 26 deletions

View File

@@ -282,6 +282,21 @@ enum class StringId : uint8_t {
// Hoehen-Farbstufen erscheinen.
LEGEND_GROUND_VEHICLE,
// Neue "Sicherung & Reset"-Unterseite im System-Menue (fasst die
// bisher einzeln im System-Menue stehenden Backup/Restore-Buttons
// zusammen und ergaenzt einen dritten Punkt "Einstellungen
// zuruecksetzen" - ein kompletter Werksreset fuer Entwickler/Tester,
// der den gesamten Flightradar-Ordner von der SD-Karte loescht und
// neu startet, siehe settings_backup.cpp::factoryReset()). Titel und
// Button-Label teilen sich MENU_BACKUP_RESET, genau wie
// MENU_CATEGORY_SYSTEM sowohl fuer den Menue-Button als auch den
// Bildschirmtitel der System-Seite verwendet wird.
MENU_BACKUP_RESET,
MENU_FACTORY_RESET,
MENU_FACTORY_RESET_WARNING_BODY,
MENU_FACTORY_RESET_DELETING,
MENU_FACTORY_RESET_FAILED,
COUNT
};