diff --git a/firmware/application/apps/ui_settings.cpp b/firmware/application/apps/ui_settings.cpp index 1e11e9cf..0f384ef1 100644 --- a/firmware/application/apps/ui_settings.cpp +++ b/firmware/application/apps/ui_settings.cpp @@ -41,7 +41,6 @@ using namespace portapack; #include "freqman.hpp" namespace ui { - SetDateTimeView::SetDateTimeView( NavigationView& nav ) { @@ -306,7 +305,6 @@ namespace ui { checkbox_load_app_settings.set_value(persistent_memory::load_app_settings()); checkbox_save_app_settings.set_value(persistent_memory::save_app_settings()); - button_save.on_select = [&nav, this](Button&) { persistent_memory::set_load_app_settings(checkbox_load_app_settings.value()); persistent_memory::set_save_app_settings(checkbox_save_app_settings.value()); @@ -405,6 +403,7 @@ namespace ui { &check_load_mem_at_startup, &button_save_mem_to_file, &button_load_mem_from_file, + &button_load_mem_defaults, &button_return }); @@ -483,6 +482,17 @@ namespace ui { } }; + button_load_mem_defaults.on_select = [&nav, this](Button&) { + nav.push( + "Warning!", + "This will reset the persistent_memory\nand set the default settings", + YESNO, + [this](bool choice) { + if (choice) { + portapack::persistent_memory::cache::defaults(); + } + } ); + }; button_return.on_select = [&nav, this](Button&) { nav.pop(); diff --git a/firmware/application/apps/ui_settings.hpp b/firmware/application/apps/ui_settings.hpp index d252e535..c5c7fee6 100644 --- a/firmware/application/apps/ui_settings.hpp +++ b/firmware/application/apps/ui_settings.hpp @@ -314,7 +314,7 @@ private: 25, "Save app settings" }; - + Button button_save { { 2 * 8, 16 * 16, 12 * 8, 32 }, "Save" @@ -464,15 +464,20 @@ private: }; Button button_save_mem_to_file { - { 0, 9 * 16, 240, 32 }, + { 0, 8 * 16, 240, 32 }, "save p.mem to sdcard" }; Button button_load_mem_from_file { - { 0, 12 * 16, 240, 32 }, + { 0, 10 * 16 + 4 , 240, 32 }, "load p.mem from sdcard" }; - + + Button button_load_mem_defaults { + { 0, 12 * 16 + 8 , 240, 32 }, + "!! reset p.mem, load defaults !!" + }; + Button button_return { { 16 * 8, 16 * 16, 12 * 8, 32 }, "Return",