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
|
## 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-
|
- 2026-06-15: `DEBT-0038` was narrowed again. The retained cloud downloaded-
|
||||||
project open camera reset and layer-clear setup in
|
project open camera reset and layer-clear setup in
|
||||||
`execute_legacy_downloaded_project_open()` now routes through a focused
|
`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
|
`src/legacy_brush_package_import_services.*`, preserving detached legacy preset
|
||||||
panel import threads while retained brush asset execution remains tracked under
|
panel import threads while retained brush asset execution remains tracked under
|
||||||
`DEBT-0048`.
|
`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::request_close`, `App::save_document`, and
|
||||||
`App::continue_document_workflow_after_optional_save` now route through
|
`App::continue_document_workflow_after_optional_save` now route through
|
||||||
app-core document-session executors and `src/legacy_document_session_services.*`,
|
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();
|
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 {
|
class LegacyDocumentOpenServices final : public pp::app::DocumentOpenServices {
|
||||||
public:
|
public:
|
||||||
explicit LegacyDocumentOpenServices(App& app) noexcept
|
explicit LegacyDocumentOpenServices(App& app) noexcept
|
||||||
@@ -95,32 +111,22 @@ public:
|
|||||||
|
|
||||||
void prompt_import_abr(const pp::app::DocumentOpenRoute& route) override
|
void prompt_import_abr(const pp::app::DocumentOpenRoute& route) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
prompt_import_brush_package(
|
||||||
auto mb = app_.message_box("Import ABR", "Would you like to import the brushes?", true);
|
app_,
|
||||||
mb->on_submit = [app, path = route.path](Node* target) {
|
"Import ABR",
|
||||||
const auto status = pp::panopainter::execute_legacy_brush_package_import(
|
"ABR",
|
||||||
*app,
|
|
||||||
pp::app::BrushPackageImportKind::abr,
|
pp::app::BrushPackageImportKind::abr,
|
||||||
path);
|
route);
|
||||||
if (!status.ok())
|
|
||||||
LOG("ABR import failed: %s", status.message);
|
|
||||||
pp::panopainter::close_legacy_dialog_node(*target);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void prompt_import_ppbr(const pp::app::DocumentOpenRoute& route) override
|
void prompt_import_ppbr(const pp::app::DocumentOpenRoute& route) override
|
||||||
{
|
{
|
||||||
auto* app = &app_;
|
prompt_import_brush_package(
|
||||||
auto mb = app_.message_box("Import PPBR", "Would you like to import the brushes?", true);
|
app_,
|
||||||
mb->on_submit = [app, path = route.path](Node* target) {
|
"Import PPBR",
|
||||||
const auto status = pp::panopainter::execute_legacy_brush_package_import(
|
"PPBR",
|
||||||
*app,
|
|
||||||
pp::app::BrushPackageImportKind::ppbr,
|
pp::app::BrushPackageImportKind::ppbr,
|
||||||
path);
|
route);
|
||||||
if (!status.ok())
|
|
||||||
LOG("PPBR import failed: %s", status.message);
|
|
||||||
pp::panopainter::close_legacy_dialog_node(*target);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void open_project_now(const pp::app::DocumentOpenRoute& route) override
|
void open_project_now(const pp::app::DocumentOpenRoute& route) override
|
||||||
|
|||||||
Reference in New Issue
Block a user