[FL-2455] LFRFID, iButton: more-menu fix (#1151)
* Items order changed * iButton,Rfid: correct order in enums Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
parent
7ed5b9053a
commit
ec71a5c9d8
@ -2,9 +2,9 @@
|
|||||||
#include "../ibutton_app.h"
|
#include "../ibutton_app.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SubmenuIndexWrite,
|
|
||||||
SubmenuIndexEmulate,
|
|
||||||
SubmenuIndexSave,
|
SubmenuIndexSave,
|
||||||
|
SubmenuIndexEmulate,
|
||||||
|
SubmenuIndexWrite,
|
||||||
} SubmenuIndex;
|
} SubmenuIndex;
|
||||||
|
|
||||||
static void submenu_callback(void* context, uint32_t index) {
|
static void submenu_callback(void* context, uint32_t index) {
|
||||||
@ -22,11 +22,11 @@ void iButtonSceneReadKeyMenu::on_enter(iButtonApp* app) {
|
|||||||
iButtonAppViewManager* view_manager = app->get_view_manager();
|
iButtonAppViewManager* view_manager = app->get_view_manager();
|
||||||
Submenu* submenu = view_manager->get_submenu();
|
Submenu* submenu = view_manager->get_submenu();
|
||||||
|
|
||||||
|
submenu_add_item(submenu, "Save", SubmenuIndexSave, submenu_callback, app);
|
||||||
|
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, submenu_callback, app);
|
||||||
if(ibutton_key_get_type(app->get_key()) == iButtonKeyDS1990) {
|
if(ibutton_key_get_type(app->get_key()) == iButtonKeyDS1990) {
|
||||||
submenu_add_item(submenu, "Write", SubmenuIndexWrite, submenu_callback, app);
|
submenu_add_item(submenu, "Write", SubmenuIndexWrite, submenu_callback, app);
|
||||||
}
|
}
|
||||||
submenu_add_item(submenu, "Save", SubmenuIndexSave, submenu_callback, app);
|
|
||||||
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, submenu_callback, app);
|
|
||||||
submenu_set_selected_item(submenu, submenu_item_selected);
|
submenu_set_selected_item(submenu, submenu_item_selected);
|
||||||
|
|
||||||
view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewSubmenu);
|
view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewSubmenu);
|
||||||
@ -62,4 +62,4 @@ void iButtonSceneReadKeyMenu::on_exit(iButtonApp* app) {
|
|||||||
Submenu* submenu = view->get_submenu();
|
Submenu* submenu = view->get_submenu();
|
||||||
|
|
||||||
submenu_reset(submenu);
|
submenu_reset(submenu);
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
#include "lfrfid_app_scene_read_menu.h"
|
#include "lfrfid_app_scene_read_menu.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SubmenuWrite,
|
|
||||||
SubmenuSave,
|
SubmenuSave,
|
||||||
SubmenuEmulate,
|
SubmenuEmulate,
|
||||||
|
SubmenuWrite,
|
||||||
} SubmenuIndex;
|
} SubmenuIndex;
|
||||||
|
|
||||||
void LfRfidAppSceneReadKeyMenu::on_enter(LfRfidApp* app, bool need_restore) {
|
void LfRfidAppSceneReadKeyMenu::on_enter(LfRfidApp* app, bool need_restore) {
|
||||||
auto submenu = app->view_controller.get<SubmenuVM>();
|
auto submenu = app->view_controller.get<SubmenuVM>();
|
||||||
|
|
||||||
submenu->add_item("Write", SubmenuWrite, submenu_callback, app);
|
|
||||||
submenu->add_item("Save", SubmenuSave, submenu_callback, app);
|
submenu->add_item("Save", SubmenuSave, submenu_callback, app);
|
||||||
submenu->add_item("Emulate", SubmenuEmulate, submenu_callback, app);
|
submenu->add_item("Emulate", SubmenuEmulate, submenu_callback, app);
|
||||||
|
submenu->add_item("Write", SubmenuWrite, submenu_callback, app);
|
||||||
|
|
||||||
if(need_restore) {
|
if(need_restore) {
|
||||||
submenu->set_selected_item(submenu_item_selected);
|
submenu->set_selected_item(submenu_item_selected);
|
||||||
|
Loading…
Reference in New Issue
Block a user