From 018f9f639084324c23d7a85d6c08dd32eb22c4e8 Mon Sep 17 00:00:00 2001 From: Eric Betts Date: Sun, 25 Aug 2024 15:45:51 -0700 Subject: [PATCH] Move parse from card menu to card read success --- scenes/seader_scene_card_menu.c | 19 ------------------- scenes/seader_scene_read_card_success.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/scenes/seader_scene_card_menu.c b/scenes/seader_scene_card_menu.c index 1097dbf647e..594e58d7d7d 100644 --- a/scenes/seader_scene_card_menu.c +++ b/scenes/seader_scene_card_menu.c @@ -1,7 +1,6 @@ #include "../seader_i.h" enum SubmenuIndex { - SubmenuIndexParse, SubmenuIndexSave, SubmenuIndexSavePicopass, SubmenuIndexSaveRFID, @@ -18,21 +17,8 @@ void seader_scene_card_menu_submenu_callback(void* context, uint32_t index) { void seader_scene_card_menu_on_enter(void* context) { Seader* seader = context; SeaderCredential* credential = seader->credential; - PluginWiegand* plugin = seader->plugin_wiegand; Submenu* submenu = seader->submenu; - if(plugin) { - size_t format_count = plugin->count(credential->bit_length, credential->credential); - if(format_count > 0) { - submenu_add_item( - submenu, - "Parse", - SubmenuIndexParse, - seader_scene_card_menu_submenu_callback, - seader); - } - } - submenu_add_item( submenu, "Save", SubmenuIndexSave, seader_scene_card_menu_submenu_callback, seader); submenu_add_item( @@ -100,11 +86,6 @@ bool seader_scene_card_menu_on_event(void* context, SceneManagerEvent event) { seader->credential->save_format = SeaderCredentialSaveFormatMFC; scene_manager_next_scene(seader->scene_manager, SeaderSceneSaveName); consumed = true; - } else if(event.event == SubmenuIndexParse) { - scene_manager_set_scene_state( - seader->scene_manager, SeaderSceneCardMenu, SubmenuIndexParse); - scene_manager_next_scene(seader->scene_manager, SeaderSceneFormats); - consumed = true; } } else if(event.type == SceneManagerEventTypeBack) { consumed = scene_manager_search_and_switch_to_previous_scene( diff --git a/scenes/seader_scene_read_card_success.c b/scenes/seader_scene_read_card_success.c index 0cb59c0745f..bb1cec08476 100644 --- a/scenes/seader_scene_read_card_success.c +++ b/scenes/seader_scene_read_card_success.c @@ -16,6 +16,7 @@ void seader_scene_read_card_success_widget_callback( void seader_scene_read_card_success_on_enter(void* context) { Seader* seader = context; SeaderCredential* credential = seader->credential; + PluginWiegand* plugin = seader->plugin_wiegand; Widget* widget = seader->widget; FuriString* type_str = furi_string_alloc(); @@ -58,6 +59,18 @@ void seader_scene_read_card_success_on_enter(void* context) { widget_add_button_element( widget, GuiButtonTypeRight, "More", seader_scene_read_card_success_widget_callback, seader); + if(plugin) { + size_t format_count = plugin->count(credential->bit_length, credential->credential); + if(format_count > 0) { + widget_add_button_element( + seader->widget, + GuiButtonTypeCenter, + "Parse", + seader_scene_read_card_success_widget_callback, + seader); + } + } + widget_add_string_element( widget, 64, 5, AlignCenter, AlignCenter, FontPrimary, furi_string_get_cstr(type_str)); widget_add_string_element( @@ -100,6 +113,9 @@ bool seader_scene_read_card_success_on_event(void* context, SceneManagerEvent ev } else if(event.event == GuiButtonTypeRight) { scene_manager_next_scene(seader->scene_manager, SeaderSceneCardMenu); consumed = true; + } else if(event.event == GuiButtonTypeCenter) { + scene_manager_next_scene(seader->scene_manager, SeaderSceneFormats); + consumed = true; } } else if(event.type == SceneManagerEventTypeBack) { scene_manager_search_and_switch_to_previous_scene(