xremote_scene_xr_list_edit.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "../xremote.h"
  2. void xremote_scene_xr_list_edit_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(app->dialogs, app->file_path, path, &browser_options);
  11. furi_string_free(path);
  12. if(success) {
  13. //Load Remote into buffer
  14. success = xremote_cross_remote_load(app->cross_remote, app->file_path);
  15. }
  16. if(success) {
  17. //Load Remote Button View
  18. scene_manager_next_scene(app->scene_manager, XRemoteSceneXrListEditItem);
  19. } else {
  20. scene_manager_previous_scene(app->scene_manager);
  21. }
  22. }
  23. bool xremote_scene_xr_list_edit_on_event(void* context, SceneManagerEvent event) {
  24. UNUSED(context);
  25. UNUSED(event);
  26. bool consumed = true;
  27. return consumed;
  28. }
  29. void xremote_scene_xr_list_edit_on_exit(void* context) {
  30. UNUSED(context);
  31. }