[FL-2168] SubGhz: fix auto highlight name when saving RAW (#984)

This commit is contained in:
Skorpionm 2022-02-08 22:41:10 +04:00 committed by GitHub
parent 3f6deecdae
commit b71f3c6323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -3,6 +3,7 @@
typedef enum {
SubghzCustomEventManagerNoSet = 0,
SubghzCustomEventManagerSet,
SubghzCustomEventManagerSetRAW,
SubghzCustomEventSceneDeleteSuccess = 100,
SubghzCustomEventSceneDelete,

View File

@ -261,7 +261,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
case SubghzCustomEventViewReadRAWSave:
if(subghz_scene_read_raw_update_filename(subghz)) {
scene_manager_set_scene_state(
subghz->scene_manager, SubGhzSceneReadRAW, SubghzCustomEventManagerSet);
subghz->scene_manager, SubGhzSceneReadRAW, SubghzCustomEventManagerSetRAW);
subghz->txrx->rx_key_state = SubGhzRxKeyStateBack;
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
}

View File

@ -23,9 +23,13 @@ void subghz_scene_save_name_on_enter(void* context) {
dev_name_empty = true;
} else {
strcpy(subghz->file_name_tmp, subghz->file_name);
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) ==
SubghzCustomEventManagerSet) {
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) !=
SubghzCustomEventManagerNoSet) {
subghz_get_next_name_file(subghz);
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) ==
SubghzCustomEventManagerSetRAW) {
dev_name_empty = true;
}
}
}
@ -62,8 +66,8 @@ bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent event) {
subghz_save_protocol_to_file(subghz, subghz->file_name);
}
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) ==
SubghzCustomEventManagerSet) {
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) !=
SubghzCustomEventManagerNoSet) {
subghz_protocol_raw_set_last_file_name(
(SubGhzProtocolRAW*)subghz->txrx->protocol_result, subghz->file_name);
scene_manager_set_scene_state(