Centralize legacy brush package import

This commit is contained in:
2026-06-04 14:49:22 +02:00
parent 78185b8fd5
commit 6ab64ccc82
13 changed files with 415 additions and 6 deletions

View File

@@ -3,7 +3,9 @@
#include "legacy_document_open_services.h"
#include "app.h"
#include "legacy_brush_package_import_services.h"
#include "legacy_history_services.h"
#include "log.h"
#include "node_panel_brush.h"
#include "node_panel_layer.h"
@@ -50,7 +52,12 @@ public:
auto* app = &app_;
auto mb = app_.message_box("Import ABR", "Would you like to import the brushes?", true);
mb->on_submit = [app, path = route.path](Node* target) {
std::thread(&NodePanelBrushPreset::import_abr, app->presets, path).detach();
const auto status = pp::panopainter::execute_legacy_brush_package_import(
*app,
pp::app::BrushPackageImportKind::abr,
path);
if (!status.ok())
LOG("ABR import failed: %s", status.message);
target->destroy();
};
}
@@ -60,7 +67,12 @@ public:
auto* app = &app_;
auto mb = app_.message_box("Import PPBR", "Would you like to import the brushes?", true);
mb->on_submit = [app, path = route.path](Node* target) {
std::thread(&NodePanelBrushPreset::import_ppbr, app->presets, path).detach();
const auto status = pp::panopainter::execute_legacy_brush_package_import(
*app,
pp::app::BrushPackageImportKind::ppbr,
path);
if (!status.ok())
LOG("PPBR import failed: %s", status.message);
target->destroy();
};
}