mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -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):
|
||||
if self.formats_changed:
|
||||
self.sync_formats()
|
||||
title = qstring_to_unicode(self.title.text())
|
||||
try:
|
||||
if self.formats_changed:
|
||||
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)
|
||||
au = unicode(self.authors.text())
|
||||
if au:
|
||||
|
Loading…
x
Reference in New Issue
Block a user