Files
aego/editor/shell/recovery_copy.go
sanspie 50be5c04bc
ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Stage 12.5: Art Workspace and asset authoring
Add dockable Art tools, animation and previews, guarded asset workflows,
and the Web Asset Studio built on the shared Art Core. Expand English and
Russian documentation, interactive Try scenes, examples and editor icons.

Add audio waveform navigation, source analysis, guarded previews and a
browser Worker mixer. Preserve source changes and recovery with bounded
checks, and strengthen native, browser and interoperability CI.

Prepare version 0.12.5 and manually built native artifact candidates.
Fix the production site image demo build dependency.
Reuse immutable scene indices when capturing keyframes.
Wait for real Persist save/load completion in component tests.
Stabilize browser Game View captures outside pointer hover.
Aseprite interchange and persistent Audio EDL recovery remain limited;
the artifact workflow does not publish releases or change stable.
2026-11-15 10:37:50 +03:00

39 lines
2.3 KiB
Go

package shell
import (
"strings"
"aego/editor/core/context"
"aego/engine/i18n"
)
// This is an explicit export, not an automatic recovery or a replacement for
// Save. An external directory can be on a different filesystem from the
// project, and is chosen by the user rather than guessed from /tmp or HOME.
func (a *App) askRecoveryCopy() {
docs, project := a.ctx.Docs, a.ctx.Project
a.ctx.Ask(context.Question{
Title: i18n.Tr("editor.shell.recovery_copy_title", "Save emergency recovery copies"),
Message: i18n.Tr("editor.shell.recovery_copy_notice", "Choose an existing directory on a filesystem with free space. A new private folder will contain copies of current unsaved documents; project assets and existing recovery files are not replaced. Earlier pending recovery files are not included. This is not Save, and recovery is never automatic. Temporary storage may disappear after reboot."),
Fields: []string{i18n.Tr("editor.shell.recovery_copy_directory", "Absolute destination directory")},
Values: []string{""},
Buttons: []string{i18n.Tr("editor.shell.recovery_copy_save", "Save copies"), i18n.Tr("editor.common.cancel", "Cancel")},
Submit: func(values []string) {
if len(values) != 1 || docs == nil || a.ctx.Docs != docs || a.ctx.Project != project {
a.ctx.Notify(context.LevelError, i18n.Tr("editor.shell.recovery_copy_project_changed", "The project changed before the recovery copy was saved."))
return
}
output, count, err := docs.WriteRecoveryCopy(strings.TrimSpace(values[0]))
if err != nil {
if output != "" {
a.ctx.Notify(context.LevelError, i18n.Tr("editor.shell.recovery_copy_partial", "Recovery copy is incomplete in {path}: {error}. Keep the editor open and try another location.", i18n.Str("path", output), i18n.Str("error", err.Error())))
} else {
a.ctx.Notify(context.LevelError, i18n.Tr("editor.shell.recovery_copy_failed", "Could not save recovery copies: {error}. Keep the editor open and try another location.", i18n.Str("error", err.Error())))
}
return
}
a.ctx.Notify(context.LevelInfo, i18n.Tr("editor.shell.recovery_copy_saved", "Saved {count} emergency recovery copies in {path}. These are not saved project assets and will not restore automatically.", i18n.Int("count", int64(count)), i18n.Str("path", output)))
},
})
}