mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Viewer: Ignore book prepare failure during shutdown
This commit is contained in:
parent
adadcaa203
commit
826d51a63f
@ -92,6 +92,7 @@ class EbookViewer(MainWindow):
|
|||||||
|
|
||||||
def __init__(self, open_at=None, continue_reading=None, force_reload=False):
|
def __init__(self, open_at=None, continue_reading=None, force_reload=False):
|
||||||
MainWindow.__init__(self, None)
|
MainWindow.__init__(self, None)
|
||||||
|
self.shutting_down = False
|
||||||
self.force_reload = force_reload
|
self.force_reload = force_reload
|
||||||
connect_lambda(self.book_preparation_started, self, lambda self: self.loading_overlay(_(
|
connect_lambda(self.book_preparation_started, self, lambda self: self.loading_overlay(_(
|
||||||
'Preparing book for first read, please wait')), type=Qt.QueuedConnection)
|
'Preparing book for first read, please wait')), type=Qt.QueuedConnection)
|
||||||
@ -371,6 +372,8 @@ class EbookViewer(MainWindow):
|
|||||||
self.book_preparation_started.emit()
|
self.book_preparation_started.emit()
|
||||||
|
|
||||||
def load_finished(self, ok, data):
|
def load_finished(self, ok, data):
|
||||||
|
if self.shutting_down:
|
||||||
|
return
|
||||||
open_at, self.pending_open_at = self.pending_open_at, None
|
open_at, self.pending_open_at = self.pending_open_at, None
|
||||||
self.web_view.clear_caches()
|
self.web_view.clear_caches()
|
||||||
if not ok:
|
if not ok:
|
||||||
@ -492,6 +495,7 @@ class EbookViewer(MainWindow):
|
|||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def closeEvent(self, ev):
|
def closeEvent(self, ev):
|
||||||
|
self.shutting_down = True
|
||||||
try:
|
try:
|
||||||
self.save_annotations()
|
self.save_annotations()
|
||||||
self.save_state()
|
self.save_state()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user