mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2821 (Non user-friendly error message when attempting to save metadata of open file)
This commit is contained in:
parent
86abc60efe
commit
a8294ae4b8
@ -485,9 +485,17 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
|
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
if self.formats_changed:
|
try:
|
||||||
self.sync_formats()
|
if self.formats_changed:
|
||||||
title = qstring_to_unicode(self.title.text())
|
self.sync_formats()
|
||||||
|
title = unicode(self.title.text())
|
||||||
|
except IOError, err:
|
||||||
|
if err.errno == 13: # Permission denied
|
||||||
|
fname = err.filename if err.filename else 'file'
|
||||||
|
return error_dialog(self, _('Permission denied'),
|
||||||
|
_('Could not open %s. Is it being used by another'
|
||||||
|
' program?')%fname, show=True)
|
||||||
|
raise
|
||||||
self.db.set_title(self.id, title, notify=False)
|
self.db.set_title(self.id, title, notify=False)
|
||||||
au = unicode(self.authors.text())
|
au = unicode(self.authors.text())
|
||||||
if au:
|
if au:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user