Edit Book: Fix check external links tool not detecting changes that have not yet been saved

This commit is contained in:
Kovid Goyal 2016-11-04 11:51:10 +05:30
parent 9a82de7b6e
commit 54baf662b5
2 changed files with 4 additions and 1 deletions

View File

@ -1300,6 +1300,7 @@ class Boss(QObject):
def check_external_links(self): def check_external_links(self):
if self.ensure_book(_('You must first open a book in order to check links.')): 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() self.gui.check_external_links.show()
def compress_images(self): def compress_images(self):

View File

@ -115,7 +115,9 @@ class CheckExternalLinks(Dialog):
self.pb.setMaximum(total), self.pb.setValue(curr) self.pb.setMaximum(total), self.pb.setValue(curr)
def populate_results(self, preserve_pos=False): def populate_results(self, preserve_pos=False):
text = '<h3>%s</h3><ol>' % (_('Found %d broken links') % (len(self.errors) - len(self.fixed_errors))) num = len(self.errors) - len(self.fixed_errors)
text = '<h3>%s</h3><ol>' % (ngettext(
'Found a broken link', 'Found {} broken links', num).format(num))
for i, (locations, err, url) in enumerate(self.errors): for i, (locations, err, url) in enumerate(self.errors):
if i in self.fixed_errors: if i in self.fixed_errors:
continue continue