[FL-2556] Update complete screen (#1332)

* Desktop: slideshow implementation
* Updater: handling splashscreen installation; added format version field to slideshow binary
* Desktop: added bidirectional slideshow navigation + instant cancel by "back" button; Updater: rebalanced update stages weights
* Updater: fixed missing field init; fixed potential loop when baking slideshows
* Assets: fixed "update complete" image to match original
* Desktop: added check for slideshow file version
* Scripts: slideshow.py cleanup
* Desktop: removed first start intro sequence
* Desktop: removed first start remnants
This commit is contained in:
hedger
2022-06-21 17:11:34 +03:00
committed by GitHub
parent 4b02a404ba
commit eb31fed0e2
23 changed files with 437 additions and 266 deletions

View File

@@ -24,6 +24,7 @@ static const char* update_task_stage_descr[] = {
[UpdateTaskStageLfsBackup] = "Backing up LFS",
[UpdateTaskStageLfsRestore] = "Restoring LFS",
[UpdateTaskStageResourcesUpdate] = "Updating resources",
[UpdateTaskStageSplashscreenInstall] = "Installing splashscreen",
[UpdateTaskStageCompleted] = "Restarting...",
[UpdateTaskStageError] = "Error",
[UpdateTaskStageOBError] = "OB, report",
@@ -41,13 +42,13 @@ static const UpdateTaskStageGroupMap update_task_stage_progress[] = {
[UpdateTaskStageProgress] = STAGE_DEF(UpdateTaskStageGroupMisc, 0),
[UpdateTaskStageReadManifest] = STAGE_DEF(UpdateTaskStageGroupPreUpdate, 5),
[UpdateTaskStageLfsBackup] = STAGE_DEF(UpdateTaskStageGroupPreUpdate, 30),
[UpdateTaskStageLfsBackup] = STAGE_DEF(UpdateTaskStageGroupPreUpdate, 15),
[UpdateTaskStageRadioImageValidate] = STAGE_DEF(UpdateTaskStageGroupRadio, 30),
[UpdateTaskStageRadioImageValidate] = STAGE_DEF(UpdateTaskStageGroupRadio, 10),
[UpdateTaskStageRadioErase] = STAGE_DEF(UpdateTaskStageGroupRadio, 50),
[UpdateTaskStageRadioWrite] = STAGE_DEF(UpdateTaskStageGroupRadio, 100),
[UpdateTaskStageRadioInstall] = STAGE_DEF(UpdateTaskStageGroupRadio, 5),
[UpdateTaskStageRadioBusy] = STAGE_DEF(UpdateTaskStageGroupRadio, 70),
[UpdateTaskStageRadioWrite] = STAGE_DEF(UpdateTaskStageGroupRadio, 90),
[UpdateTaskStageRadioInstall] = STAGE_DEF(UpdateTaskStageGroupRadio, 15),
[UpdateTaskStageRadioBusy] = STAGE_DEF(UpdateTaskStageGroupRadio, 60),
[UpdateTaskStageOBValidation] = STAGE_DEF(UpdateTaskStageGroupOptionBytes, 10),
@@ -58,6 +59,7 @@ static const UpdateTaskStageGroupMap update_task_stage_progress[] = {
[UpdateTaskStageLfsRestore] = STAGE_DEF(UpdateTaskStageGroupPostUpdate, 30),
[UpdateTaskStageResourcesUpdate] = STAGE_DEF(UpdateTaskStageGroupResources, 255),
[UpdateTaskStageSplashscreenInstall] = STAGE_DEF(UpdateTaskStageGroupSplashscreen, 5),
[UpdateTaskStageCompleted] = STAGE_DEF(UpdateTaskStageGroupMisc, 1),
[UpdateTaskStageError] = STAGE_DEF(UpdateTaskStageGroupMisc, 1),
@@ -79,6 +81,9 @@ static UpdateTaskStageGroup update_task_get_task_groups(UpdateTask* update_task)
if(!string_empty_p(manifest->resource_bundle)) {
ret |= UpdateTaskStageGroupResources;
}
if(!string_empty_p(manifest->splash_file)) {
ret |= UpdateTaskStageGroupSplashscreen;
}
return ret;
}

View File

@@ -33,6 +33,7 @@ typedef enum {
UpdateTaskStageLfsRestore,
UpdateTaskStageResourcesUpdate,
UpdateTaskStageSplashscreenInstall,
UpdateTaskStageCompleted,
UpdateTaskStageError,
@@ -52,6 +53,7 @@ typedef enum {
UpdateTaskStageGroupRadio = 1 << 4,
UpdateTaskStageGroupPostUpdate = 1 << 5,
UpdateTaskStageGroupResources = 1 << 6,
UpdateTaskStageGroupSplashscreen = 1 << 7,
} UpdateTaskStageGroup;
typedef struct {

View File

@@ -93,6 +93,19 @@ static bool update_task_post_update(UpdateTask* update_task) {
CHECK_RESULT(tar_archive_unpack_to(archive, EXT_PATH));
}
}
if(update_task->state.groups & UpdateTaskStageGroupSplashscreen) {
update_task_set_progress(update_task, UpdateTaskStageSplashscreenInstall, 0);
string_t tmp_path;
string_init_set(tmp_path, update_task->update_path);
path_append(tmp_path, string_get_cstr(update_task->manifest->splash_file));
if(storage_common_copy(
update_task->storage, string_get_cstr(tmp_path), "/int/slideshow") != FSE_OK) {
// actually, not critical
}
string_clear(tmp_path);
update_task_set_progress(update_task, UpdateTaskStageSplashscreenInstall, 100);
}
success = true;
} while(false);