[FL-1307] iButton key files: ASCII encoding and .ibtn extension (#493)

* GUI module submenu: fix documentation
* GUI module submenu: add submenu_set_selected_item fn
* App iButton: use submenu_set_selected_item to store and set selected item in submenu
* App iButton: swap write and emulate in "saved key menu" scene
* App iButton: file select can now switch to the previous selected file
* App iButton: swap write and emulate indexes in "saved key menu" scene
* Gui module file_select: work with separate extension
* iButton app: separate file managment, file error handling
* SD card api: custom error message
* iButton app: better file error handling

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG
2021-05-27 02:50:16 +10:00
committed by GitHub
parent 63e9207c44
commit 7e6a97c3a3
11 changed files with 297 additions and 101 deletions

View File

@@ -55,18 +55,8 @@ bool iButtonSceneDeleteConfirm::on_event(iButtonApp* app, iButtonEvent* event) {
if(event->type == iButtonEvent::Type::EventTypeDialogResult) {
if(event->payload.dialog_result == DialogExResultRight) {
iButtonKey* key = app->get_key();
string_t key_file_name;
string_init_set_str(key_file_name, "ibutton/");
string_cat_str(key_file_name, key->get_name());
bool res =
(app->get_fs_api()->common.remove(string_get_cstr(key_file_name)) == FSE_OK);
string_clear(key_file_name);
if(res) {
if(app->delete_key()) {
app->switch_to_next_scene(iButtonApp::Scene::SceneDeleteSuccess);
} else {
// TODO error file path
// app->switch_to_next_scene(iButtonApp::Scene::SceneDeleteFail);
}
} else {
app->switch_to_previous_scene();