From c71167fc6bd0a90dba8ba73d7e63cd9529c23470 Mon Sep 17 00:00:00 2001 From: Utsob Roy Date: Sat, 4 Jun 2022 13:37:26 +0600 Subject: [PATCH] [plugin] Exporter: add info messages with status (#9166) --- plugins/exporter.koplugin/main.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/exporter.koplugin/main.lua b/plugins/exporter.koplugin/main.lua index c1058b541..93a5ea654 100644 --- a/plugins/exporter.koplugin/main.lua +++ b/plugins/exporter.koplugin/main.lua @@ -177,13 +177,23 @@ function Exporter:exportClippings(clippings) local export_callback = function() UIManager:nextTick(function() local timestamp = os.time() + local statuses = {} for k, v in pairs(self.targets) do if v:isEnabled() then 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 end end + UIManager:show(InfoMessage:new{ + text = table.concat(statuses, "\n"), + timeout = 3, + }) end) UIManager:show(InfoMessage:new {