scene_file_select.c 958 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "app_i.h"
  2. #include <furi.h>
  3. #include <dialogs/dialogs.h>
  4. #include <storage/storage.h>
  5. void scene_file_select_on_enter(void* context) {
  6. App* app = context;
  7. DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
  8. DialogsFileBrowserOptions options;
  9. dialog_file_browser_set_basic_options(&options, VGM_FW_FILE_EXTENSION, NULL);
  10. options.hide_dot_files = true;
  11. options.base_path = VGM_FW_DEFAULT_PATH;
  12. if(dialog_file_browser_show(dialogs, app->file_path, app->file_path, &options)) {
  13. scene_manager_next_scene(app->scene_manager, SceneConfirm);
  14. } else {
  15. furi_string_reset(app->file_path);
  16. scene_manager_previous_scene(app->scene_manager);
  17. }
  18. furi_record_close(RECORD_DIALOGS);
  19. }
  20. bool scene_file_select_on_event(void* context, SceneManagerEvent event) {
  21. UNUSED(context);
  22. UNUSED(event);
  23. return false;
  24. }
  25. void scene_file_select_on_exit(void* context) {
  26. UNUSED(context);
  27. }