Reuse shared history service in document bridges
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "app.h"
|
||||
#include "legacy_brush_package_import_services.h"
|
||||
#include "legacy_canvas_view_services.h"
|
||||
#include "legacy_history_services.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "log.h"
|
||||
#include "node_panel_brush.h"
|
||||
@@ -14,33 +15,10 @@
|
||||
namespace pp::panopainter {
|
||||
namespace {
|
||||
|
||||
class LegacyDocumentHistoryServices final : public pp::app::HistoryUiServices {
|
||||
public:
|
||||
void invoke_undo() override
|
||||
{
|
||||
ActionManager::undo();
|
||||
}
|
||||
|
||||
void invoke_redo() override
|
||||
{
|
||||
ActionManager::redo();
|
||||
}
|
||||
|
||||
void clear_history() override
|
||||
{
|
||||
ActionManager::clear();
|
||||
}
|
||||
};
|
||||
|
||||
pp::foundation::Status apply_document_history(const pp::app::HistoryUiPlan& plan)
|
||||
{
|
||||
LegacyDocumentHistoryServices services;
|
||||
return pp::app::execute_history_ui_plan(plan, services);
|
||||
}
|
||||
|
||||
void apply_open_legacy_project_history(const pp::app::DocumentOpenRoute& route)
|
||||
{
|
||||
const auto history_status = apply_document_history(pp::app::plan_document_open_history(route));
|
||||
const auto history_status = pp::panopainter::execute_legacy_history_plan(
|
||||
pp::app::plan_document_open_history(route));
|
||||
if (!history_status.ok()) {
|
||||
LOG("Project open history effect failed: %s", history_status.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user