evil_portal_scene_select_html.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "../evil_portal_app_i.h"
  2. #include "../helpers/evil_portal_storage.h"
  3. void evil_portal_scene_select_html_on_enter(void* context) {
  4. Evil_PortalApp* app = context;
  5. DialogsFileBrowserOptions browser_options;
  6. evil_portal_create_html_folder_if_not_exists();
  7. dialog_file_browser_set_basic_options(&browser_options, HTML_EXTENSION, &I_evil_portal_10px);
  8. browser_options.base_path = HTML_FOLDER;
  9. FuriString* path;
  10. path = furi_string_alloc();
  11. furi_string_set(path, HTML_FOLDER);
  12. bool success = dialog_file_browser_show(app->dialogs, app->file_path, path, &browser_options);
  13. furi_string_free(path);
  14. if(success) {
  15. //Replace HTML File
  16. evil_portal_replace_index_html(app->file_path);
  17. }
  18. scene_manager_search_and_switch_to_previous_scene(app->scene_manager, Evil_PortalSceneStart);
  19. }
  20. bool evil_portal_scene_select_html_on_event(void* context, SceneManagerEvent event) {
  21. UNUSED(context);
  22. UNUSED(event);
  23. bool consumed = true;
  24. return consumed;
  25. }
  26. void evil_portal_scene_select_html_on_exit(void* context) {
  27. UNUSED(context);
  28. }