Route document workflow prompts through app core

This commit is contained in:
2026-06-02 22:36:05 +02:00
parent d28aa25358
commit c8d769c02c
10 changed files with 130 additions and 96 deletions

View File

@@ -27,6 +27,12 @@ enum class DocumentSaveDecision {
save_version,
};
enum class DocumentWorkflowDecision {
unavailable,
continue_now,
prompt_save_before_continue,
};
[[nodiscard]] constexpr ProjectOpenDecision plan_project_open(bool has_unsaved_changes) noexcept
{
return has_unsaved_changes
@@ -78,4 +84,17 @@ enum class DocumentSaveDecision {
return DocumentSaveDecision::no_op;
}
[[nodiscard]] constexpr DocumentWorkflowDecision plan_document_workflow(
bool has_canvas,
bool has_unsaved_changes) noexcept
{
if (!has_canvas) {
return DocumentWorkflowDecision::unavailable;
}
return has_unsaved_changes
? DocumentWorkflowDecision::prompt_save_before_continue
: DocumentWorkflowDecision::continue_now;
}
}