From ffb5b5d966f2766dd3c5a5479f10688762f26d92 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 Mar 2009 21:58:22 -0800 Subject: [PATCH] Fix #1917 (Calibre will not close when clicking any exit button) --- src/calibre/gui2/add.py | 2 ++ src/calibre/gui2/dialogs/config.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/add.py b/src/calibre/gui2/add.py index b44449d1aa..2f4ba281fd 100644 --- a/src/calibre/gui2/add.py +++ b/src/calibre/gui2/add.py @@ -46,6 +46,7 @@ class AddFiles(Add): def metadata_delivered(self, id, mi): if self.is_canceled(): + self.wake_up() return if not mi.title: mi.title = os.path.splitext(self.names[id])[0] @@ -162,6 +163,7 @@ class AddRecursive(Add): def metadata_delivered(self, id, mi): if self.is_canceled(): + self.wake_up() return self.emit(SIGNAL('processed(PyQt_PyObject,PyQt_PyObject)'), mi.title, id) diff --git a/src/calibre/gui2/dialogs/config.py b/src/calibre/gui2/dialogs/config.py index 1d5fad960e..3014d3dbbd 100644 --- a/src/calibre/gui2/dialogs/config.py +++ b/src/calibre/gui2/dialogs/config.py @@ -320,11 +320,17 @@ class ConfigDialog(QDialog, Ui_Dialog): layout.addWidget(QLabel(_('Error log:'))) el = QPlainTextEdit(d) layout.addWidget(el) - el.setPlainText(open(log_error_file, 'rb').read().decode('utf8', 'replace')) + try: + el.setPlainText(open(log_error_file, 'rb').read().decode('utf8', 'replace')) + except IOError: + el.setPlainText('No error log found') layout.addWidget(QLabel(_('Access log:'))) al = QPlainTextEdit(d) layout.addWidget(al) - al.setPlainText(open(log_access_file, 'rb').read().decode('utf8', 'replace')) + try: + al.setPlainText(open(log_access_file, 'rb').read().decode('utf8', 'replace')) + except IOError: + el.setPlainText('No access log found') d.show() def set_server_options(self):