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);
|
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()
|
void App::dialog_save_ver()
|
||||||
{
|
{
|
||||||
if (!check_license())
|
if (!check_license())
|
||||||
@@ -433,20 +451,7 @@ void App::dialog_save_ver()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto target = pp::app::find_next_document_version_target(
|
save_document_version(*this);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::save_document(pp::app::DocumentSaveIntent intent)
|
void App::save_document(pp::app::DocumentSaveIntent intent)
|
||||||
|
|||||||
Reference in New Issue
Block a user