diff --git a/applications/main/archive/helpers/archive_browser.h b/applications/main/archive/helpers/archive_browser.h index c2d4c59f8..1b39e9c72 100644 --- a/applications/main/archive/helpers/archive_browser.h +++ b/applications/main/archive/helpers/archive_browser.h @@ -27,6 +27,9 @@ static const char* known_ext[] = { [ArchiveFileTypeSubGhz] = ".sub", [ArchiveFileTypeLFRFID] = ".rfid", [ArchiveFileTypeInfrared] = ".ir", + [ArchiveFileTypeSubghzPlaylist] = ".txt", + [ArchiveFileTypeSubghzRemote] = ".txt", + [ArchiveFileTypeInfraredRemote] = ".txt", [ArchiveFileTypeBadKb] = ".txt", [ArchiveFileTypeU2f] = "?", [ArchiveFileTypeApplication] = ".fap", diff --git a/applications/main/archive/helpers/archive_files.c b/applications/main/archive/helpers/archive_files.c index f4c97fe47..cabb8f899 100644 --- a/applications/main/archive/helpers/archive_files.c +++ b/applications/main/archive/helpers/archive_files.c @@ -1,6 +1,9 @@ #include "archive_files.h" #include "archive_apps.h" #include "archive_browser.h" +#include +#include +#include #define TAG "Archive" @@ -16,11 +19,26 @@ void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder for(size_t i = 0; i < COUNT_OF(known_ext); i++) { if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue; if(furi_string_search(file->path, known_ext[i], 0) != FURI_STRING_FAILURE) { - if(i == ArchiveFileTypeBadKb) { - if(furi_string_search(file->path, archive_get_default_path(ArchiveTabBadKb)) == - 0) { + // Check for .txt containing folder + if(strcmp(known_ext[i], ".txt") == 0) { + const char* path = NULL; + switch(i) { + case ArchiveFileTypeSubghzPlaylist: + path = PLAYLIST_FOLDER; + break; + case ArchiveFileTypeSubghzRemote: + path = SUBREM_APP_FOLDER; + break; + case ArchiveFileTypeInfraredRemote: + path = IR_REMOTE_PATH; + break; + case ArchiveFileTypeBadKb: + path = archive_get_default_path(ArchiveTabBadKb); + break; + } + if(path != NULL && furi_string_search(file->path, path) == 0) { file->type = i; - return; // *.txt file is a BadKB script only if it is in BadKB folder + return; } } else { file->type = i; diff --git a/applications/main/archive/helpers/archive_files.h b/applications/main/archive/helpers/archive_files.h index ff74121d7..eccf731c5 100644 --- a/applications/main/archive/helpers/archive_files.h +++ b/applications/main/archive/helpers/archive_files.h @@ -15,6 +15,9 @@ typedef enum { ArchiveFileTypeSubGhz, ArchiveFileTypeLFRFID, ArchiveFileTypeInfrared, + ArchiveFileTypeSubghzPlaylist, + ArchiveFileTypeSubghzRemote, + ArchiveFileTypeInfraredRemote, ArchiveFileTypeBadKb, ArchiveFileTypeU2f, ArchiveFileTypeApplication, diff --git a/applications/main/archive/scenes/archive_scene_browser.c b/applications/main/archive/scenes/archive_scene_browser.c index c09b3705a..aa95737b5 100644 --- a/applications/main/archive/scenes/archive_scene_browser.c +++ b/applications/main/archive/scenes/archive_scene_browser.c @@ -23,6 +23,12 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) { return "RFID"; case ArchiveFileTypeInfrared: return "Infrared"; + case ArchiveFileTypeSubghzPlaylist: + return EXT_PATH("apps/Sub-Ghz/subghz_playlist.fap"); + case ArchiveFileTypeSubghzRemote: + return EXT_PATH("apps/Sub-Ghz/subghz_remote.fap"); + case ArchiveFileTypeInfraredRemote: + return EXT_PATH("apps/Tools/ir_remote.fap"); case ArchiveFileTypeBadKb: return "Bad KB"; case ArchiveFileTypeU2f: diff --git a/applications/main/archive/views/archive_browser_view.c b/applications/main/archive/views/archive_browser_view.c index f3a586cee..e0caa9494 100644 --- a/applications/main/archive/views/archive_browser_view.c +++ b/applications/main/archive/views/archive_browser_view.c @@ -29,6 +29,9 @@ static const Icon* ArchiveItemIcons[] = { [ArchiveFileTypeSubGhz] = &I_sub1_10px, [ArchiveFileTypeLFRFID] = &I_125_10px, [ArchiveFileTypeInfrared] = &I_ir_10px, + [ArchiveFileTypeSubghzPlaylist] = &I_subplaylist_10px, + [ArchiveFileTypeSubghzRemote] = &I_subrem_10px, + [ArchiveFileTypeInfraredRemote] = &I_ir_scope_10px, [ArchiveFileTypeBadKb] = &I_badkb_10px, [ArchiveFileTypeU2f] = &I_u2f_10px, [ArchiveFileTypeApplication] = &I_Apps_10px, diff --git a/assets/icons/Archive/ir_scope_10px.png b/assets/icons/Archive/ir_scope_10px.png new file mode 100644 index 000000000..c0d7eaba0 Binary files /dev/null and b/assets/icons/Archive/ir_scope_10px.png differ diff --git a/assets/icons/Archive/subplaylist_10px.png b/assets/icons/Archive/subplaylist_10px.png new file mode 100644 index 000000000..3d3f1d27f Binary files /dev/null and b/assets/icons/Archive/subplaylist_10px.png differ diff --git a/firmware/targets/f7/api_symbols.csv b/firmware/targets/f7/api_symbols.csv index daa9a7448..b7b141ced 100644 --- a/firmware/targets/f7/api_symbols.csv +++ b/firmware/targets/f7/api_symbols.csv @@ -3456,6 +3456,7 @@ Variable,+,I_iButtonDolphinVerySuccess_108x52,Icon, Variable,+,I_iButtonKey_49x44,Icon, Variable,+,I_ibutt_10px,Icon, Variable,+,I_ir_10px,Icon, +Variable,+,I_ir_scope_10px,Icon, Variable,+,I_keyboard_10px,Icon, Variable,+,I_loading_10px,Icon, Variable,+,I_music_10px,Icon, @@ -3464,6 +3465,7 @@ Variable,+,I_passport_bad_46x49,Icon, Variable,+,I_passport_happy_46x49,Icon, Variable,+,I_passport_okay_46x49,Icon, Variable,+,I_sub1_10px,Icon, +Variable,+,I_subplaylist_10px,Icon, Variable,+,I_subrem_10px,Icon, Variable,+,I_u2f_10px,Icon, Variable,+,I_unknown_10px,Icon,