readerrolling: bookmark warn text

This commit is contained in:
hius07
2025-03-10 18:15:01 +02:00
committed by GitHub
parent a614577c56
commit e2a33a0946

View File

@@ -308,18 +308,17 @@ end
function ReaderRolling:onCheckDomStyleCoherence()
if self.ui.document and self.ui.document:isBuiltDomStale() then
local has_bookmarks_warn = self.using_non_normalized_xpointers and self.ui.annotation:hasAnnotations()
self:showReloadConfirmBox(has_bookmarks_warn)
-- When using an older DOM version, bookmarks may break
local bookmarks_warn_txt = self.using_non_normalized_xpointers and self.ui.annotation:hasAnnotations()
and _("\nNote that this change in styles may render your bookmarks or highlights no more valid.\nIf some of them do not show anymore, you can just revert the change you just made to have them shown again.\n\n")
self:showReloadConfirmBox(bookmarks_warn_txt)
end
end
function ReaderRolling:showReloadConfirmBox(has_bookmarks_warn)
local has_bookmarks_warn_txt = has_bookmarks_warn
and _("\nNote that this change in styles may render your bookmarks or highlights no more valid.\nIf some of them do not show anymore, you can just revert the change you just made to have them shown again.\n\n")
or ""
function ReaderRolling:showReloadConfirmBox(warn_txt)
UIManager:show(ConfirmBox:new{
text = T(_("Styles have changed in such a way that fully reloading the document may be needed for a correct rendering.\n%1Do you want to reload the document?"),
has_bookmarks_warn_txt),
warn_txt or ""),
ok_callback = function()
-- Allow for ConfirmBox to be closed before showing
-- "Opening file" InfoMessage