Thin app dialog and renderer adapter ownership
This commit is contained in:
@@ -43,21 +43,7 @@ void wire_document_save_dialog_buttons(
|
||||
{
|
||||
dialog->btn_ok->on_click = [&app, dialog](Node*)
|
||||
{
|
||||
std::string name = dialog->input->m_text;
|
||||
const auto plan = pp::app::plan_document_file_save(
|
||||
app.work_path,
|
||||
name,
|
||||
[](const std::string& path) {
|
||||
return Asset::exist(path);
|
||||
});
|
||||
if (!plan)
|
||||
{
|
||||
app.message_box("Warning", "You need to specify a name to file.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto status =
|
||||
pp::panopainter::execute_legacy_document_file_save_plan(app, plan.value(), dialog);
|
||||
const auto status = pp::panopainter::execute_legacy_document_file_save_dialog(app, dialog);
|
||||
if (!status.ok())
|
||||
LOG("Document file save action failed: %s", status.message);
|
||||
};
|
||||
@@ -67,24 +53,6 @@ void wire_document_save_dialog_buttons(
|
||||
};
|
||||
}
|
||||
|
||||
void save_document_version(App& app)
|
||||
{
|
||||
const auto target = pp::app::find_next_document_version_target(
|
||||
app.doc_dir,
|
||||
app.doc_name,
|
||||
[](const std::string& path) {
|
||||
return Asset::exist(path);
|
||||
});
|
||||
if (!target) {
|
||||
app.message_box("Saving Error", target.status().message);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto status = pp::panopainter::execute_legacy_document_version_save(app, target.value());
|
||||
if (!status.ok())
|
||||
LOG("Document version save action failed: %s", status.message);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void App::continue_document_workflow_after_optional_save(std::function<void()> action)
|
||||
@@ -247,7 +215,9 @@ void App::dialog_save_ver()
|
||||
return;
|
||||
}
|
||||
|
||||
save_document_version(*this);
|
||||
const auto status = pp::panopainter::execute_legacy_document_version_save_dialog(*this);
|
||||
if (!status.ok())
|
||||
LOG("Document version save action failed: %s", status.message);
|
||||
}
|
||||
|
||||
void App::save_document(pp::app::DocumentSaveIntent intent)
|
||||
|
||||
Reference in New Issue
Block a user