diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 7e5b681bc4..37259b6214 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -926,13 +926,19 @@ class BooksModel(QAbstractTableModel): # {{{ return None if role == Qt.ToolTipRole: ht = self.column_map[section] + fm = self.db.field_metadata[self.column_map[section]] if ht == 'timestamp': # change help text because users know this field as 'date' ht = 'date' - if self.db.field_metadata[self.column_map[section]]['is_category']: - is_cat = '.\n\n' + _('Click in this column and press Q to Quickview books with the same %s') % ht + if fm['is_category']: + is_cat = '\n\n' + _('Click in this column and press Q to Quickview books with the same %s') % ht else: is_cat = '' - return (_('The lookup/search name is "{0}"{1}').format(ht, is_cat)) + cust_desc = '' + if fm['is_custom']: + cust_desc = fm['display'].get('description', '') + if cust_desc: + cust_desc = '\n' + _('Description:') + ' ' + cust_desc + return (_('The lookup/search name is "{0}"{1}{2}').format(ht, cust_desc, is_cat)) if role == Qt.DisplayRole: return (self.headers[self.column_map[section]]) return None diff --git a/src/calibre/gui2/preferences/create_custom_column.py b/src/calibre/gui2/preferences/create_custom_column.py index 5f0212b96b..225116ad18 100644 --- a/src/calibre/gui2/preferences/create_custom_column.py +++ b/src/calibre/gui2/preferences/create_custom_column.py @@ -145,6 +145,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn): self.use_decorations.setChecked(c['display'].get('use_decorations', False)) elif ct == '*text': self.is_names.setChecked(c['display'].get('is_names', False)) + self.description_box.setText(c['display'].get('description', '')) self.composite_contains_html.setToolTip('
' +
_('If checked, this column will be displayed as HTML in '
@@ -312,6 +313,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
if col_type in ['text', 'composite', 'enumeration'] and not is_multiple:
display_dict['use_decorations'] = self.use_decorations.checkState()
+ display_dict['description'] = self.description_box.text().strip()
if not self.editing_col:
self.parent.custcols[key] = {
diff --git a/src/calibre/gui2/preferences/create_custom_column.ui b/src/calibre/gui2/preferences/create_custom_column.ui
index 54fae6a150..b9fa29fe9b 100644
--- a/src/calibre/gui2/preferences/create_custom_column.ui
+++ b/src/calibre/gui2/preferences/create_custom_column.ui
@@ -151,6 +151,23 @@ Everything else will show nothing.
+