Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
04e6eb2
feat(Archive): Adds multiple file selection
956MB Dec 20, 2024
12de157
single newline format
956MB Dec 20, 2024
4afb86b
Added file list widget to delete screen
956MB Dec 22, 2024
f5592ca
Changed is_dir to Icon in FileListItem
956MB Dec 28, 2024
9f4a562
Clock: 12 hour midnight format
956MB Jan 1, 2025
4ea485a
Asset Packs: Warning for RAM usage
956MB Jan 5, 2025
cb51d40
Based on file list widget changes in #344
956MB Jan 5, 2025
6ee3228
fix: scroll_counter eval order causing scroll to stop
956MB Jan 7, 2025
1213f61
fix: align warning text to the center
956MB Jan 8, 2025
81d647f
Main Menu: Adds info toggles to PS4/Vertical/MNTM
956MB Jan 15, 2025
c3f93d1
fix: allow deselect of all children in unselected folder
956MB Jan 16, 2025
ee3d352
Fix: Move midnight format setting out of furi_rtc
956MB Jan 22, 2025
7d58294
Merge branch 'dev' into feat/midnight-clock-format
956MB Jan 22, 2025
dc30a2b
clock app external
956MB Jan 22, 2025
921d76f
Merge branch 'feat/midnight-clock-format' into feat/menu-more-info
956MB Jan 22, 2025
dcb7b4e
Merge remote-tracking branch '956MB:feat/archive-select-multiple' int…
956MB Jan 2, 2026
28680ab
Merge remote-tracking branch '956MB:feat/asset-packs-ram-warning' int…
956MB Jan 2, 2026
2c46d2f
Merge remote-tracking branch '956MB:feat/menu-more-info' into 956/prs…
956MB Jan 2, 2026
5f94d52
Merge remote-tracking branch '956MB:fix/custom-font-bubble-acsent' in…
956MB Mar 16, 2025
7e47619
Exclude a few SubGHz protocols to save flash space
956MB Jan 2, 2026
69b7184
Fix half merge of '956MB:feat/archive-select-multiple'
956MB Jan 6, 2026
8d94ef9
Merge remote-tracking branch 'mntm/dev' into 956/prs
956MB Jan 22, 2026
de008d7
Merge remote-tracking branch 'mntm/dev' into 956/prs
956MB Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/workflows/lint.yml

This file was deleted.

68 changes: 68 additions & 0 deletions applications/main/archive/helpers/archive_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,28 @@ static void
break;
}
}
furi_string_free(selected);
}

if(model->item_idx < 0) {
model->item_idx = 0;
}
}

// Files lose their selected stateafter re entering, so we need to restore them
if(model->select_mode && model->selected_count > 0) {
for(size_t i = 0; i < files_array_size(model->files); i++) {
ArchiveFile_t* file = files_array_get(model->files, i);
file->selected = false;
for(size_t j = 0; j < model->selected_count; j++) {
if(furi_string_cmp(model->selected_files[j], file->path) == 0) {
file->selected = true;
break;
}
}
}
}

if(archive_is_file_list_load_required(model)) {
model->list_loading = true;
load_again = true;
Expand Down Expand Up @@ -141,6 +157,28 @@ void archive_file_browser_set_path(
browser->override_home_path = override_home_path;
}

bool archive_is_parent_or_identical(const char* path_a, const char* path_b) {
size_t len_a = strlen(path_a);
return (
strncmp(path_b, path_a, len_a) == 0 && (path_b[len_a] == '/' || path_b[len_a] == '\0'));
}

bool archive_is_nested_path(const char* dst_path, char** clipboard_paths, size_t clipboard_count) {
if(!dst_path || !clipboard_paths) {
return false;
}

for(size_t i = 0; i < clipboard_count; i++) {
if(!clipboard_paths[i]) continue;
const char* src_path = clipboard_paths[i];
if(archive_is_parent_or_identical(src_path, dst_path) && strcmp(src_path, dst_path) != 0) {
return true;
}
}

return false;
}

bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx) {
size_t array_size = files_array_size(model->files);

Expand Down Expand Up @@ -695,3 +733,33 @@ void archive_refresh_dir(ArchiveBrowserView* browser) {
file_browser_worker_folder_refresh_sel(browser->worker, furi_string_get_cstr(str));
furi_string_free(str);
}

void archive_clear_selection(ArchiveBrowserViewModel* model) {
model->select_mode = false;
for(size_t i = 0; i < model->selected_count; i++) {
furi_string_free(model->selected_files[i]);
}
free(model->selected_files);
model->selected_files = NULL;
model->selected_count = 0;

for(size_t i = 0; i < files_array_size(model->files); i++) {
ArchiveFile_t* file = files_array_get(model->files, i);
file->selected = false;
}
}

void archive_deselect_children(ArchiveBrowserViewModel* model, const char* parent) {
size_t write_idx = 0;
for(size_t i = 0; i < model->selected_count; i++) {
if(!furi_string_start_with(model->selected_files[i], parent)) {
if(write_idx != i) {
model->selected_files[write_idx] = model->selected_files[i];
}
write_idx++;
} else {
furi_string_free(model->selected_files[i]);
}
}
model->selected_count = write_idx;
}
5 changes: 5 additions & 0 deletions applications/main/archive/helpers/archive_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ void archive_file_browser_set_path(
bool skip_assets,
bool hide_dot_files,
const char* override_home_path);
bool archive_is_parent_or_identical(const char* path_a, const char* path_b);
bool archive_is_nested_path(const char* dst_path, char** clipboard_paths, size_t clipboard_count);
bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx);
bool archive_is_file_list_load_required(ArchiveBrowserViewModel* model);
void archive_update_offset(ArchiveBrowserView* browser);
Expand Down Expand Up @@ -120,3 +122,6 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key);
void archive_enter_dir(ArchiveBrowserView* browser, FuriString* name);
void archive_leave_dir(ArchiveBrowserView* browser);
void archive_refresh_dir(ArchiveBrowserView* browser);

void archive_clear_selection(ArchiveBrowserViewModel* model);
void archive_deselect_children(ArchiveBrowserViewModel* model, const char* parent);
4 changes: 4 additions & 0 deletions applications/main/archive/helpers/archive_files.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ typedef struct {
FuriString* custom_name;
bool fav;
bool is_app;
bool selected;
} ArchiveFile_t;

static void ArchiveFile_t_init(ArchiveFile_t* obj) {
Expand All @@ -53,6 +54,7 @@ static void ArchiveFile_t_init(ArchiveFile_t* obj) {
obj->custom_name = furi_string_alloc();
obj->fav = false;
obj->is_app = false;
obj->selected = false;
}

static void ArchiveFile_t_init_set(ArchiveFile_t* obj, const ArchiveFile_t* src) {
Expand All @@ -67,6 +69,7 @@ static void ArchiveFile_t_init_set(ArchiveFile_t* obj, const ArchiveFile_t* src)
obj->custom_name = furi_string_alloc_set(src->custom_name);
obj->fav = src->fav;
obj->is_app = src->is_app;
obj->selected = false;
}

static void ArchiveFile_t_set(ArchiveFile_t* obj, const ArchiveFile_t* src) {
Expand All @@ -81,6 +84,7 @@ static void ArchiveFile_t_set(ArchiveFile_t* obj, const ArchiveFile_t* src) {
furi_string_set(obj->custom_name, src->custom_name);
obj->fav = src->fav;
obj->is_app = src->is_app;
obj->selected = false;
}

static void ArchiveFile_t_clear(ArchiveFile_t* obj) {
Expand Down
Loading