added nsfw text for u2f & sfw_mode compatibility

This commit is contained in:
jbohack
2023-01-09 15:53:55 -05:00
parent 4992c89630
commit b5ab554911
+28 -10
View File
@@ -1,4 +1,5 @@
#include "../u2f_app_i.h"
#include "../../../settings/desktop_settings/desktop_settings_app.h"
static void u2f_scene_error_event_callback(GuiButtonType result, InputType type, void* context) {
furi_assert(context);
@@ -11,6 +12,8 @@ static void u2f_scene_error_event_callback(GuiButtonType result, InputType type,
void u2f_scene_error_on_enter(void* context) {
U2fApp* app = context;
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);
if(app->error == U2fAppErrorNoFiles) {
widget_add_icon_element(app->widget, 0, 0, &I_SDQuestion_35x43);
@@ -26,19 +29,34 @@ void u2f_scene_error_on_enter(void* context) {
app->widget, GuiButtonTypeLeft, "Back", u2f_scene_error_event_callback, app);
} else if(app->error == U2fAppErrorCloseRpc) {
widget_add_icon_element(app->widget, 78, 0, &I_ActiveConnection_50x64);
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "Connection\nis active!");
widget_add_string_multiline_element(
app->widget,
3,
30,
AlignLeft,
AlignTop,
FontSecondary,
"Disconnect from\nPC or phone to\nuse this function.");
if (settings->sfw_mode) {
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "Connection\nis active!");
widget_add_string_multiline_element(
app->widget,
3,
30,
AlignLeft,
AlignTop,
FontSecondary,
"Disconnect from\nPC or phone to\nuse this function.");
}
else {
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "I am not\na whore!");
widget_add_string_multiline_element(
app->widget,
3,
30,
AlignLeft,
AlignTop,
FontSecondary,
"Pull out from\nPC or phone to\nuse me like this.");
}
}
view_dispatcher_switch_to_view(app->view_dispatcher, U2fAppViewError);
free(settings);
}
bool u2f_scene_error_on_event(void* context, SceneManagerEvent event) {