passy_scene_known_issues.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "../passy_i.h"
  2. static const char* known_issues_text = "Passy only uses BAC, not PACE for auth\n"
  3. "PACE-only:\n"
  4. " - German Personalausweis\n"
  5. " - German Aufenthaltstitel post 2015\n";
  6. void passy_scene_known_issues_widget_callback(GuiButtonType result, InputType type, void* context) {
  7. Passy* passy = context;
  8. if(type == InputTypeShort) {
  9. view_dispatcher_send_custom_event(passy->view_dispatcher, result);
  10. }
  11. }
  12. void passy_scene_known_issues_on_enter(void* context) {
  13. Passy* passy = context;
  14. furi_string_reset(passy->text_box_store);
  15. FuriString* str = passy->text_box_store;
  16. furi_string_cat_printf(str, "%s\n", known_issues_text);
  17. text_box_set_font(passy->text_box, TextBoxFontText);
  18. text_box_set_text(passy->text_box, furi_string_get_cstr(passy->text_box_store));
  19. view_dispatcher_switch_to_view(passy->view_dispatcher, PassyViewTextBox);
  20. }
  21. bool passy_scene_known_issues_on_event(void* context, SceneManagerEvent event) {
  22. Passy* passy = context;
  23. bool consumed = false;
  24. if(event.type == SceneManagerEventTypeCustom) {
  25. if(event.event == GuiButtonTypeLeft) {
  26. consumed = scene_manager_previous_scene(passy->scene_manager);
  27. }
  28. } else if(event.type == SceneManagerEventTypeBack) {
  29. consumed = scene_manager_previous_scene(passy->scene_manager);
  30. }
  31. return consumed;
  32. }
  33. void passy_scene_known_issues_on_exit(void* context) {
  34. Passy* passy = context;
  35. // Clear views
  36. text_box_reset(passy->text_box);
  37. }