forked from flipperdevices/flipperzero-firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Lee
committed
Jul 28, 2023
1 parent
42b7ba9
commit 4d88320
Showing
9 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
ADD_SCENE(evil_portal, start, Start) | ||
ADD_SCENE(evil_portal, console_output, ConsoleOutput) | ||
ADD_SCENE(evil_portal, rename, Rename) | ||
ADD_SCENE(evil_portal, select_html, SelectHtml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include "../evil_portal_app_i.h" | ||
#include "../helpers/evil_portal_storage.h" | ||
|
||
void evil_portal_show_loading_popup(Evil_PortalApp* app, bool show) { | ||
TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME); | ||
ViewStack* view_stack = app->view_stack; | ||
Loading* loading = app->loading; | ||
if(show) { | ||
// Raise timer priority so that animations can play | ||
vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1); | ||
view_stack_add_view(view_stack, loading_get_view(loading)); | ||
} else { | ||
view_stack_remove_view(view_stack, loading_get_view(loading)); | ||
// Restore default timer priority | ||
vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY); | ||
} | ||
} | ||
|
||
void evil_portal_scene_select_html_on_enter(void *context) { | ||
Evil_PortalApp *app = context; | ||
DialogsFileBrowserOptions browser_options; | ||
evil_portal_create_html_folder_if_not_exists(); | ||
|
||
dialog_file_browser_set_basic_options(&browser_options, HTML_EXTENSION, &I_evil_portal_10px); | ||
browser_options.base_path = HTML_FOLDER; | ||
|
||
FuriString* path; | ||
path = furi_string_alloc(); | ||
|
||
furi_string_set(path, HTML_FOLDER); | ||
|
||
|
||
|
||
bool success = dialog_file_browser_show( | ||
app->dialogs, app->file_path, path, &browser_options); | ||
furi_string_free(path); | ||
|
||
if(success) { | ||
//Replace HTML File | ||
evil_portal_show_loading_popup(app, true); | ||
evil_portal_replace_index_html(app->file_path); | ||
evil_portal_show_loading_popup(app, false); | ||
} | ||
|
||
if(success) { | ||
scene_manager_search_and_switch_to_previous_scene( | ||
app->scene_manager, Evil_PortalSceneStart); | ||
} else { | ||
scene_manager_previous_scene(app->scene_manager); | ||
} | ||
} | ||
|
||
bool evil_portal_scene_select_html_on_event(void *context, SceneManagerEvent event) { | ||
UNUSED(context); | ||
UNUSED(event); | ||
bool consumed = true; | ||
return consumed; | ||
} | ||
|
||
void evil_portal_scene_select_html_on_exit(void *context) { | ||
UNUSED(context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters