Bridge app dialog creation

This commit is contained in:
2026-06-05 09:53:53 +02:00
parent f225a81ec4
commit d9f294e8e6
7 changed files with 118 additions and 40 deletions

View File

@@ -6,6 +6,7 @@
#include "app_core/document_export.h"
#include "app_core/document_session.h"
#include "legacy_document_canvas_services.h"
#include "legacy_app_dialog_services.h"
#include "legacy_brush_package_export_services.h"
#include "legacy_document_export_services.h"
#include "legacy_document_layer_services.h"
@@ -124,36 +125,13 @@ void start_document_export_collection(
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);
auto pb = std::make_shared<NodeProgressBar>();
pb->set_manager(&layout);
pb->init();
pb->create();
pb->loaded();
pb->m_progress->SetWidthP(plan.progress_fraction);
pb->m_title->set_text(plan.title.c_str());
pb->m_total = plan.total;
pb->m_count = plan.count;
layout[main_id]->add_child(pb);
return pb;
return pp::panopainter::create_legacy_app_progress_dialog(*this, plan);
}
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);
auto m = std::make_shared<NodeMessageBox>();
m->set_manager(&layout);
m->init();
m->create();
m->loaded();
m->m_title->set_text(plan.title.c_str());
m->m_message->set_text(plan.message.c_str());
m->btn_ok->m_text->set_text(plan.ok_caption.c_str());
if (plan.show_cancel)
m->btn_cancel->m_text->set_text(plan.cancel_caption.c_str());
else
m->btn_cancel->destroy();
layout[main_id]->add_child(m);
return m;
return pp::panopainter::create_legacy_app_message_dialog(*this, plan);
}
std::shared_ptr<NodeInputBox> App::input_box(const std::string& title,
@@ -164,17 +142,7 @@ std::shared_ptr<NodeInputBox> App::input_box(const std::string& title,
LOG("input dialog skipped: %s", plan_result.status().message);
return nullptr;
}
const auto& plan = plan_result.value();
auto m = std::make_shared<NodeInputBox>();
m->set_manager(&layout);
m->init();
m->create();
m->loaded();
m->m_title->set_text(plan.title.c_str());
m->m_field_name->set_text(plan.field_name.c_str());
m->btn_ok->m_text->set_text(plan.ok_caption.c_str());
layout[main_id]->add_child(m);
return m;
return pp::panopainter::create_legacy_app_input_dialog(*this, plan_result.value());
}
void App::dialog_usermanual()