E-book viewer: Fix viewer not closing on SIGINT. Fixes #2099777 [ebook-viewer refuses to die after ctrl+c](https://bugs.launchpad.net/calibre/+bug/2099777)

This commit is contained in:
Kovid Goyal 2025-02-25 08:37:06 +05:30
parent 9bf4fcfd41
commit 084a672f17
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 0 deletions

View File

@ -155,6 +155,7 @@ def run_gui(app, opts, args, internal_book_data, listener=None):
open_at=opts.open_at, continue_reading=opts.continue_reading, force_reload=opts.force_reload,
calibre_book_data=internal_book_data)
main.set_exception_handler()
app.shutdown_signal_received.connect(main.request_close)
if len(args) > 1:
acc.events.append(os.path.abspath(args[-1]))
acc.got_file.connect(main.handle_commandline_arg)

View File

@ -811,6 +811,9 @@ class EbookViewer(MainWindow):
self.cfi_changed(cfi)
self.force_close()
def request_close(self):
self.close()
def closeEvent(self, ev):
if self.shutdown_done:
return