Report partial failures in success panel

This commit is contained in:
Kovid Goyal 2016-10-13 10:26:35 +05:30
parent a2f3490aca
commit b99141eaf8

View File

@ -185,8 +185,11 @@ class DownloadResources(Dialog):
self.state = 2 self.state = 2
self.wait.msg = _('Updating resources in book...') self.wait.msg = _('Updating resources in book...')
self.wait.start() self.wait.start()
self.success.setText('<p style="text-align:center">' + ngettext( t = ngettext(
'Successfully processed the external resource', 'Successfully processed {} external resources', len(replacements)).format(len(replacements))) 'Successfully processed the external resource', 'Successfully processed {} external resources', len(replacements)).format(len(replacements))
if failures:
t += '<br>' + ngettext('Could not download one image', 'Could not download {} images', len(failures)).format(len(failures))
self.success.setText('<p style="text-align:center">' + t)
resources = self.choose_resources.resources resources = self.choose_resources.resources
t = Thread(name='ReplaceResources', target=self.replace_resources, args=(resources, replacements)) t = Thread(name='ReplaceResources', target=self.replace_resources, args=(resources, replacements))
t.daemon = True t.daemon = True