seos_scene_about.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "../seos_i.h"
  2. #include <dolphin/dolphin.h>
  3. static char* about =
  4. "This software incorporates a third-party implementation of Seos™ technology. It is not developed, authorized, licensed, or endorsed by HID Global, ASSA ABLOY, or any of their affiliates. References to Seos™ are solely for descriptive and compatibility purposes.\nNo guarantee of compatibility or functionality is made. This implementation may not work with all Seos™-enabled systems, and its performance, security, and reliability are not assured. Users assume all risks associated with its use.\nSeos™, HID Global, and ASSA ABLOY are trademarks or registered trademarks of their respective owners. This software is not associated with or sponsored by them in any way.";
  5. void seos_scene_about_widget_callback(GuiButtonType result, InputType type, void* context) {
  6. Seos* seos = context;
  7. if(type == InputTypeShort) {
  8. view_dispatcher_send_custom_event(seos->view_dispatcher, result);
  9. }
  10. }
  11. void seos_scene_about_on_enter(void* context) {
  12. Seos* seos = context;
  13. furi_string_reset(seos->text_box_store);
  14. FuriString* str = seos->text_box_store;
  15. furi_string_cat_printf(str, "%s\n", about);
  16. text_box_set_font(seos->text_box, TextBoxFontText);
  17. text_box_set_text(seos->text_box, furi_string_get_cstr(seos->text_box_store));
  18. view_dispatcher_switch_to_view(seos->view_dispatcher, SeosViewTextBox);
  19. }
  20. bool seos_scene_about_on_event(void* context, SceneManagerEvent event) {
  21. Seos* seos = context;
  22. bool consumed = false;
  23. if(event.type == SceneManagerEventTypeCustom) {
  24. if(event.event == GuiButtonTypeLeft) {
  25. consumed = scene_manager_previous_scene(seos->scene_manager);
  26. }
  27. } else if(event.type == SceneManagerEventTypeBack) {
  28. consumed = scene_manager_previous_scene(seos->scene_manager);
  29. }
  30. return consumed;
  31. }
  32. void seos_scene_about_on_exit(void* context) {
  33. Seos* seos = context;
  34. // Clear views
  35. text_box_reset(seos->text_box);
  36. }