Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-3840] SubGhz: fix gui "No transition to the "Saved" menu when deleting a SubGHz RAW file" #3695

Merged
merged 3 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions applications/main/subghz/helpers/subghz_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ typedef enum {
SubGhzRxKeyStateAddKey,
SubGhzRxKeyStateExit,
SubGhzRxKeyStateRAWLoad,
SubGhzRxKeyStateRAWMore,
SubGhzRxKeyStateRAWSave,
} SubGhzRxKeyState;

Expand Down
8 changes: 7 additions & 1 deletion applications/main/subghz/scenes/subghz_scene_delete_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ bool subghz_scene_delete_raw_on_event(void* context, SceneManagerEvent event) {
if(event.event == SubGhzCustomEventSceneDeleteRAW) {
furi_string_set(subghz->file_path_tmp, subghz->file_path);
if(subghz_delete_file(subghz)) {
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneDeleteSuccess);
if(subghz_rx_key_state_get(subghz) != SubGhzRxKeyStateRAWLoad) {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneDeleteSuccess);
} else {
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaved);
}

} else {
scene_manager_search_and_switch_to_previous_scene(
subghz->scene_manager, SubGhzSceneStart);
Expand Down
8 changes: 6 additions & 2 deletions applications/main/subghz/scenes/subghz_scene_read_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void subghz_scene_read_raw_on_enter(void* context) {
subghz->subghz_read_raw, SubGhzReadRAWStatusIDLE, "", threshold_rssi);
break;
case SubGhzRxKeyStateRAWLoad:
case SubGhzRxKeyStateRAWMore:
path_extract_filename(subghz->file_path, file_name, true);
subghz_read_raw_set_status(
subghz->subghz_read_raw,
Expand All @@ -98,7 +99,8 @@ void subghz_scene_read_raw_on_enter(void* context) {
break;
}

if(subghz_rx_key_state_get(subghz) != SubGhzRxKeyStateBack) {
if((subghz_rx_key_state_get(subghz) != SubGhzRxKeyStateBack) &&
(subghz_rx_key_state_get(subghz) != SubGhzRxKeyStateRAWLoad)) {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
}
furi_string_free(file_name);
Expand Down Expand Up @@ -177,7 +179,9 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
if(subghz_scene_read_raw_update_filename(subghz)) {
scene_manager_set_scene_state(
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSet);
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateRAWLoad);
if(subghz_rx_key_state_get(subghz) != SubGhzRxKeyStateRAWLoad) {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateRAWMore);
}
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneMoreRAW);
consumed = true;
} else {
Expand Down
Loading