infrared_scene_remote_list.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "../infrared_i.h"
  2. void infrared_scene_remote_list_on_enter(void* context) {
  3. Infrared* infrared = context;
  4. SceneManager* scene_manager = infrared->scene_manager;
  5. ViewDispatcher* view_dispatcher = infrared->view_dispatcher;
  6. bool success = dialog_file_browser_show(
  7. infrared->dialogs,
  8. infrared->file_path,
  9. infrared->file_path,
  10. INFRARED_APP_EXTENSION,
  11. true,
  12. &I_ir_10px,
  13. true);
  14. if(success) {
  15. view_set_orientation(view_stack_get_view(infrared->view_stack), ViewOrientationVertical);
  16. view_dispatcher_switch_to_view(view_dispatcher, InfraredViewStack);
  17. infrared_show_loading_popup(infrared, true);
  18. success = infrared_remote_load(infrared->remote, infrared->file_path);
  19. infrared_show_loading_popup(infrared, false);
  20. }
  21. if(success) {
  22. scene_manager_next_scene(scene_manager, InfraredSceneRemote);
  23. } else {
  24. scene_manager_previous_scene(scene_manager);
  25. }
  26. }
  27. bool infrared_scene_remote_list_on_event(void* context, SceneManagerEvent event) {
  28. UNUSED(context);
  29. UNUSED(event);
  30. bool consumed = false;
  31. return consumed;
  32. }
  33. void infrared_scene_remote_list_on_exit(void* context) {
  34. UNUSED(context);
  35. }