Extract document-session save-version dialog helper
This commit is contained in:
@@ -425,6 +425,24 @@ void App::dialog_browse()
|
||||
continue_document_workflow_after_optional_save(show_dialog);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void App::dialog_save_ver()
|
||||
{
|
||||
if (!check_license())
|
||||
@@ -433,20 +451,7 @@ void App::dialog_save_ver()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto target = pp::app::find_next_document_version_target(
|
||||
doc_dir,
|
||||
doc_name,
|
||||
[](const std::string& path) {
|
||||
return Asset::exist(path);
|
||||
});
|
||||
if (!target) {
|
||||
message_box("Saving Error", target.status().message);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto status = pp::panopainter::execute_legacy_document_version_save(*this, target.value());
|
||||
if (!status.ok())
|
||||
LOG("Document version save action failed: %s", status.message);
|
||||
save_document_version(*this);
|
||||
}
|
||||
|
||||
void App::save_document(pp::app::DocumentSaveIntent intent)
|
||||
|
||||
Reference in New Issue
Block a user