Centralize retained document session dialog closing

This commit is contained in:
2026-06-12 15:54:39 +02:00
parent 08f6515468
commit 6470c6a6a8
3 changed files with 15 additions and 9 deletions

View File

@@ -534,6 +534,10 @@ agent or engineer to remove them without reconstructing context from chat.
- 2026-06-12: DEBT-0063/DEBT-0058 were narrowed again. Open/Browse - 2026-06-12: DEBT-0063/DEBT-0058 were narrowed again. Open/Browse
delete-confirmation message boxes and shared destroy-on-click bindings now delete-confirmation message boxes and shared destroy-on-click bindings now
use the retained dialog close helper in `src/legacy_ui_overlay_services.*`. use the retained dialog close helper in `src/legacy_ui_overlay_services.*`.
- 2026-06-12: DEBT-0063/DEBT-0040/DEBT-0041/DEBT-0042 were narrowed again.
Document-session overwrite prompts, unsaved-close prompts, save-before-workflow
prompts, and accepted new/save document cleanup now route retained dialog
closing through `src/legacy_ui_overlay_services.*`.
- 2026-06-05: DEBT-0011 was narrowed. The Windows app package smoke target now - 2026-06-05: DEBT-0011 was narrowed. The Windows app package smoke target now
passes the configure-time CMake executable into `package-smoke.ps1`, so VS passes the configure-time CMake executable into `package-smoke.ps1`, so VS
2026 generator validation does not depend on an older `cmake` on PATH, and 2026 generator validation does not depend on an older `cmake` on PATH, and

View File

@@ -508,6 +508,9 @@ Browse accept, resize accept/failure, and what's-new read-later/close callbacks
now use a named retained dialog close helper instead of direct `destroy()` calls. now use a named retained dialog close helper instead of direct `destroy()` calls.
Open/Browse delete-confirmation message boxes and shared destroy-on-click Open/Browse delete-confirmation message boxes and shared destroy-on-click
bindings now use that same retained dialog close helper. bindings now use that same retained dialog close helper.
Document-session overwrite, unsaved-close, save-before-workflow, and accepted
new/save document cleanup now route retained dialog closing through the same
helpers.
Raw popup callback captures and full close/capture ownership remain part of Raw popup callback captures and full close/capture ownership remain part of
`DEBT-0063`. `DEBT-0063`.
`pano_cli inspect-image` exposes PNG IHDR metadata as JSON, `pano_cli inspect-image` exposes PNG IHDR metadata as JSON,

View File

@@ -7,6 +7,7 @@
#include "legacy_document_canvas_services.h" #include "legacy_document_canvas_services.h"
#include "legacy_canvas_view_services.h" #include "legacy_canvas_view_services.h"
#include "legacy_history_services.h" #include "legacy_history_services.h"
#include "legacy_ui_overlay_services.h"
#include "node_dialog_open.h" #include "node_dialog_open.h"
#include <utility> #include <utility>
@@ -117,8 +118,7 @@ void create_legacy_new_document(
app.canvas->m_canvas->m_newdoc = false; app.canvas->m_canvas->m_newdoc = false;
app.title_update(); app.title_update();
dialog->destroy(); pp::panopainter::close_legacy_dialog_and_hide_keyboard(app, *dialog);
App::I->hideKeyboard();
} }
class LegacyNewDocumentServices final : public pp::app::NewDocumentServices { class LegacyNewDocumentServices final : public pp::app::NewDocumentServices {
@@ -144,7 +144,7 @@ public:
auto dialog = dialog_; auto dialog = dialog_;
msgbox->btn_ok->on_click = [app, msgbox, dialog, plan](Node*) { msgbox->btn_ok->on_click = [app, msgbox, dialog, plan](Node*) {
create_legacy_new_document(*app, plan, dialog); create_legacy_new_document(*app, plan, dialog);
msgbox->destroy(); pp::panopainter::close_legacy_dialog_node(*msgbox);
}; };
} }
@@ -163,8 +163,7 @@ void save_legacy_document_file(
app.doc_path = plan.target.path; app.doc_path = plan.target.path;
app.doc_dir = plan.target.directory; app.doc_dir = plan.target.directory;
app.title_update(); app.title_update();
dialog->destroy(); pp::panopainter::close_legacy_dialog_and_hide_keyboard(app, *dialog);
App::I->hideKeyboard();
} }
class LegacyDocumentFileSaveServices final : public pp::app::DocumentFileSaveServices { class LegacyDocumentFileSaveServices final : public pp::app::DocumentFileSaveServices {
@@ -191,7 +190,7 @@ public:
auto dialog = dialog_; auto dialog = dialog_;
msgbox->btn_ok->on_click = [app, msgbox, dialog, plan](Node*) { msgbox->btn_ok->on_click = [app, msgbox, dialog, plan](Node*) {
save_legacy_document_file(*app, plan, dialog); save_legacy_document_file(*app, plan, dialog);
msgbox->destroy(); pp::panopainter::close_legacy_dialog_node(*msgbox);
}; };
} }
@@ -245,7 +244,7 @@ public:
Canvas::I->m_unsaved = false; Canvas::I->m_unsaved = false;
}; };
m->btn_cancel->on_click = [dialog_already_opened, m](Node*) { m->btn_cancel->on_click = [dialog_already_opened, m](Node*) {
m->destroy(); pp::panopainter::close_legacy_dialog_node(*m);
*dialog_already_opened = false; *dialog_already_opened = false;
}; };
dialog_already_opened_ = true; dialog_already_opened_ = true;
@@ -313,11 +312,11 @@ public:
app->message_box(plan.title, plan.message, plan.show_cancel); app->message_box(plan.title, plan.message, plan.show_cancel);
} }
}); });
m->destroy(); pp::panopainter::close_legacy_dialog_node(*m);
}; };
m->btn_cancel->on_click = [m, action](Node*) { m->btn_cancel->on_click = [m, action](Node*) {
action(); action();
m->destroy(); pp::panopainter::close_legacy_dialog_node(*m);
}; };
} }