Dictionary: Fix download message when connection fails (#11548)

reviewable/pr11552/r1
Jo Van Bulck 2 months ago committed by GitHub
parent 95ce974ef9
commit 4d19ce24ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1114,15 +1114,24 @@ function ReaderDictionary:downloadDictionary(dict, download_location, continue)
--logger.dbg(headers) --logger.dbg(headers)
file_size = headers and headers["content-length"] file_size = headers and headers["content-length"]
UIManager:show(ConfirmBox:new{ if file_size then
text = T(_("Dictionary filesize is %1 (%2 bytes). Continue with download?"), util.getFriendlySize(file_size), util.getFormattedSize(file_size)), UIManager:show(ConfirmBox:new{
ok_text = _("Download"), text = T(_("Dictionary filesize is %1 (%2 bytes). Continue with download?"), util.getFriendlySize(file_size), util.getFormattedSize(file_size)),
ok_callback = function() ok_text = _("Download"),
-- call ourselves with continue = true ok_callback = function()
self:downloadDictionary(dict, download_location, true) -- call ourselves with continue = true
end, self:downloadDictionary(dict, download_location, true)
}) end,
return })
return
else
logger.dbg("ReaderDictionary: Request failed; response headers:", headers)
UIManager:show(InfoMessage:new{
text = _("Failed to fetch dictionary. Are you online?"),
--timeout = 3,
})
return false
end
else else
UIManager:nextTick(function() UIManager:nextTick(function()
UIManager:show(InfoMessage:new{ UIManager:show(InfoMessage:new{

Loading…
Cancel
Save