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:
parent
7a3a1aaf0d
commit
111c7557b3
@ -33,7 +33,8 @@ void infrared_scene_universal_on_enter(void* context) {
|
||||
SubmenuIndexUniversalAC,
|
||||
infrared_scene_universal_submenu_callback,
|
||||
context);
|
||||
submenu_set_selected_item(submenu, 0);
|
||||
submenu_set_selected_item(
|
||||
submenu, scene_manager_get_scene_state(infrared->scene_manager, InfraredSceneUniversal));
|
||||
|
||||
view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewSubmenu);
|
||||
}
|
||||
@ -54,6 +55,7 @@ bool infrared_scene_universal_on_event(void* context, SceneManagerEvent event) {
|
||||
scene_manager_next_scene(scene_manager, InfraredSceneUniversalAudio);
|
||||
consumed = true;
|
||||
}
|
||||
scene_manager_set_scene_state(scene_manager, InfraredSceneUniversal, event.event);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
@ -47,21 +47,28 @@ bool lfrfid_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubmenuIndexRead) {
|
||||
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneStart, SubmenuIndexRead);
|
||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
||||
DOLPHIN_DEED(DolphinDeedRfidRead);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexSaved) {
|
||||
// Like in the other apps, explicitly save the scene state
|
||||
// in each branch in case the user cancels loading a file.
|
||||
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneStart, SubmenuIndexSaved);
|
||||
furi_string_set(app->file_path, LFRFID_APP_FOLDER);
|
||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneSelectKey);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexAddManually) {
|
||||
scene_manager_set_scene_state(
|
||||
app->scene_manager, LfRfidSceneStart, SubmenuIndexAddManually);
|
||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneSaveType);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexExtraActions) {
|
||||
scene_manager_set_scene_state(
|
||||
app->scene_manager, LfRfidSceneStart, SubmenuIndexExtraActions);
|
||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneExtraActions);
|
||||
consumed = true;
|
||||
}
|
||||
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneStart, event.event);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -31,7 +31,10 @@ bool subghz_scene_delete_success_on_event(void* context, SceneManagerEvent event
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
||||
} else if(scene_manager_search_and_switch_to_previous_scene(
|
||||
subghz->scene_manager, SubGhzSceneSaved)) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaved);
|
||||
// Commented so that the user doesn't have to press
|
||||
// back twice to get to the main SubGhz menu after
|
||||
// deleting a file.
|
||||
//scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaved);
|
||||
} else {
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
subghz->scene_manager, SubGhzSceneStart);
|
||||
|
@ -136,9 +136,9 @@ void nfc_magic_free(NfcMagic* nfc_magic) {
|
||||
free(nfc_magic);
|
||||
}
|
||||
|
||||
static const NotificationSequence nfc_magic_sequence_blink_start_blue = {
|
||||
static const NotificationSequence nfc_magic_sequence_blink_start_cyan = {
|
||||
&message_blink_start_10,
|
||||
&message_blink_set_color_blue,
|
||||
&message_blink_set_color_cyan,
|
||||
&message_do_not_reset,
|
||||
NULL,
|
||||
};
|
||||
@ -149,7 +149,7 @@ static const NotificationSequence nfc_magic_sequence_blink_stop = {
|
||||
};
|
||||
|
||||
void nfc_magic_blink_start(NfcMagic* nfc_magic) {
|
||||
notification_message(nfc_magic->notifications, &nfc_magic_sequence_blink_start_blue);
|
||||
notification_message(nfc_magic->notifications, &nfc_magic_sequence_blink_start_cyan);
|
||||
}
|
||||
|
||||
void nfc_magic_blink_stop(NfcMagic* nfc_magic) {
|
||||
|
@ -40,16 +40,24 @@ bool nfc_magic_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubmenuIndexCheck) {
|
||||
scene_manager_set_scene_state(
|
||||
nfc_magic->scene_manager, NfcMagicSceneStart, SubmenuIndexCheck);
|
||||
scene_manager_next_scene(nfc_magic->scene_manager, NfcMagicSceneCheck);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexWriteGen1A) {
|
||||
// Explicitly save state in each branch so that the
|
||||
// correct option is reselected if the user cancels
|
||||
// loading a file.
|
||||
scene_manager_set_scene_state(
|
||||
nfc_magic->scene_manager, NfcMagicSceneStart, SubmenuIndexWriteGen1A);
|
||||
scene_manager_next_scene(nfc_magic->scene_manager, NfcMagicSceneFileSelect);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexWipe) {
|
||||
scene_manager_set_scene_state(
|
||||
nfc_magic->scene_manager, NfcMagicSceneStart, SubmenuIndexWipe);
|
||||
scene_manager_next_scene(nfc_magic->scene_manager, NfcMagicSceneWipe);
|
||||
consumed = true;
|
||||
}
|
||||
scene_manager_set_scene_state(nfc_magic->scene_manager, NfcMagicSceneStart, event.event);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
@ -137,9 +137,9 @@ void picopass_text_store_clear(Picopass* picopass) {
|
||||
memset(picopass->text_store, 0, sizeof(picopass->text_store));
|
||||
}
|
||||
|
||||
static const NotificationSequence picopass_sequence_blink_start_blue = {
|
||||
static const NotificationSequence picopass_sequence_blink_start_cyan = {
|
||||
&message_blink_start_10,
|
||||
&message_blink_set_color_blue,
|
||||
&message_blink_set_color_cyan,
|
||||
&message_do_not_reset,
|
||||
NULL,
|
||||
};
|
||||
@ -150,7 +150,7 @@ static const NotificationSequence picopass_sequence_blink_stop = {
|
||||
};
|
||||
|
||||
void picopass_blink_start(Picopass* picopass) {
|
||||
notification_message(picopass->notifications, &picopass_sequence_blink_start_blue);
|
||||
notification_message(picopass->notifications, &picopass_sequence_blink_start_cyan);
|
||||
}
|
||||
|
||||
void picopass_blink_stop(Picopass* picopass) {
|
||||
|
@ -32,13 +32,18 @@ bool picopass_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubmenuIndexRead) {
|
||||
scene_manager_set_scene_state(
|
||||
picopass->scene_manager, PicopassSceneStart, SubmenuIndexRead);
|
||||
scene_manager_next_scene(picopass->scene_manager, PicopassSceneReadCard);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexSaved) {
|
||||
// Explicitly save state so that the correct item is
|
||||
// reselected if the user cancels loading a file.
|
||||
scene_manager_set_scene_state(
|
||||
picopass->scene_manager, PicopassSceneStart, SubmenuIndexSaved);
|
||||
scene_manager_next_scene(picopass->scene_manager, PicopassSceneFileSelect);
|
||||
consumed = true;
|
||||
}
|
||||
scene_manager_set_scene_state(picopass->scene_manager, PicopassSceneStart, event.event);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
Loading…
Reference in New Issue
Block a user