mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
[plugin] Exporter: add info messages with status (#9166)
This commit is contained in:
@@ -177,13 +177,23 @@ function Exporter:exportClippings(clippings)
|
|||||||
local export_callback = function()
|
local export_callback = function()
|
||||||
UIManager:nextTick(function()
|
UIManager:nextTick(function()
|
||||||
local timestamp = os.time()
|
local timestamp = os.time()
|
||||||
|
local statuses = {}
|
||||||
for k, v in pairs(self.targets) do
|
for k, v in pairs(self.targets) do
|
||||||
if v:isEnabled() then
|
if v:isEnabled() then
|
||||||
v.timestamp = timestamp
|
v.timestamp = timestamp
|
||||||
v:export(exportables)
|
local status = v:export(exportables)
|
||||||
|
if status then
|
||||||
|
table.insert(statuses, _(v.name .. ": Exported to " ) .. v:getFilePath(exportables))
|
||||||
|
else
|
||||||
|
table.insert(statuses, _(v.name .. ": Failed to export."))
|
||||||
|
end
|
||||||
v.timestamp = nil
|
v.timestamp = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
UIManager:show(InfoMessage:new{
|
||||||
|
text = table.concat(statuses, "\n"),
|
||||||
|
timeout = 3,
|
||||||
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
UIManager:show(InfoMessage:new {
|
UIManager:show(InfoMessage:new {
|
||||||
|
|||||||
Reference in New Issue
Block a user