mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 02:02:41 +02:00
Edit Book: Clear the Check Book panel when opening a new book
This commit is contained in:
parent
cf7887dd61
commit
609609e688
2 changed files with 9 additions and 2 deletions
|
|
@ -285,6 +285,7 @@ def book_opened(self, job):
|
|||
det_msg=job.traceback, show=True)
|
||||
if cn:
|
||||
self.save_manager.clear_notify_data()
|
||||
self.gui.check_book.clear()
|
||||
dictionaries.clear_ignored(), dictionaries.clear_caches()
|
||||
parse_worker.clear()
|
||||
container = job.result
|
||||
|
|
|
|||
|
|
@ -100,7 +100,9 @@ def copy_to_clipboard(self):
|
|||
def save_state(self):
|
||||
tprefs.set('check-book-splitter-state', bytearray(self.saveState()))
|
||||
|
||||
def clear_help(self, msg):
|
||||
def clear_help(self, msg=None):
|
||||
if msg is None:
|
||||
msg = _('No problems found')
|
||||
self.help.setText('<h2>%s</h2><p><a style="text-decoration:none" title="%s" href="run:check">%s</a></p>' % (
|
||||
msg, _('Click to run a check on the book'), _('Run check')))
|
||||
|
||||
|
|
@ -207,7 +209,7 @@ def run_checks(self, container):
|
|||
self.current_item_changed()
|
||||
self.items.setFocus(Qt.OtherFocusReason)
|
||||
else:
|
||||
self.clear_help(_('No problems found'))
|
||||
self.clear_help()
|
||||
|
||||
def fix_errors(self, container, errors):
|
||||
with BusyCursor():
|
||||
|
|
@ -230,6 +232,10 @@ def keyPressEvent(self, ev):
|
|||
self.current_item_activated()
|
||||
return super(Check, self).keyPressEvent(ev)
|
||||
|
||||
def clear(self):
|
||||
self.items.clear()
|
||||
self.clear_help()
|
||||
|
||||
def main():
|
||||
from calibre.gui2 import Application
|
||||
from calibre.gui2.tweak_book.boss import get_container
|
||||
|
|
|
|||
Loading…
Reference in a new issue