Skip to content

Commit

Permalink
Adds back debugging + Adds folder exist check
Browse files Browse the repository at this point in the history
  • Loading branch information
acegoal07 committed Apr 2, 2024
1 parent 4b245e1 commit fdcdd56
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
17 changes: 17 additions & 0 deletions nfc_playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ static NfcPlaylist* nfc_playlist_alloc() {
view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileSelect, file_browser_get_view(nfc_playlist->file_browser));
view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_FileEdit, submenu_get_view(nfc_playlist->submenu));
view_dispatcher_add_view(nfc_playlist->view_dispatcher, NfcPlaylistView_TextInput, text_input_get_view(nfc_playlist->text_input));

Storage* storage = furi_record_open(RECORD_STORAGE);
if (!storage_common_exists(storage, "/ext/apps_data/nfc_playlist")) {
storage_common_mkdir(storage, "/ext/apps_data/nfc_playlist");
}
furi_record_close(RECORD_STORAGE);

return nfc_playlist;
}

Expand All @@ -103,11 +110,21 @@ static void nfc_playlist_free(NfcPlaylist* nfc_playlist) {
free(nfc_playlist);
}

void nfc_playlist_set_log_level() {
#ifdef FURI_DEBUG
furi_log_set_level(FuriLogLevelTrace);
#else
furi_log_set_level(FuriLogLevelInfo);
#endif
}

int32_t nfc_playlist_main(void* p) {
UNUSED(p);

NfcPlaylist* nfc_playlist = nfc_playlist_alloc();

nfc_playlist_set_log_level();

Gui* gui = furi_record_open(RECORD_GUI);
view_dispatcher_attach_to_gui(nfc_playlist->view_dispatcher, gui, ViewDispatcherTypeFullscreen);
scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_MainMenu);
Expand Down
7 changes: 2 additions & 5 deletions scences/file_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

typedef enum {
NfcPlaylistMenuSelection_DeletePlaylist,
NfcPlaylistMenuSelection_RenamePlaylist,
NfcPlaylistMenuSelection_EditList
NfcPlaylistMenuSelection_RenamePlaylist
} NfcPlaylistMenuSelection;

void nfc_playlist_file_edit_menu_callback(void* context, uint32_t index) {
Expand All @@ -23,11 +22,9 @@ void nfc_playlist_file_edit_menu_callback(void* context, uint32_t index) {
scene_manager_next_scene(nfc_playlist->scene_manager, NfcPlaylistScene_TextInput);
break;
}
case NfcPlaylistMenuSelection_EditList: {
default: {
break;
}
default:
break;
}
furi_record_close(RECORD_STORAGE);
}
Expand Down

0 comments on commit fdcdd56

Please sign in to comment.