From 59efb79001d28228ddf1989e4c20598ca8a3339c Mon Sep 17 00:00:00 2001 From: Dawid Wojtas Date: Fri, 1 Dec 2023 16:07:39 +0100 Subject: [PATCH] [BH-1731] Factory reset removes user files Performing the factory reset removes user files and settings. After powering on the device will run the onboarding. --- harmony_changelog.md | 1 + image/system_a/data/lang/Deutsch.json | 4 +- image/system_a/data/lang/English.json | 4 +- image/system_a/data/lang/Espanol.json | 4 +- image/system_a/data/lang/Francais.json | 4 +- image/system_a/data/lang/Polski.json | 4 +- .../apps-common/options/OptionsList.cpp | 5 +- .../apps-common/options/OptionsList.hpp | 5 +- .../ApplicationBellMain.cpp | 3 +- .../ApplicationBellSettings.cpp | 13 +- .../application-bell-settings/CMakeLists.txt | 1 + .../ApplicationBellSettings.hpp | 1 - .../BellSettingsFactoryResetWindow.cpp | 52 ++++++++ .../BellSettingsFactoryResetWindow.hpp | 22 ++++ .../windows/BellSettingsWindow.cpp | 25 +--- .../BellHybrid/apps/common/CMakeLists.txt | 3 + .../common/BellFactoryResetPresenter.hpp | 20 +++ .../BellOptionWithDescriptionWindow.hpp | 28 +++++ .../common/src/BellFactoryResetPresenter.cpp | 23 ++++ .../BellOptionWithDescriptionWindow.cpp | 114 ++++++++++++++++++ .../common/src/windows/BellFactoryReset.cpp | 4 +- scripts/lua/factory.lua | 6 + scripts/lua/share/paths.lua | 1 + 23 files changed, 305 insertions(+), 42 deletions(-) create mode 100644 products/BellHybrid/apps/application-bell-settings/windows/BellSettingsFactoryResetWindow.cpp create mode 100644 products/BellHybrid/apps/application-bell-settings/windows/BellSettingsFactoryResetWindow.hpp create mode 100644 products/BellHybrid/apps/common/include/common/BellFactoryResetPresenter.hpp create mode 100644 products/BellHybrid/apps/common/include/common/options/BellOptionWithDescriptionWindow.hpp create mode 100644 products/BellHybrid/apps/common/src/BellFactoryResetPresenter.cpp create mode 100644 products/BellHybrid/apps/common/src/options/BellOptionWithDescriptionWindow.cpp diff --git a/harmony_changelog.md b/harmony_changelog.md index 86a5c181bc8f865b6519fda4e925c5074f7689dc..7fcd781ac9665de728cd35af2896522bf92b0665 100644 --- a/harmony_changelog.md +++ b/harmony_changelog.md @@ -17,6 +17,7 @@ * Disabled Address Sanitizer for the Linux simulator * Changed misleading factory reset translations in Polish * Time setting updated +* Factory reset removes user files ## [2.2.3 2023-11-30] diff --git a/image/system_a/data/lang/Deutsch.json b/image/system_a/data/lang/Deutsch.json index f17c5feef89831a591368ce52cb046d4762074c4..37113d95548867d50b89d76aaaa5fd28ef57bdcc 100644 --- a/image/system_a/data/lang/Deutsch.json +++ b/image/system_a/data/lang/Deutsch.json @@ -92,7 +92,9 @@ "app_bell_settings_bedtime_settings_tone": "Klang", "app_bell_settings_bedtime_settings_volume": "Lautst\u00e4rke", "app_bell_settings_bedtime_tone": "Schlafens-Klang", - "app_bell_settings_display_factory_reset_confirmation": "Zur\u00fccksetzen?", + "app_bell_settings_display_factory_reset_confirmation": "Factory reset will delete all
users files and return
Harmony to factory settings
", + "app_bell_settings_factory_reset_option_reset": "Reset", + "app_bell_settings_factory_reset_option_back": "Back", "app_bell_settings_factory_reset": "Zur\u00fccksetzen", "app_bell_settings_frontlight": "Frontlicht", "app_bell_settings_frontlight_mode_auto": "automatisch", diff --git a/image/system_a/data/lang/English.json b/image/system_a/data/lang/English.json index 7fc33c44760ebf1578497aa76e06e20748169748..1c8bec26cd900a973d63006083392c2906adf87b 100644 --- a/image/system_a/data/lang/English.json +++ b/image/system_a/data/lang/English.json @@ -126,7 +126,9 @@ "app_bell_settings_bedtime_settings_tone": "Bedtime tone", "app_bell_settings_bedtime_settings_volume": "Bedtime tone
volume
", "app_bell_settings_bedtime_tone": "Bedtime tone", - "app_bell_settings_display_factory_reset_confirmation": "Reset to factory

