mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-26 23:04:27 +02:00
Fix #7168 (unhandled exception when changing cover picture)
This commit is contained in:
parent
2a8c2661a6
commit
a5f2c1fbb1
1 changed files with 3 additions and 3 deletions
|
|
@ -172,7 +172,7 @@ def select_cover(self):
|
|||
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 @@ def select_cover(self):
|
|||
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'),
|
||||
_("<p>There was an error reading from file: <br /><b>") + _file + "</b></p><br />"+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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue