Skip to content

Commit

Permalink
Loader: Warn about missing SD card for main apps (#3875)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <[email protected]>
  • Loading branch information
Willy-JL and skotopes authored Sep 6, 2024
1 parent 4fd7652 commit 6a1c27e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions applications/services/loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,20 @@ static void loader_show_gui_error(
if(status.value == LoaderStatusErrorUnknownApp &&
loader_find_external_application_by_name(name) != NULL) {
// Special case for external apps
dialog_message_set_header(message, "Update needed", 64, 3, AlignCenter, AlignTop);
const char* header = NULL;
const char* text = NULL;
Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_sd_status(storage) == FSE_OK) {
header = "Update needed";
text = "Update firmware\nto run this app";
} else {
header = "SD card needed";
text = "Install SD card\nto run this app";
}
furi_record_close(RECORD_STORAGE);
dialog_message_set_header(message, header, 64, 3, AlignCenter, AlignTop);
dialog_message_set_icon(message, &I_WarningDolphinFlip_45x42, 83, 22);
dialog_message_set_text(
message, "Update firmware\nto run this app", 3, 26, AlignLeft, AlignTop);
dialog_message_set_text(message, text, 3, 26, AlignLeft, AlignTop);
dialog_message_show(dialogs, message);
} else if(status.value == LoaderStatusErrorUnknownApp) {
loader_dialog_prepare_and_show(dialogs, &err_app_not_found);
Expand Down

0 comments on commit 6a1c27e

Please sign in to comment.