From b46d9e09eb70ac456e7b455dc45b469a17622363 Mon Sep 17 00:00:00 2001 From: gid9798 <30450294+gid9798@users.noreply.github.com> Date: Sat, 22 Apr 2023 17:42:41 +0300 Subject: [PATCH 1/2] Revert "Fix add manually naming" This reverts commit eb3a4bfa6e4a00625028872e3c34007f708af993. --- applications/main/subghz/scenes/subghz_scene_save_name.c | 4 +--- applications/main/subghz/scenes/subghz_scene_set_type.c | 2 -- applications/main/subghz/subghz.c | 1 - applications/main/subghz/subghz_i.h | 1 - 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/applications/main/subghz/scenes/subghz_scene_save_name.c b/applications/main/subghz/scenes/subghz_scene_save_name.c index 9c58c61ad..3f7658201 100644 --- a/applications/main/subghz/scenes/subghz_scene_save_name.c +++ b/applications/main/subghz/scenes/subghz_scene_save_name.c @@ -62,7 +62,7 @@ void subghz_scene_save_name_on_enter(void* context) { if(subghz->txrx->decoder_result != 0x0) { if(subghz->txrx->decoder_result != NULL) { if(strlen(subghz->txrx->decoder_result->protocol->name) != 0) { - if(subghz->from_add_manually) { + if(strcmp(subghz->txrx->decoder_result->protocol->name, "BinRAW") == 0) { subghz_scene_save_name_get_timefilename(file_name, "S", true); } else { subghz_scene_save_name_get_timefilename( @@ -198,8 +198,6 @@ bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent event) { void subghz_scene_save_name_on_exit(void* context) { SubGhz* subghz = context; - subghz->from_add_manually = false; - // Clear validator void* validator_context = text_input_get_validator_callback_context(subghz->text_input); text_input_set_validator(subghz->text_input, NULL, NULL); diff --git a/applications/main/subghz/scenes/subghz_scene_set_type.c b/applications/main/subghz/scenes/subghz_scene_set_type.c index 95cf96e9c..e871a6439 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_type.c +++ b/applications/main/subghz/scenes/subghz_scene_set_type.c @@ -105,8 +105,6 @@ void subghz_scene_set_type_submenu_callback(void* context, uint32_t index) { void subghz_scene_set_type_on_enter(void* context) { SubGhz* subghz = context; - subghz->from_add_manually = true; - submenu_add_item( subghz->submenu, "Faac SLH 868MHz", diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index 3bd3ef2cc..75c6e627a 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -72,7 +72,6 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { subghz->in_decoder_scene = false; subghz->in_decoder_scene_skip = false; - subghz->from_add_manually = false; // View Dispatcher subghz->view_dispatcher = view_dispatcher_alloc(); diff --git a/applications/main/subghz/subghz_i.h b/applications/main/subghz/subghz_i.h index eeab89791..faae35fa2 100644 --- a/applications/main/subghz/subghz_i.h +++ b/applications/main/subghz/subghz_i.h @@ -127,7 +127,6 @@ struct SubGhz { bool in_decoder_scene; bool in_decoder_scene_skip; - bool from_add_manually; SubGhzDecodeRawState decode_raw_state; SubGhzFileEncoderWorker* decode_raw_file_worker_encoder; From 47ece055925c1dde9e236ae385b8f6f74698c8fe Mon Sep 17 00:00:00 2001 From: gid9798 <30450294+gid9798@users.noreply.github.com> Date: Sat, 22 Apr 2023 19:47:33 +0300 Subject: [PATCH 2/2] using scene_manager`s function --- applications/main/subghz/scenes/subghz_scene_save_name.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/main/subghz/scenes/subghz_scene_save_name.c b/applications/main/subghz/scenes/subghz_scene_save_name.c index 3f7658201..d3f5474be 100644 --- a/applications/main/subghz/scenes/subghz_scene_save_name.c +++ b/applications/main/subghz/scenes/subghz_scene_save_name.c @@ -62,7 +62,8 @@ void subghz_scene_save_name_on_enter(void* context) { if(subghz->txrx->decoder_result != 0x0) { if(subghz->txrx->decoder_result != NULL) { if(strlen(subghz->txrx->decoder_result->protocol->name) != 0) { - if(strcmp(subghz->txrx->decoder_result->protocol->name, "BinRAW") == 0) { + if(scene_manager_has_previous_scene( + subghz->scene_manager, SubGhzSceneSetType)) { subghz_scene_save_name_get_timefilename(file_name, "S", true); } else { subghz_scene_save_name_get_timefilename(