Loader: Warn about missing SD card for main apps --nobuild

This commit is contained in:
Willy-JL
2024-09-05 17:50:36 +02:00
parent d80fbbfc9c
commit 3e3ce725ab
2 changed files with 14 additions and 3 deletions

View File

@@ -11,4 +11,5 @@
- RFID: - RFID:
- OFW: Fix detection of GProx II cards and false detection of other cards (by @Astrrra) - OFW: Fix detection of GProx II cards and false detection of other cards (by @Astrrra)
- OFW: Fix Guard GProxII False Positive and 36-bit Parsing (by @zinongli) - OFW: Fix Guard GProxII False Positive and 36-bit Parsing (by @zinongli)
- Loader: Warn about missing SD card for main apps (by @Willy-JL)
- OFW: NFC: Fix crash on Ultralight unlock (by @Astrrra) - OFW: NFC: Fix crash on Ultralight unlock (by @Astrrra)

View File

@@ -103,10 +103,20 @@ static void loader_show_gui_error(
if(status.value == LoaderStatusErrorUnknownApp && if(status.value == LoaderStatusErrorUnknownApp &&
loader_find_external_application_by_name(name, NULL) != NULL) { loader_find_external_application_by_name(name, NULL) != NULL) {
// Special case for external apps // 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_icon(message, &I_WarningDolphinFlip_45x42, 83, 22);
dialog_message_set_text( dialog_message_set_text(message, text, 3, 26, AlignLeft, AlignTop);
message, "Update firmware\nto run this app", 3, 26, AlignLeft, AlignTop);
dialog_message_show(dialogs, message); dialog_message_show(dialogs, message);
} else if(status.value == LoaderStatusErrorUnknownApp) { } else if(status.value == LoaderStatusErrorUnknownApp) {
loader_dialog_prepare_and_show(dialogs, &err_app_not_found); loader_dialog_prepare_and_show(dialogs, &err_app_not_found);