hex_viewer_scene_scene_2.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "../hex_viewer.h"
  2. #include "../helpers/hex_viewer_custom_event.h"
  3. #include "../helpers/hex_viewer_haptic.h"
  4. #include "../helpers/hex_viewer_led.h"
  5. #include "../views/hex_viewer_scene_2.h"
  6. // void hex_viewer_scene_2_callback(HexViewerCustomEvent event, void* context) {
  7. // furi_assert(context);
  8. // HexViewer* app = context;
  9. // view_dispatcher_send_custom_event(app->view_dispatcher, event);
  10. // }
  11. void hex_viewer_scene_scene_2_on_enter(void* context) {
  12. furi_assert(context);
  13. HexViewer* app = context;
  14. FuriString* buffer;
  15. buffer = furi_string_alloc();
  16. furi_string_printf(
  17. buffer,
  18. "File path: %s\nFile size: %lu (0x%lX)",
  19. furi_string_get_cstr(app->file_path),
  20. app->model->file_size,
  21. app->model->file_size);
  22. // DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
  23. DialogMessage* message = dialog_message_alloc();
  24. dialog_message_set_header(message, "Hex Viewer v2.0", 16, 2, AlignLeft, AlignTop);
  25. dialog_message_set_icon(message, &I_hex_10px, 3, 2);
  26. dialog_message_set_text(message, furi_string_get_cstr(buffer), 3, 16, AlignLeft, AlignTop);
  27. dialog_message_set_buttons(message, NULL, NULL, "Back");
  28. dialog_message_show(app->dialogs, message);
  29. furi_string_free(buffer);
  30. dialog_message_free(message);
  31. // furi_record_close(RECORD_DIALOGS);
  32. scene_manager_search_and_switch_to_previous_scene(
  33. app->scene_manager, HexViewerViewIdStartscreen);
  34. }
  35. bool hex_viewer_scene_scene_2_on_event(void* context, SceneManagerEvent event) {
  36. HexViewer* app = context;
  37. UNUSED(app);
  38. UNUSED(event);
  39. bool consumed = true;
  40. return consumed;
  41. }
  42. void hex_viewer_scene_scene_2_on_exit(void* context) {
  43. HexViewer* app = context;
  44. UNUSED(app);
  45. }