Loader: Warn about missing SD card for main apps (#3875)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
WillyJL 2024-09-06 11:43:07 +02:00 committed by GitHub
parent 4fd76524c9
commit 6a1c27ef93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);