Extract document-open import prompt helper
This commit is contained in:
@@ -18,6 +18,12 @@ agent or engineer to remove them without reconstructing context from chat.
|
||||
|
||||
## Recent Reductions
|
||||
|
||||
- 2026-06-15: `DEBT-0039` was narrowed again. The retained ABR/PPBR import
|
||||
prompt wiring in `src/legacy_document_open_services.cpp` now routes through
|
||||
a focused helper instead of living inline in each document-open import
|
||||
prompt; the remaining document-open bridge debt stays concentrated in
|
||||
unsaved-project prompts, project-open execution, layer refresh, title
|
||||
updates, and retained history services.
|
||||
- 2026-06-15: `DEBT-0038` was narrowed again. The retained cloud downloaded-
|
||||
project open camera reset and layer-clear setup in
|
||||
`execute_legacy_downloaded_project_open()` now routes through a focused
|
||||
|
||||
@@ -1387,6 +1387,10 @@ the app-core brush package import executor and
|
||||
`src/legacy_brush_package_import_services.*`, preserving detached legacy preset
|
||||
panel import threads while retained brush asset execution remains tracked under
|
||||
`DEBT-0048`.
|
||||
The retained ABR/PPBR import prompt wiring in `src/legacy_document_open_services.*`
|
||||
now also routes through a focused helper, so the remaining document-open bridge
|
||||
debt is further concentrated on unsaved-project prompts, project-open
|
||||
execution, layer refresh, title updates, and retained history services.
|
||||
`App::request_close`, `App::save_document`, and
|
||||
`App::continue_document_workflow_after_optional_save` now route through
|
||||
app-core document-session executors and `src/legacy_document_session_services.*`,
|
||||
|
||||
@@ -86,6 +86,22 @@ void prepare_downloaded_project_open(App& app)
|
||||
app.layers->clear();
|
||||
}
|
||||
|
||||
void prompt_import_brush_package(
|
||||
App& app,
|
||||
const char* title,
|
||||
const char* log_prefix,
|
||||
pp::app::BrushPackageImportKind kind,
|
||||
const pp::app::DocumentOpenRoute& route)
|
||||
{
|
||||
auto mb = app.message_box(title, "Would you like to import the brushes?", true);
|
||||
mb->on_submit = [&app, path = route.path, kind, log_prefix](Node* target) {
|
||||
const auto status = pp::panopainter::execute_legacy_brush_package_import(app, kind, path);
|
||||
if (!status.ok())
|
||||
LOG("%s import failed: %s", log_prefix, status.message);
|
||||
pp::panopainter::close_legacy_dialog_node(*target);
|
||||
};
|
||||
}
|
||||
|
||||
class LegacyDocumentOpenServices final : public pp::app::DocumentOpenServices {
|
||||
public:
|
||||
explicit LegacyDocumentOpenServices(App& app) noexcept
|
||||
@@ -95,32 +111,22 @@ public:
|
||||
|
||||
void prompt_import_abr(const pp::app::DocumentOpenRoute& route) override
|
||||
{
|
||||
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) {
|
||||
const auto status = pp::panopainter::execute_legacy_brush_package_import(
|
||||
*app,
|
||||
prompt_import_brush_package(
|
||||
app_,
|
||||
"Import ABR",
|
||||
"ABR",
|
||||
pp::app::BrushPackageImportKind::abr,
|
||||
path);
|
||||
if (!status.ok())
|
||||
LOG("ABR import failed: %s", status.message);
|
||||
pp::panopainter::close_legacy_dialog_node(*target);
|
||||
};
|
||||
route);
|
||||
}
|
||||
|
||||
void prompt_import_ppbr(const pp::app::DocumentOpenRoute& route) override
|
||||
{
|
||||
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) {
|
||||
const auto status = pp::panopainter::execute_legacy_brush_package_import(
|
||||
*app,
|
||||
prompt_import_brush_package(
|
||||
app_,
|
||||
"Import PPBR",
|
||||
"PPBR",
|
||||
pp::app::BrushPackageImportKind::ppbr,
|
||||
path);
|
||||
if (!status.ok())
|
||||
LOG("PPBR import failed: %s", status.message);
|
||||
pp::panopainter::close_legacy_dialog_node(*target);
|
||||
};
|
||||
route);
|
||||
}
|
||||
|
||||
void open_project_now(const pp::app::DocumentOpenRoute& route) override
|
||||
|
||||
Reference in New Issue
Block a user