OPDS: Add a button to display an entry's content block in the download popup (#7767)

reviewable/pr7776/r1
hius07 3 years ago committed by GitHub
parent 4973134fb6
commit d5a2df3c04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -612,6 +612,7 @@ end
function OPDSBrowser:createNewDownloadDialog(path, buttons)
self.download_dialog = ButtonDialogTitle:new{
title = T(_("Download folder:\n%1\n\nDownload file type:"), BD.dirpath(path)),
use_info_style = true,
buttons = buttons
}
end
@ -650,10 +651,10 @@ function OPDSBrowser:showDownloads(item)
table.insert(buttons, line)
end
table.insert(buttons, {})
-- Set download folder button.
-- Set download folder and book info buttons.
table.insert(buttons, {
{
text = _("Select another folder"),
text = _("Select folder"),
callback = function()
require("ui/downloadmgr"):new{
onConfirm = function(path)
@ -667,7 +668,18 @@ function OPDSBrowser:showDownloads(item)
end,
}:chooseDir()
end,
}
},
{
text = _("Book information"),
enabled = type(item.content) == "string",
callback = function()
local TextViewer = require("ui/widget/textviewer")
UIManager:show(TextViewer:new{
title = item.text,
text = util.htmlToPlainTextIfHtml(item.content),
})
end,
},
})
self:createNewDownloadDialog(self.getCurrentDownloadDir(), buttons)

Loading…
Cancel
Save