[FL-2432], [FL-2487] Rework bt keys load and save (#1139)

* bt keys: rework load and save with saved_struct
* bt: rename bt keys storage functions
* furi_hal_nfc: allow context switch during emilation
* bt settings: rework with saved struct
* infrared: replace file worker with dialogs and storage
* Core, Loader: fix thread allocation tracking, much better, so wow.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
gornekich
2022-04-21 18:36:53 +03:00
committed by GitHub
parent df66f4f6ba
commit 7c692a9f36
16 changed files with 112 additions and 134 deletions

View File

@@ -1,5 +1,4 @@
#include <gui/modules/dialog_ex.h>
#include <file_worker_cpp.h>
#include <memory>
#include <dolphin/dolphin.h>
@@ -88,13 +87,8 @@ bool InfraredAppSceneLearnSuccess::on_event(InfraredApp* app, InfraredAppEvent*
break;
case DialogExResultRight: {
consumed = true;
FileWorkerCpp file_worker;
if(!button_pressed) {
if(file_worker.check_errors()) {
app->switch_to_next_scene(InfraredApp::Scene::LearnEnterName);
} else {
app->switch_to_previous_scene();
}
app->switch_to_next_scene(InfraredApp::Scene::LearnEnterName);
}
break;
}

View File

@@ -1,12 +1,10 @@
#include "../infrared_app.h"
#include "infrared/infrared_app_event.h"
#include <text_store.h>
#include <file_worker_cpp.h>
void InfraredAppSceneRemoteList::on_enter(InfraredApp* app) {
furi_assert(app);
FileWorkerCpp file_worker;
bool result = false;
bool file_select_result;
auto remote_manager = app->get_remote_manager();
@@ -15,13 +13,15 @@ void InfraredAppSceneRemoteList::on_enter(InfraredApp* app) {
last_selected_remote.size() ? last_selected_remote.c_str() : nullptr;
auto filename_ts =
std::make_unique<TextStore>(InfraredAppRemoteManager::max_remote_name_length);
DialogsApp* dialogs = app->get_dialogs();
InfraredAppViewManager* view_manager = app->get_view_manager();
ButtonMenu* button_menu = view_manager->get_button_menu();
button_menu_reset(button_menu);
view_manager->switch_to(InfraredAppViewManager::ViewId::ButtonMenu);
file_select_result = file_worker.file_select(
file_select_result = dialog_file_select_show(
dialogs,
InfraredApp::infrared_directory,
InfraredApp::infrared_extension,
filename_ts->text,