mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-30 09:37:53 -04:00
moved pmem setting restore before top bar is loaded (#1105)
* moved pmem setting restore before top bar is loaded * added a check pmem from sdcard function, replaced occurences, added a save to file on back button * Added defines for flag file and dump file, changed test func name to should_use_sdcard_for_pmem, used file_exists, removed save and load pmem parameter * changed a text to a more comprehesible one
This commit is contained in:
parent
e3e179e380
commit
7e8a139732
5 changed files with 31 additions and 30 deletions
|
@ -126,6 +126,10 @@ SystemStatusView::SystemStatusView(
|
|||
&sd_card_status_view,
|
||||
});
|
||||
|
||||
if (portapack::persistent_memory::should_use_sdcard_for_pmem()) {
|
||||
portapack::persistent_memory::load_persistent_settings_from_file();
|
||||
}
|
||||
|
||||
if (portapack::persistent_memory::config_speaker())
|
||||
button_speaker.hidden(false);
|
||||
else
|
||||
|
@ -156,6 +160,9 @@ SystemStatusView::SystemStatusView(
|
|||
refresh();
|
||||
|
||||
button_back.on_select = [this](ImageButton&) {
|
||||
if (portapack::persistent_memory::should_use_sdcard_for_pmem()) {
|
||||
portapack::persistent_memory::save_persistent_settings_to_file();
|
||||
}
|
||||
if (this->on_back)
|
||||
this->on_back();
|
||||
};
|
||||
|
@ -692,13 +699,6 @@ SystemView::SystemView(
|
|||
|
||||
navigation_view.push<SystemMenuView>();
|
||||
|
||||
File pmem_flag_file_handle;
|
||||
std::string pmem_flag_file = "/SETTINGS/PMEM_FILEFLAG";
|
||||
auto result = pmem_flag_file_handle.open(pmem_flag_file);
|
||||
if (!result.is_valid()) {
|
||||
portapack::persistent_memory::load_persistent_settings_from_file("SETTINGS/pmem_settings");
|
||||
}
|
||||
|
||||
if (portapack::persistent_memory::config_splash()) {
|
||||
navigation_view.push<BMPView>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue