Centralize retained dialog destroy callbacks
This commit is contained in:
@@ -263,7 +263,7 @@ void App::dialog_browse()
|
||||
if (dialog->is_selected())
|
||||
{
|
||||
open_document(dialog->selected_path);
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -418,13 +418,13 @@ void App::dialog_resize()
|
||||
dialog->combo ? dialog->combo->m_current_index : 0);
|
||||
if (!plan)
|
||||
{
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
return;
|
||||
}
|
||||
const auto status = pp::panopainter::execute_legacy_document_resize_plan(*this, plan.value());
|
||||
if (!status.ok())
|
||||
LOG("Document resize failed: %s", status.message);
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -639,12 +639,12 @@ void App::dialog_whatsnew(bool force_show)
|
||||
whatsnew->add_button("Read Later", 120, [this, whatsnew](Node*) {
|
||||
Settings::unset("whatsnew-id");
|
||||
Settings::save();
|
||||
whatsnew->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*whatsnew);
|
||||
});
|
||||
whatsnew->add_button("Close", 100, [this, whatsnew](Node*) {
|
||||
Settings::set<Serializer::Integer>("whatsnew-id", whatsnew->m_page_id);
|
||||
Settings::save();
|
||||
whatsnew->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*whatsnew);
|
||||
});
|
||||
if (force_show)
|
||||
(void)pp::panopainter::attach_legacy_overlay_node(*this, whatsnew);
|
||||
|
||||
Reference in New Issue
Block a user