mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 15:00:46 +00:00
[FL-2165] Do not allow "write" for keys that do not have write ability. #1055
This commit is contained in:
parent
2ba3a9f09a
commit
76f524d4e9
2 changed files with 6 additions and 2 deletions
|
@ -16,7 +16,9 @@ void iButtonSceneReadedKeyMenu::on_enter(iButtonApp* app) {
|
||||||
Submenu* submenu = view_manager->get_submenu();
|
Submenu* submenu = view_manager->get_submenu();
|
||||||
auto callback = cbc::obtain_connector(this, &iButtonSceneReadedKeyMenu::submenu_callback);
|
auto callback = cbc::obtain_connector(this, &iButtonSceneReadedKeyMenu::submenu_callback);
|
||||||
|
|
||||||
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
|
if(app->get_key()->get_key_type() == iButtonKeyType::KeyDallas) {
|
||||||
|
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
|
||||||
|
}
|
||||||
submenu_add_item(submenu, "Name and save", SubmenuIndexNameAndSave, callback, app);
|
submenu_add_item(submenu, "Name and save", SubmenuIndexNameAndSave, callback, app);
|
||||||
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, callback, app);
|
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, callback, app);
|
||||||
submenu_add_item(submenu, "Read new key", SubmenuIndexReadNewKey, callback, app);
|
submenu_add_item(submenu, "Read new key", SubmenuIndexReadNewKey, callback, app);
|
||||||
|
|
|
@ -18,7 +18,9 @@ void iButtonSceneSavedKeyMenu::on_enter(iButtonApp* app) {
|
||||||
auto callback = cbc::obtain_connector(this, &iButtonSceneSavedKeyMenu::submenu_callback);
|
auto callback = cbc::obtain_connector(this, &iButtonSceneSavedKeyMenu::submenu_callback);
|
||||||
|
|
||||||
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, callback, app);
|
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, callback, app);
|
||||||
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
|
if(app->get_key()->get_key_type() == iButtonKeyType::KeyDallas) {
|
||||||
|
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
|
||||||
|
}
|
||||||
submenu_add_item(submenu, "Edit", SubmenuIndexEdit, callback, app);
|
submenu_add_item(submenu, "Edit", SubmenuIndexEdit, callback, app);
|
||||||
submenu_add_item(submenu, "Delete", SubmenuIndexDelete, callback, app);
|
submenu_add_item(submenu, "Delete", SubmenuIndexDelete, callback, app);
|
||||||
submenu_add_item(submenu, "Info", SubmenuIndexInfo, callback, app);
|
submenu_add_item(submenu, "Info", SubmenuIndexInfo, callback, app);
|
||||||
|
|
Loading…
Reference in a new issue