diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 50ce72686a..dd12080d7f 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -46,6 +46,7 @@ def render_rows(data): txt = txt.decode(preferred_encoding, 'replace') if key.endswith(u':html'): key = key[:-5] + txt = comments_to_html(txt) elif '' not in txt: txt = prepare_string_for_xml(txt) if 'id' in data: diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index 40abb05f89..ec18675359 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -19,6 +19,7 @@ from calibre.gui2.comments_editor import Editor as CommentsEditor from calibre.gui2 import UNDEFINED_QDATE, error_dialog from calibre.utils.config import tweaks from calibre.utils.icu import sort_key +from calibre.library.comments import comments_to_html class Base(object): @@ -197,7 +198,7 @@ class Comments(Base): def setter(self, val): if val is None: val = '' - self._tb.html = val + self._tb.html = comments_to_html(val) def getter(self): val = unicode(self._tb.html).strip() diff --git a/src/calibre/gui2/dialogs/book_info.py b/src/calibre/gui2/dialogs/book_info.py index 6cae27d926..1384c27b8c 100644 --- a/src/calibre/gui2/dialogs/book_info.py +++ b/src/calibre/gui2/dialogs/book_info.py @@ -136,6 +136,7 @@ class BookInfo(QDialog, Ui_BookInfo): txt = info[key] if key.endswith(':html'): key = key[:-5] + txt = comments_to_html(txt) if key != _('Path'): txt = u'
\n'.join(textwrap.wrap(txt, 120)) rows += u'%s:%s'%(key, txt) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index fef1542737..b41fd78dc3 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -306,7 +306,7 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{ painter.save() if hasattr(QStyle, 'CE_ItemViewItem'): style.drawControl(QStyle.CE_ItemViewItem, option, - painter, self._parent) + painter, self.parent()) elif option.state & QStyle.State_Selected: painter.fillRect(option.rect, option.palette.highlight()) painter.setClipRect(option.rect)