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

* SubGhz: fix gui "No transition to the "Saved" menu when deleting a SubGHz RAW file"
* SubGhz: remove dead code

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm 2024-06-08 18:45:31 +04:00 committed by GitHub
parent 467e973da2
commit ef0300d239
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 3 deletions

View file

@ -52,6 +52,7 @@ typedef enum {
SubGhzRxKeyStateAddKey,
SubGhzRxKeyStateExit,
SubGhzRxKeyStateRAWLoad,
SubGhzRxKeyStateRAWMore,
SubGhzRxKeyStateRAWSave,
} SubGhzRxKeyState;

View file

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

View file

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