Show only 1 End Document Dialog at a time

if scrolling past the end of a document the EndOfBook event get fired once per scroll (a lot)
reviewable/pr7046/r1
yparitcher 3 years ago
parent c3fd6ae38b
commit 405c48b6ea

@ -60,7 +60,7 @@ function ReaderStatus:onEndOfBook()
self:onMarkBook(true) self:onMarkBook(true)
end end
if settings == "pop-up" or settings == nil then if (settings == "pop-up" or settings == nil) and UIManager:getTopWidget() ~= "end_document" then
local buttons = { local buttons = {
{ {
{ {
@ -128,6 +128,7 @@ function ReaderStatus:onEndOfBook()
}, },
} }
choose_action = ButtonDialogTitle:new{ choose_action = ButtonDialogTitle:new{
name = "end_document",
title = _("You've reached the end of the document.\nWhat would you like to do?"), title = _("You've reached the end of the document.\nWhat would you like to do?"),
title_align = "center", title_align = "center",
buttons = buttons, buttons = buttons,

Loading…
Cancel
Save