diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py
index c690cc430d..fd4d3e44fb 100644
--- a/src/calibre/gui2/tweak_book/boss.py
+++ b/src/calibre/gui2/tweak_book/boss.py
@@ -705,13 +705,13 @@ class Boss(QObject):
c.run_checks(current_container())
@in_thread_job
- def fix_requested(self):
+ def fix_requested(self, errors):
self.commit_all_editors_to_container()
self.add_savepoint(_('Auto-fix errors'))
c = self.gui.check_book
c.parent().show()
c.parent().raise_()
- changed = c.fix_errors(current_container())
+ changed = c.fix_errors(current_container(), errors)
if changed:
self.apply_container_update_to_gui()
self.set_modified()
diff --git a/src/calibre/gui2/tweak_book/check.py b/src/calibre/gui2/tweak_book/check.py
index 3a1aaf6991..e9f62ed86a 100644
--- a/src/calibre/gui2/tweak_book/check.py
+++ b/src/calibre/gui2/tweak_book/check.py
@@ -39,7 +39,7 @@ class Check(QSplitter):
item_activated = pyqtSignal(object)
check_requested = pyqtSignal()
- fix_requested = pyqtSignal()
+ fix_requested = pyqtSignal(object)
def __init__(self, parent=None):
QSplitter.__init__(self, parent)
@@ -79,7 +79,12 @@ class Check(QSplitter):
elif url == 'run:check':
self.check_requested.emit()
elif url == 'fix:errors':
- self.fix_requested.emit()
+ errors = [self.items.item(i).data(Qt.UserRole).toPyObject() for i in xrange(self.items.count())]
+ self.fix_requested.emit(errors)
+ elif url.startswith('fix:error,'):
+ num = int(url.rpartition(',')[-1])
+ errors = [self.items.item(num).data(Qt.UserRole).toPyObject()]
+ self.fix_requested.emit(errors)
def next_error(self, delta=1):
row = self.items.currentRow()
@@ -108,13 +113,18 @@ class Check(QSplitter):
loc += ' column: %d' % err.col
if loc:
loc = ' (%s)' % loc
+ ifix = ''
+ if err.INDIVIDUAL_FIX:
+ ifix = '%s
' % (
+ self.items.currentRow(), _('Try to fix only this error'), err.INDIVIDUAL_FIX)
+
self.help.setText(
'''
%s
-