settings ?
", + "app_bell_settings_display_factory_reset_confirmation": "Factory reset will delete all
users files and return
Harmony to factory settings
", + "app_bell_settings_factory_reset_option_reset": "Reset", + "app_bell_settings_factory_reset_option_back": "Back", "app_bell_settings_factory_reset": "Factory reset", "app_bell_settings_frontlight": "Frontlight", "app_bell_settings_frontlight_mode_auto": "auto", diff --git a/image/system_a/data/lang/Espanol.json b/image/system_a/data/lang/Espanol.json index a81cb59ef42cf9943fcccdc1b74acf90ccc4ac58..2c8aa34782fa7b565eab61a4c92864549173cb5c 100644 --- a/image/system_a/data/lang/Espanol.json +++ b/image/system_a/data/lang/Espanol.json @@ -91,7 +91,9 @@ "app_bell_settings_bedtime_settings_tone": "Hora de dormir", "app_bell_settings_bedtime_settings_volume": "Volumen", "app_bell_settings_bedtime_tone": "Hora de dormir", - "app_bell_settings_display_factory_reset_confirmation": "\u00bfRestablecer la configuraci\u00f3n?", + "app_bell_settings_display_factory_reset_confirmation": "Factory reset will delete all
users files and return
Harmony to factory settings
", + "app_bell_settings_factory_reset_option_reset": "Reset", + "app_bell_settings_factory_reset_option_back": "Back", "app_bell_settings_factory_reset": "Restablecer", "app_bell_settings_frontlight": "Luz frontal", "app_bell_settings_frontlight_mode_auto": "autom\u00e1tico", diff --git a/image/system_a/data/lang/Francais.json b/image/system_a/data/lang/Francais.json index c6547198ab4105df144d81c8860377b52f647e8d..6d09f0738d45bba43b3a1c0ebb28a91a84e27a03 100644 --- a/image/system_a/data/lang/Francais.json +++ b/image/system_a/data/lang/Francais.json @@ -93,7 +93,9 @@ "app_bell_settings_bedtime_settings_tone": "M\u00e9lodie de l'heure du coucher", "app_bell_settings_bedtime_settings_volume": "Volume", "app_bell_settings_bedtime_tone": "Heure du coucher", - "app_bell_settings_display_factory_reset_confirmation": "R\u00e9tablir

la configuration ?
", + "app_bell_settings_display_factory_reset_confirmation": "Factory reset will delete all
users files and return
Harmony to factory settings
", + "app_bell_settings_factory_reset_option_reset": "Reset", + "app_bell_settings_factory_reset_option_back": "Back", "app_bell_settings_factory_reset": "R\u00e9initialisation", "app_bell_settings_frontlight": "Lumi\u00e8re", "app_bell_settings_frontlight_mode_auto": "automatique", diff --git a/image/system_a/data/lang/Polski.json b/image/system_a/data/lang/Polski.json index cd8e2410c144ea02db5b999d7337d8240f399ca0..c0eb70bed3923e894c0c5bbbfefc0fc20eabdfc8 100644 --- a/image/system_a/data/lang/Polski.json +++ b/image/system_a/data/lang/Polski.json @@ -92,7 +92,9 @@ "app_bell_settings_bedtime_settings_tone": "D\u017awi\u0119k", "app_bell_settings_bedtime_settings_volume": "G\u0142o\u015bno\u015b\u0107", "app_bell_settings_bedtime_tone": "Pora snu", - "app_bell_settings_display_factory_reset_confirmation": "Przywrócić ustawienia fabryczne?", + "app_bell_settings_display_factory_reset_confirmation": "Factory reset will delete all
users files and return
Harmony to factory settings
", + "app_bell_settings_factory_reset_option_reset": "Reset", + "app_bell_settings_factory_reset_option_back": "Back", "app_bell_settings_factory_reset": "Ustaw. fabryczne", "app_bell_settings_frontlight": "Pod\u015bwietlenie", "app_bell_settings_frontlight_mode_auto": "automatyczny", diff --git a/module-apps/apps-common/options/OptionsList.cpp b/module-apps/apps-common/options/OptionsList.cpp index ff0f038e8eff6e9ab6ce7f945f6c682f717e9ad2..e1730a3ed28fae469a25709202d4d271e6a6e068 100644 --- a/module-apps/apps-common/options/OptionsList.cpp +++ b/module-apps/apps-common/options/OptionsList.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "OptionsList.hpp" @@ -60,4 +60,7 @@ namespace gui optionsModel->clearData(); } + template class OptionsList; + template class OptionsList; + } // namespace gui diff --git a/module-apps/apps-common/options/OptionsList.hpp b/module-apps/apps-common/options/OptionsList.hpp index 96a99fc9f0a6634d9ca0b2fbac5a782edcabeb7d..174ea7a2f159edc922b5410841915ce0f47c1661 100644 --- a/module-apps/apps-common/options/OptionsList.hpp +++ b/module-apps/apps-common/options/OptionsList.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #pragma once @@ -29,7 +29,4 @@ namespace gui void refreshOptions(std::list