Thin legacy app dialog shell

This commit is contained in:
2026-06-17 00:14:25 +02:00
parent 371095770d
commit 86e57d47ad
3 changed files with 55 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
#include "pch.h"
#include "app.h"
#include "app_core/app_dialog.h"
#include "legacy_app_dialog_services.h"
#include "legacy_document_layer_services.h"
@@ -27,28 +26,18 @@ void open_legacy_document_layer_rename_dialog(App& app);
std::shared_ptr<NodeProgressBar> App::show_progress(const std::string& title, int total /*= 0*/)
{
const auto plan = pp::app::plan_app_progress_dialog(title, total);
const auto dialogs = pp::panopainter::make_legacy_app_dialog_factory(*this);
return pp::panopainter::legacy_progress_dialog_node(dialogs->show_progress_dialog(plan));
return pp::panopainter::show_legacy_app_progress_dialog(*this, title, total);
}
std::shared_ptr<NodeMessageBox> App::message_box(const std::string &title, const std::string& text, bool cancel_button)
{
const auto plan = pp::app::plan_app_message_dialog(title, text, cancel_button);
const auto dialogs = pp::panopainter::make_legacy_app_dialog_factory(*this);
return pp::panopainter::legacy_message_dialog_node(dialogs->show_message_dialog(plan));
return pp::panopainter::show_legacy_app_message_dialog(*this, title, text, cancel_button);
}
std::shared_ptr<NodeInputBox> App::input_box(const std::string& title,
const std::string& field_name, const std::string& ok_caption /*= "Ok"*/)
{
const auto plan_result = pp::app::plan_app_input_dialog(title, field_name, ok_caption);
if (!plan_result) {
LOG("input dialog skipped: %s", plan_result.status().message);
return nullptr;
}
const auto dialogs = pp::panopainter::make_legacy_app_dialog_factory(*this);
return pp::panopainter::legacy_input_dialog_node(dialogs->show_input_dialog(plan_result.value()));
return pp::panopainter::show_legacy_app_input_dialog(*this, title, field_name, ok_caption);
}
void App::dialog_usermanual()