[UX] FileManager: add ConfirmBox for purge .sdr

Notified of destructive action without confirmation in https://www.mobileread.com/forums/showthread.php?p=3566978#post3566978
pull/3094/head
Frans de Jonge 7 years ago
parent 2ba079e3eb
commit 6bdb96c0f8

@ -141,6 +141,11 @@ function FileManager:init()
text = _("Purge .sdr"),
enabled = DocSettings:hasSidecarFile(util.realpath(file)),
callback = function()
local ConfirmBox = require("ui/widget/confirmbox")
UIManager:show(ConfirmBox:new{
text = util.template(_("Purge .sdr to reset settings for this document?\n\n%1"), self.file_dialog.title),
ok_text = _("Purge"),
ok_callback = function()
local file_abs_path = util.realpath(file)
if file_abs_path then
local autoremove_deleted_items_from_history = G_reader_settings:readSetting("autoremove_deleted_items_from_history") or false
@ -157,6 +162,8 @@ function FileManager:init()
end
UIManager:close(self.file_dialog)
end,
})
end,
},
},
{

Loading…
Cancel
Save