Show xfwfirstboot slideshow on click version text

This commit is contained in:
Willy-JL
2023-03-28 07:53:53 +01:00
parent 73aee87eb1
commit 64bd2052e0
4 changed files with 145 additions and 116 deletions

View File

@@ -47,6 +47,13 @@ bool xtreme_app_scene_start_on_event(void* context, SceneManagerEvent event) {
case VarItemListIndexMisc: case VarItemListIndexMisc:
scene_manager_next_scene(app->scene_manager, XtremeAppSceneMisc); scene_manager_next_scene(app->scene_manager, XtremeAppSceneMisc);
break; break;
case VarItemListIndexVersion: {
if(storage_common_copy(furi_record_open(RECORD_STORAGE), EXT_PATH("dolphin/xfwfirstboot.bin"), EXT_PATH(".slideshow"))) {
app->show_slideshow = true;
xtreme_app_apply(app);
}
break;
}
default: default:
break; break;
} }

View File

@@ -11,11 +11,7 @@ void callback_reboot(void* context) {
power_reboot(PowerBootModeNormal); power_reboot(PowerBootModeNormal);
} }
static bool xtreme_app_back_event_callback(void* context) { bool xtreme_app_apply(XtremeApp* app) {
furi_assert(context);
XtremeApp* app = context;
if(!scene_manager_has_previous_scene(app->scene_manager, XtremeAppSceneStart)) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
if(app->save_mainmenu_apps) { if(app->save_mainmenu_apps) {
@@ -122,6 +118,10 @@ static bool xtreme_app_back_event_callback(void* context) {
XTREME_SETTINGS_SAVE(); XTREME_SETTINGS_SAVE();
} }
if(app->show_slideshow) {
callback_reboot(NULL);
}
if(app->require_reboot) { if(app->require_reboot) {
popup_set_header(app->popup, "Rebooting...", 64, 26, AlignCenter, AlignCenter); popup_set_header(app->popup, "Rebooting...", 64, 26, AlignCenter, AlignCenter);
popup_set_text(app->popup, "Applying changes...", 64, 40, AlignCenter, AlignCenter); popup_set_text(app->popup, "Applying changes...", 64, 40, AlignCenter, AlignCenter);
@@ -134,6 +134,17 @@ static bool xtreme_app_back_event_callback(void* context) {
} }
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
return false;
}
static bool xtreme_app_back_event_callback(void* context) {
furi_assert(context);
XtremeApp* app = context;
if(!scene_manager_has_previous_scene(app->scene_manager, XtremeAppSceneStart)) {
if(xtreme_app_apply(app)) {
return true;
}
} }
return scene_manager_handle_back_event(app->scene_manager); return scene_manager_handle_back_event(app->scene_manager);

View File

@@ -65,6 +65,7 @@ typedef struct {
bool save_level; bool save_level;
bool save_backlight; bool save_backlight;
bool save_settings; bool save_settings;
bool show_slideshow;
bool require_reboot; bool require_reboot;
} XtremeApp; } XtremeApp;
@@ -73,3 +74,5 @@ typedef enum {
XtremeAppViewTextInput, XtremeAppViewTextInput,
XtremeAppViewPopup, XtremeAppViewPopup,
} XtremeAppView; } XtremeAppView;
bool xtreme_app_apply(XtremeApp* app);

View File

@@ -126,6 +126,14 @@ class Main(App):
) )
if self.args.resources: if self.args.resources:
resources_basename = self.RESOURCE_FILE_NAME resources_basename = self.RESOURCE_FILE_NAME
SlideshowMain(no_exit=True)(
[
"-i",
str(pathlib.Path(self.args.resources).parent / "slideshow/xfwfirstboot"),
"-o",
str(pathlib.Path(self.args.resources) / "dolphin/xfwfirstboot.bin"),
]
)
if not self.package_resources( if not self.package_resources(
self.args.resources, join(self.args.directory, resources_basename) self.args.resources, join(self.args.directory, resources_basename)
): ):