Translator: copy translation to clipboard or save to note (#8669)

This commit is contained in:
hius07
2022-01-16 21:54:08 +02:00
committed by GitHub
parent 8b43811812
commit 2a244278e3
3 changed files with 100 additions and 23 deletions

View File

@@ -993,7 +993,7 @@ function ReaderBookmark:updateBookmark(item)
end
end
function ReaderBookmark:renameBookmark(item, from_highlight, is_new_note)
function ReaderBookmark:renameBookmark(item, from_highlight, is_new_note, new_text)
local bookmark
if from_highlight then
-- Called by ReaderHighlight:editHighlight, we need to find the bookmark
@@ -1017,10 +1017,18 @@ function ReaderBookmark:renameBookmark(item, from_highlight, is_new_note)
else
bookmark = item
end
local input_text = bookmark.text_orig
if new_text then
if self:isBookmarkAutoText(bookmark) then
input_text = new_text
else
input_text = input_text .. "\n\n" .. new_text
end
end
self.input = InputDialog:new{
title = _("Edit note"),
description = " " .. T(_("Page: %1"), bookmark.mandatory) .. " " .. T(_("Time: %1"), bookmark.datetime),
input = bookmark.text_orig,
input = input_text,
allow_newline = true,
add_scroll_buttons = true,
use_available_height = true,