From a5f2c1fbb1f429acbd11ca56eb1d3025914e10da Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Oct 2010 15:11:06 -0600 Subject: [PATCH] Fix #7168 (unhandled exception when changing cover picture) --- src/calibre/gui2/convert/metadata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/convert/metadata.py b/src/calibre/gui2/convert/metadata.py index b206bf68a6..7a02cf4429 100644 --- a/src/calibre/gui2/convert/metadata.py +++ b/src/calibre/gui2/convert/metadata.py @@ -172,7 +172,7 @@ class MetadataWidget(Widget, Ui_Form): if _file: _file = os.path.abspath(_file) if not os.access(_file, os.R_OK): - d = error_dialog(self.window, _('Cannot read'), + d = error_dialog(self.parent(), _('Cannot read'), _('You do not have permission to read the file: ') + _file) d.exec_() return @@ -181,14 +181,14 @@ class MetadataWidget(Widget, Ui_Form): cf = open(_file, "rb") cover = cf.read() except IOError, e: - d = error_dialog(self.window, _('Error reading file'), + d = error_dialog(self.parent(), _('Error reading file'), _("

There was an error reading from file:
") + _file + "


"+str(e)) d.exec_() if cover: pix = QPixmap() pix.loadFromData(cover) if pix.isNull(): - d = error_dialog(self.window, _('Error reading file'), + d = error_dialog(self.parent(), _('Error reading file'), _file + _(" is not a valid picture")) d.exec_() else: