Reuse shared history service in document session bridge
This commit is contained in:
@@ -16,11 +16,6 @@
|
||||
namespace pp::panopainter {
|
||||
namespace {
|
||||
|
||||
pp::foundation::Status apply_document_history(const pp::app::HistoryUiPlan& plan)
|
||||
{
|
||||
return pp::panopainter::execute_legacy_history_plan(plan);
|
||||
}
|
||||
|
||||
void log_legacy_document_save_snapshot(
|
||||
const char* context,
|
||||
const pp::app::DocumentCanvasSaveSnapshotReport& report)
|
||||
@@ -131,7 +126,8 @@ void create_legacy_new_document(
|
||||
const auto reset_status = execute_legacy_canvas_camera_reset(app);
|
||||
if (!reset_status.ok())
|
||||
LOG("New document camera reset failed: %s", reset_status.message);
|
||||
const auto history_status = apply_document_history(pp::app::plan_new_document_history(plan));
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_new_document_history(plan));
|
||||
if (!history_status.ok()) {
|
||||
LOG("New document history effect failed: %s", history_status.message);
|
||||
}
|
||||
@@ -194,7 +190,8 @@ void save_legacy_document_file(
|
||||
const pp::app::DocumentFileSavePlan& plan,
|
||||
const std::shared_ptr<NodeDialogSave>& dialog)
|
||||
{
|
||||
const auto history_status = apply_document_history(pp::app::plan_document_file_save_history(plan));
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_file_save_history(plan));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Document file save history effect failed: %s", history_status.message);
|
||||
}
|
||||
@@ -254,7 +251,8 @@ private:
|
||||
|
||||
void save_document_version(App& app, const pp::app::DocumentVersionTarget& target)
|
||||
{
|
||||
const auto history_status = apply_document_history(pp::app::plan_document_version_save_history(target));
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_version_save_history(target));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Document version history effect failed: %s", history_status.message);
|
||||
}
|
||||
@@ -275,7 +273,7 @@ public:
|
||||
|
||||
void request_close_now() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_close_request_history(pp::app::CloseRequestDecision::close_now));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Close request history effect failed: %s", history_status.message);
|
||||
@@ -284,7 +282,7 @@ public:
|
||||
|
||||
void show_unsaved_close_prompt() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_close_request_history(pp::app::CloseRequestDecision::show_unsaved_prompt));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Close prompt history effect failed: %s", history_status.message);
|
||||
@@ -311,7 +309,7 @@ public:
|
||||
|
||||
void show_save_dialog() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_save_history(pp::app::DocumentSaveDecision::show_save_dialog));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Save dialog history effect failed: %s", history_status.message);
|
||||
@@ -321,7 +319,7 @@ public:
|
||||
|
||||
void save_existing_document() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_save_history(pp::app::DocumentSaveDecision::save_existing));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Save existing history effect failed: %s", history_status.message);
|
||||
@@ -331,7 +329,7 @@ public:
|
||||
|
||||
void save_document_version() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_save_history(pp::app::DocumentSaveDecision::save_version));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Save version history effect failed: %s", history_status.message);
|
||||
@@ -377,7 +375,7 @@ public:
|
||||
|
||||
void continue_workflow_now() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_workflow_history(
|
||||
pp::app::DocumentWorkflowDecision::continue_now));
|
||||
if (!history_status.ok()) {
|
||||
@@ -388,7 +386,7 @@ public:
|
||||
|
||||
void prompt_save_before_continue() override
|
||||
{
|
||||
const auto history_status = apply_document_history(
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_workflow_history(
|
||||
pp::app::DocumentWorkflowDecision::prompt_save_before_continue));
|
||||
if (!history_status.ok()) {
|
||||
|
||||
Reference in New Issue
Block a user