From 29e9a866192f274ea6b7455d9f85d8e4a1a1e55c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Jan 2022 12:02:33 +0530 Subject: [PATCH] Show number of files to be pasted from other instance --- src/calibre/gui2/tweak_book/file_list.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/file_list.py b/src/calibre/gui2/tweak_book/file_list.py index c04994f329..e72d3483c6 100644 --- a/src/calibre/gui2/tweak_book/file_list.py +++ b/src/calibre/gui2/tweak_book/file_list.py @@ -683,7 +683,12 @@ class FileList(QTreeWidget, OpenWithHandler): m.addSeparator() md = QApplication.instance().clipboard().mimeData() if md.hasUrls() and md.hasFormat(FILE_COPY_MIME): - m.addAction(_('Paste files from other editor instance'), self.paste_from_other_instance) + import json + name_map = json.loads(bytes(md.data(FILE_COPY_MIME))) + m.addAction(ngettext( + _('Paste file from other editor instance'), + _('Paste {} files from other editor instance'), + len(name_map)).format(len(name_map)), self.paste_from_other_instance) selected_map = defaultdict(list) for item in sel: