From 8a6676892bca3b81818fc027fcf7e7a1f8d7ddce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 28 Apr 2012 18:50:43 +0530 Subject: [PATCH] More informative error message for SplitErrors --- src/calibre/gui2/ui.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 84abda8f12..a7adac3e37 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -617,6 +617,31 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ d.show() self._modeless_dialogs.append(d) return + + if 'calibre.ebooks.oeb.transforms.split.SplitError' in job.details: + title = job.description.split(':')[-1].partition('(')[-1][:-1] + msg = _('

Failed to convert: %s')%title + msg += '

'+_(''' + Many older ebook reader devices are incapable of displaying + EPUB files that have internal components over a certain size. + Therefore, when converting to EPUB, calibre automatically tries + to split up the EPUB into smaller sized pieces. For some + files that are large undifferentiated blocks of text, this + splitting fails. +

You can work around the problem by either increasing the + maximum split size under EPUB Output in the conversion dialog, + or by turning on Heuristic Processing, also in the conversion + dialog. Note that if you make the maximum split size too large, + your ebook reader may have trouble with the EPUB. + ''') + if not minz: + d = error_dialog(self, _('Conversion Failed'), msg, + det_msg=job.details) + d.setModal(False) + d.show() + self._modeless_dialogs.append(d) + return + if 'calibre.web.feeds.input.RecipeDisabled' in job.details: if not minz: msg = job.details