This commit is contained in:
Kovid Goyal 2016-10-11 19:20:03 +05:30
parent e333001d31
commit 020cb2eeb8
2 changed files with 17 additions and 12 deletions

View File

@ -366,10 +366,12 @@ class DeleteAction(InterfaceAction):
self.remove_matching_books_from_device() self.remove_matching_books_from_device()
# The following will run if the selected books are not on a connected device. # The following will run if the selected books are not on a connected device.
# The user has selected to delete from the library or the device and library. # The user has selected to delete from the library or the device and library.
if not confirm('<p>'+_('The %d selected book(s) will be ' if not confirm('<p>'+ngettext(
'<b>permanently deleted</b> and the files ' 'The selected book will be <b>permanently deleted</b> and the files '
'removed from your calibre library. Are you sure?')%len(to_delete_ids) + 'removed from your calibre library. Are you sure?',
'</p>', 'library_delete_books', self.gui): 'The {} selected books will be <b>permanently deleted</b> and the files '
'removed from your calibre library. Are you sure?', len(to_delete_ids)).format(len(to_delete_ids)),
'library_delete_books', self.gui):
return return
if len(to_delete_ids) < 5: if len(to_delete_ids) < 5:
try: try:
@ -413,10 +415,10 @@ class DeleteAction(InterfaceAction):
view = self.gui.card_b_view view = self.gui.card_b_view
paths = view.model().paths(rows) paths = view.model().paths(rows)
ids = view.model().indices(rows) ids = view.model().indices(rows)
if not confirm('<p>'+_('The %d selected book(s) will be ' if not confirm('<p>'+ngettext(
'<b>permanently deleted</b> ' 'The selected book will be <b>permanently deleted</b> from your device. Are you sure?',
'from your device. Are you sure?')%len(paths) + 'The {} selected books will be <b>permanently deleted</b> from your device. Are you sure?', len(paths)).format(len(paths)),
'</p>', 'device_delete_books', self.gui): 'device_delete_books', self.gui):
return return
job = self.gui.remove_paths(paths) job = self.gui.remove_paths(paths)
self.delete_memory[job] = (paths, view.model()) self.delete_memory[job] = (paths, view.model())

View File

@ -12,7 +12,7 @@ from functools import partial
from threading import Thread from threading import Thread
from PyQt5.Qt import (QIcon, QDialog, from PyQt5.Qt import (QIcon, QDialog,
QDialogButtonBox, QLabel, QGridLayout, QPixmap, Qt) QDialogButtonBox, QLabel, QGridLayout, Qt)
from calibre.gui2.threaded_jobs import ThreadedJob from calibre.gui2.threaded_jobs import ThreadedJob
from calibre.ebooks.metadata.opf2 import metadata_to_opf from calibre.ebooks.metadata.opf2 import metadata_to_opf
@ -62,12 +62,15 @@ class ConfirmDialog(QDialog):
self.setLayout(l) self.setLayout(l)
i = QLabel(self) i = QLabel(self)
i.setPixmap(QPixmap(I('download-metadata.png'))) i.setPixmap(QIcon(I('download-metadata.png')).pixmap(128, 128))
l.addWidget(i, 0, 0) l.addWidget(i, 0, 0)
t = ngettext(
'The download of metadata for the <b>selected book</b> will run in the background. Proceed?',
'The download of metadata for the <b>{} selected books</b> will run in the background. Proceed?',
len(ids)).format(len(ids))
t = QLabel( t = QLabel(
'<p>'+_('The download of metadata for the <b>%d selected book(s)</b> will' '<p>'+ t +
' run in the background. Proceed?')%len(ids) +
'<p>'+_('You can monitor the progress of the download ' '<p>'+_('You can monitor the progress of the download '
'by clicking the rotating spinner in the bottom right ' 'by clicking the rotating spinner in the bottom right '
'corner.') + 'corner.') +