xremote_scene_xr_list.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "../xremote.h"
  2. void xremote_scene_xr_list_on_enter(void* context) {
  3. XRemote* app = context;
  4. DialogsFileBrowserOptions browser_options;
  5. dialog_file_browser_set_basic_options(&browser_options, XREMOTE_APP_EXTENSION, &I_xr_10px);
  6. browser_options.base_path = XREMOTE_APP_FOLDER;
  7. FuriString* path;
  8. path = furi_string_alloc();
  9. furi_string_set(path, XREMOTE_APP_FOLDER);
  10. bool success = dialog_file_browser_show(
  11. app->dialogs,
  12. app->file_path,
  13. path,
  14. &browser_options);
  15. furi_string_free(path);
  16. if(success) {
  17. //Load Remote into buffer
  18. success = xremote_cross_remote_load(app->cross_remote, app->file_path);
  19. }
  20. if(success) {
  21. //Load Remote Button View
  22. scene_manager_next_scene(app->scene_manager, XRemoteSceneTransmit);
  23. } else {
  24. //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip);
  25. scene_manager_previous_scene(app->scene_manager);
  26. }
  27. }
  28. bool xremote_scene_xr_list_on_event(void* context, SceneManagerEvent event) {
  29. UNUSED(context);
  30. UNUSED(event);
  31. bool consumed = true;
  32. return consumed;
  33. }
  34. void xremote_scene_xr_list_on_exit(void* context) {
  35. UNUSED(context);
  36. }