diff --git a/applications/subghz/helpers/subghz_custom_event.h b/applications/subghz/helpers/subghz_custom_event.h index ad70be7e..a2e5ee3e 100644 --- a/applications/subghz/helpers/subghz_custom_event.h +++ b/applications/subghz/helpers/subghz_custom_event.h @@ -5,6 +5,26 @@ typedef enum { SubGhzCustomEventManagerSet, SubGhzCustomEventManagerSetRAW, + //SubmenuIndex + SubmenuIndexPricenton, + SubmenuIndexNiceFlo12bit, + SubmenuIndexNiceFlo24bit, + SubmenuIndexCAME12bit, + SubmenuIndexCAME24bit, + SubmenuIndexCAMETwee, + SubmenuIndexNeroSketch, + SubmenuIndexNeroRadio, + SubmenuIndexGateTX, + SubmenuIndexDoorHan_315_00, + SubmenuIndexDoorHan_433_92, + SubmenuIndexLinear_300_00, + SubmenuIndexLiftMaster_315_00, + SubmenuIndexLiftMaster_390_00, + SubmenuIndexSecPlus_v2_310_00, + SubmenuIndexSecPlus_v2_315_00, + SubmenuIndexSecPlus_v2_390_00, + + //SubGhzCustomEvent SubGhzCustomEventSceneDeleteSuccess = 100, SubGhzCustomEventSceneDelete, SubGhzCustomEventSceneDeleteRAW, diff --git a/applications/subghz/scenes/subghz_scene_delete_success.c b/applications/subghz/scenes/subghz_scene_delete_success.c index d5b3ec2d..d6e1f8dd 100644 --- a/applications/subghz/scenes/subghz_scene_delete_success.c +++ b/applications/subghz/scenes/subghz_scene_delete_success.c @@ -26,9 +26,15 @@ bool subghz_scene_delete_success_on_event(void* context, SceneManagerEvent event if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubGhzCustomEventSceneDeleteSuccess) { - if(!scene_manager_search_and_switch_to_previous_scene( - subghz->scene_manager, SubGhzSceneSaved)) { + if(scene_manager_search_and_switch_to_previous_scene( + subghz->scene_manager, SubGhzSceneReadRAW)) { + 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); + } else { + scene_manager_search_and_switch_to_previous_scene( + subghz->scene_manager, SubGhzSceneStart); } return true; } diff --git a/applications/subghz/scenes/subghz_scene_read_raw.c b/applications/subghz/scenes/subghz_scene_read_raw.c index ae3abd6a..97a07140 100644 --- a/applications/subghz/scenes/subghz_scene_read_raw.c +++ b/applications/subghz/scenes/subghz_scene_read_raw.c @@ -167,11 +167,13 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) { break; case SubGhzCustomEventViewReadRAWErase: - subghz->txrx->rx_key_state = SubGhzRxKeyStateIDLE; - if(subghz_scene_read_raw_update_filename(subghz)) { - string_set(subghz->file_path_tmp, subghz->file_path); - subghz_delete_file(subghz); + if(subghz->txrx->rx_key_state == SubGhzRxKeyStateAddKey) { + if(subghz_scene_read_raw_update_filename(subghz)) { + string_set(subghz->file_path_tmp, subghz->file_path); + subghz_delete_file(subghz); + } } + subghz->txrx->rx_key_state = SubGhzRxKeyStateIDLE; notification_message(subghz->notifications, &sequence_reset_rgb); return true; break; diff --git a/applications/subghz/scenes/subghz_scene_set_type.c b/applications/subghz/scenes/subghz_scene_set_type.c index a6f0c3ea..a7a4491e 100644 --- a/applications/subghz/scenes/subghz_scene_set_type.c +++ b/applications/subghz/scenes/subghz_scene_set_type.c @@ -10,26 +10,6 @@ #define TAG "SubGhzSetType" -enum SubmenuIndex { - SubmenuIndexPricenton, - SubmenuIndexNiceFlo12bit, - SubmenuIndexNiceFlo24bit, - SubmenuIndexCAME12bit, - SubmenuIndexCAME24bit, - SubmenuIndexCAMETwee, - SubmenuIndexNeroSketch, - SubmenuIndexNeroRadio, - SubmenuIndexGateTX, - SubmenuIndexDoorHan_315_00, - SubmenuIndexDoorHan_433_92, - SubmenuIndexLinear_300_00, - SubmenuIndexLiftMaster_315_00, - SubmenuIndexLiftMaster_390_00, - SubmenuIndexSecPlus_v2_310_00, - SubmenuIndexSecPlus_v2_315_00, - SubmenuIndexSecPlus_v2_390_00, -}; - bool subghz_scene_set_type_submenu_gen_data_protocol( void* context, const char* protocol_name,