Centralize legacy brush package import
This commit is contained in:
@@ -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();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user