[FL-2491] File browser GUI module (#1237)

* File browser module and test app
* nfc: Add support for saved files in subdirectories
* nfc: Use helper function to get shadow path when loading data
* File browser dialog integration pt.1
* File browser dialog integration pt.2
* Gui,Dialogs: drop file select
* Correct use of dynamic string_t(string_ptr)

Co-authored-by: Yukai Li <yukaili.geek@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-05-27 14:19:21 +03:00
committed by GitHub
parent 533f12af15
commit 79920a3522
82 changed files with 2025 additions and 1007 deletions

View File

@@ -1,4 +1,6 @@
#include "../ibutton_i.h"
#include "m-string.h"
#include "toolbox/path.h"
typedef enum {
iButtonSceneWriteStateDefault,
@@ -17,13 +19,18 @@ void ibutton_scene_write_on_enter(void* context) {
iButtonWorker* worker = ibutton->key_worker;
const uint8_t* key_data = ibutton_key_get_data_p(key);
const char* key_name = ibutton_key_get_name_p(key);
string_t key_name;
string_init(key_name);
if(string_end_with_str_p(ibutton->file_path, IBUTTON_APP_EXTENSION)) {
path_extract_filename(ibutton->file_path, key_name, true);
}
uint8_t line_count = 2;
// check that stored key has name
if(strcmp(key_name, "") != 0) {
ibutton_text_store_set(ibutton, "writing\n%s", key_name);
if(!string_empty_p(key_name)) {
ibutton_text_store_set(ibutton, "writing\n%s", string_get_cstr(key_name));
line_count = 2;
} else {
// if not, show key data
@@ -79,6 +86,8 @@ void ibutton_scene_write_on_enter(void* context) {
ibutton_worker_write_set_callback(worker, ibutton_scene_write_callback, ibutton);
ibutton_worker_write_start(worker, key);
string_clear(key_name);
}
bool ibutton_scene_write_on_event(void* context, SceneManagerEvent event) {