mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 16:33:17 +02:00
Workaround for bug in Qt 5.4 that causes multiple close events to be delivered when using a keyboard shortcut to quit on OS X. Fixes #1440444 [ebook-viewer forgets state of ToC if closed by keyboard (Cmd-Q)](https://bugs.launchpad.net/calibre/+bug/1440444)
This commit is contained in:
parent
147d11f1ea
commit
0a252c6692
1 changed files with 5 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ def __init__(self, pathtoebook=None, debug_javascript=False, open_at=None,
|
|||
start_in_fullscreen=False):
|
||||
MainWindow.__init__(self, debug_javascript)
|
||||
self.view.magnification_changed.connect(self.magnification_changed)
|
||||
self.closed = False
|
||||
self.show_toc_on_open = False
|
||||
self.current_book_has_toc = False
|
||||
self.iterator = None
|
||||
|
|
@ -252,7 +253,11 @@ def quit(self):
|
|||
QApplication.instance().quit()
|
||||
|
||||
def closeEvent(self, e):
|
||||
if self.closed:
|
||||
e.ignore()
|
||||
return
|
||||
if self.shutdown():
|
||||
self.closed = True
|
||||
return MainWindow.closeEvent(self, e)
|
||||
else:
|
||||
e.ignore()
|
||||
|
|
|
|||
Loading…
Reference in a new issue