From 54baf662b5446c72370fbc58421f7ae5f9c1f3ad Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Nov 2016 11:51:10 +0530 Subject: [PATCH] Edit Book: Fix check external links tool not detecting changes that have not yet been saved --- src/calibre/gui2/tweak_book/boss.py | 1 + src/calibre/gui2/tweak_book/check_links.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index 0162b5c9c5..8f55948936 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1300,6 +1300,7 @@ class Boss(QObject): def check_external_links(self): if self.ensure_book(_('You must first open a book in order to check links.')): + self.commit_all_editors_to_container() self.gui.check_external_links.show() def compress_images(self): diff --git a/src/calibre/gui2/tweak_book/check_links.py b/src/calibre/gui2/tweak_book/check_links.py index 02a6f871cc..c4e7be5f4e 100644 --- a/src/calibre/gui2/tweak_book/check_links.py +++ b/src/calibre/gui2/tweak_book/check_links.py @@ -115,7 +115,9 @@ class CheckExternalLinks(Dialog): self.pb.setMaximum(total), self.pb.setValue(curr) def populate_results(self, preserve_pos=False): - text = '

%s

    ' % (_('Found %d broken links') % (len(self.errors) - len(self.fixed_errors))) + num = len(self.errors) - len(self.fixed_errors) + text = '

    %s

      ' % (ngettext( + 'Found a broken link', 'Found {} broken links', num).format(num)) for i, (locations, err, url) in enumerate(self.errors): if i in self.fixed_errors: continue