mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Avoid writting highlights into read-only PDFs (#5889)
This commit is contained in:
@@ -1167,8 +1167,20 @@ end
|
||||
--]]
|
||||
|
||||
function ReaderHighlight:exportToDocument(page, item)
|
||||
local setting = G_reader_settings:readSetting("save_document")
|
||||
if setting == "disable" then return end
|
||||
logger.dbg("export highlight to document", item)
|
||||
self.ui.document:saveHighlight(page, item)
|
||||
local can_write = self.ui.document:saveHighlight(page, item)
|
||||
if can_write == false and not self.warned_once then
|
||||
self.warned_once = true
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = _([[
|
||||
Highlights in this document will be saved in the settings file, but they won't be written in the document itself because the file is in a read-only location.
|
||||
|
||||
If you wish your highlights to be saved in the document, just move it to a writable directory first.]]),
|
||||
timeout = 5,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderHighlight:addNote()
|
||||
|
||||
Reference in New Issue
Block a user