Fix minor UI inconsistencies and bugs (#2361)
* Changed blue LED to cyan in NFC Magic and Picopass apps. * Fix capitalization of ATQA and UID in NFC Add Manually wizard. * Fix reselection of "Saved" menu item in NFC and RFID apps. * Fix double back press after deleting a file in the SubGhz browser. * Make NFC app behave like other apps: return to the file browser after deleting a file. * Rename NfcSceneSetAtqua to NfcSceneSetAtqa. * Save selected menu items in NFC Magic and Picopass apps in a way that always works. * Restore previous selection in Universal Remotes menu. * Other way to do universal remote menu saving, and NFC Extra Actions saves last selection. Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@ ADD_SCENE(nfc, saved_menu, SavedMenu)
|
||||
ADD_SCENE(nfc, extra_actions, ExtraActions)
|
||||
ADD_SCENE(nfc, set_type, SetType)
|
||||
ADD_SCENE(nfc, set_sak, SetSak)
|
||||
ADD_SCENE(nfc, set_atqa, SetAtqua)
|
||||
ADD_SCENE(nfc, set_atqa, SetAtqa)
|
||||
ADD_SCENE(nfc, set_uid, SetUid)
|
||||
ADD_SCENE(nfc, generate_info, GenerateInfo)
|
||||
ADD_SCENE(nfc, read_card_success, ReadCardSuccess)
|
||||
|
@@ -30,7 +30,7 @@ bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent event) {
|
||||
nfc->scene_manager, NfcSceneMfClassicKeys);
|
||||
} else {
|
||||
consumed = scene_manager_search_and_switch_to_previous_scene(
|
||||
nfc->scene_manager, NfcSceneStart);
|
||||
nfc->scene_manager, NfcSceneFileSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,6 +34,8 @@ void nfc_scene_extra_actions_on_enter(void* context) {
|
||||
SubmenuIndexMfUltralightUnlock,
|
||||
nfc_scene_extra_actions_submenu_callback,
|
||||
nfc);
|
||||
submenu_set_selected_item(
|
||||
submenu, scene_manager_get_scene_state(nfc->scene_manager, NfcSceneExtraActions));
|
||||
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,7 @@ void nfc_scene_set_atqa_on_enter(void* context) {
|
||||
|
||||
// Setup view
|
||||
ByteInput* byte_input = nfc->byte_input;
|
||||
byte_input_set_header_text(byte_input, "Enter atqa in hex");
|
||||
byte_input_set_header_text(byte_input, "Enter ATQA in hex");
|
||||
byte_input_set_result_callback(
|
||||
byte_input,
|
||||
nfc_scene_set_atqa_byte_input_callback,
|
||||
|
@@ -28,7 +28,7 @@ bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == NfcCustomEventByteInputDone) {
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneSetAtqua);
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneSetAtqa);
|
||||
consumed = true;
|
||||
}
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ void nfc_scene_set_uid_on_enter(void* context) {
|
||||
|
||||
// Setup view
|
||||
ByteInput* byte_input = nfc->byte_input;
|
||||
byte_input_set_header_text(byte_input, "Enter uid in hex");
|
||||
byte_input_set_header_text(byte_input, "Enter UID in hex");
|
||||
nfc->dev_edit_data = nfc->dev->dev_data.nfc_data;
|
||||
byte_input_set_result_callback(
|
||||
byte_input,
|
||||
|
@@ -48,11 +48,14 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubmenuIndexRead) {
|
||||
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexRead);
|
||||
nfc->dev->dev_data.read_mode = NfcReadModeAuto;
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneRead);
|
||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexDetectReader) {
|
||||
scene_manager_set_scene_state(
|
||||
nfc->scene_manager, NfcSceneStart, SubmenuIndexDetectReader);
|
||||
bool sd_exist = storage_sd_status(nfc->dev->storage) == FSE_OK;
|
||||
if(sd_exist) {
|
||||
nfc_device_data_clear(&nfc->dev->dev_data);
|
||||
@@ -63,19 +66,27 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
}
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexSaved) {
|
||||
// Save the scene state explicitly in each branch, so that
|
||||
// if the user cancels loading a file, the Saved menu item
|
||||
// is properly reselected.
|
||||
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexSaved);
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneFileSelect);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexExtraAction) {
|
||||
scene_manager_set_scene_state(
|
||||
nfc->scene_manager, NfcSceneStart, SubmenuIndexExtraAction);
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneExtraActions);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexAddManually) {
|
||||
scene_manager_set_scene_state(
|
||||
nfc->scene_manager, NfcSceneStart, SubmenuIndexAddManually);
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneSetType);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexDebug) {
|
||||
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexDebug);
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneDebug);
|
||||
consumed = true;
|
||||
}
|
||||
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, event.event);
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
Reference in New Issue
Block a user