Nicer error message for DRMed books

This commit is contained in:
Kovid Goyal 2013-12-02 15:13:33 +05:30
parent 267a02fbed
commit f885896c31

View File

@ -157,6 +157,9 @@ class Boss(QObject):
def book_opened(self, job): def book_opened(self, job):
if job.traceback is not None: if job.traceback is not None:
if 'DRMError:' in job.traceback:
from calibre.gui2.dialogs.drm_error import DRMErrorMessage
return DRMErrorMessage(self.gui).exec_()
return error_dialog(self.gui, _('Failed to open book'), return error_dialog(self.gui, _('Failed to open book'),
_('Failed to open book, click Show details for more information.'), _('Failed to open book, click Show details for more information.'),
det_msg=job.traceback, show=True) det_msg=job.traceback, show=True)