diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py
index 1a8d4e93bc..b782cc7c72 100644
--- a/src/calibre/gui2/library/models.py
+++ b/src/calibre/gui2/library/models.py
@@ -687,14 +687,14 @@ class BooksModel(QAbstractTableModel): # {{{
idx = self.custom_columns[col]['rec_index']
datatype = self.custom_columns[col]['datatype']
if datatype in ('text', 'comments', 'composite', 'enumeration'):
- self.dc[col] = functools.partial(text_type, idx=idx,
- mult=self.custom_columns[col]['is_multiple'])
- if datatype == 'composite':
- csort = self.custom_columns[col]['display'].get('composite_sort', 'text')
- if csort == 'bool':
+ mult=self.custom_columns[col]['is_multiple']
+ self.dc[col] = functools.partial(text_type, idx=idx, mult=mult)
+ if datatype in ['text', 'composite', 'enumeration'] and not mult:
+ if self.custom_columns[col]['display'].get('use_decorations', False):
self.dc_decorator[col] = functools.partial(
- bool_type_decorator, idx=idx,
- bool_cols_are_tristate=tweaks['bool_custom_columns_are_tristate'] != 'no')
+ bool_type_decorator, idx=idx,
+ bool_cols_are_tristate=
+ tweaks['bool_custom_columns_are_tristate'] != 'no')
elif datatype in ('int', 'float'):
self.dc[col] = functools.partial(number_type, idx=idx)
elif datatype == 'datetime':
@@ -703,7 +703,8 @@ class BooksModel(QAbstractTableModel): # {{{
self.dc[col] = functools.partial(bool_type, idx=idx)
self.dc_decorator[col] = functools.partial(
bool_type_decorator, idx=idx,
- bool_cols_are_tristate=tweaks['bool_custom_columns_are_tristate'] != 'no')
+ bool_cols_are_tristate=
+ tweaks['bool_custom_columns_are_tristate'] != 'no')
elif datatype == 'rating':
self.dc[col] = functools.partial(rating_type, idx=idx)
elif datatype == 'series':
diff --git a/src/calibre/gui2/preferences/create_custom_column.py b/src/calibre/gui2/preferences/create_custom_column.py
index def74a4864..50d567d239 100644
--- a/src/calibre/gui2/preferences/create_custom_column.py
+++ b/src/calibre/gui2/preferences/create_custom_column.py
@@ -121,6 +121,8 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
elif ct == 'enumeration':
self.enum_box.setText(','.join(c['display'].get('enum_values', [])))
self.datatype_changed()
+ if ct in ['text', 'composite', 'enumeration']:
+ self.use_decorations.setChecked(c['display'].get('use_decorations', False))
self.exec_()
def shortcut_activated(self, url):
@@ -161,6 +163,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
getattr(self, 'composite_'+x).setVisible(col_type == 'composite')
for x in ('box', 'default_label', 'label'):
getattr(self, 'enum_'+x).setVisible(col_type == 'enumeration')
+ self.use_decorations.setVisible(col_type in ['text', 'composite', 'enumeration'])
def accept(self):
col = unicode(self.column_name_box.text()).strip()
@@ -233,6 +236,9 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
'list more than once').format(l[i]))
display_dict = {'enum_values': l}
+ if col_type in ['text', 'composite', 'enumeration']:
+ display_dict['use_decorations'] = self.use_decorations.checkState()
+
if not self.editing_col:
db.field_metadata
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 f045141ecb..aaa69f5e4b 100644
--- a/src/calibre/gui2/preferences/create_custom_column.ui
+++ b/src/calibre/gui2/preferences/create_custom_column.ui
@@ -88,23 +88,58 @@
-
-
-
-
- 0
- 0
-
-
-
-
- 70
- 0
-
-
-
- What kind of information will be kept in the column.
-
-
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 70
+ 0
+
+
+
+ What kind of information will be kept in the column.
+
+
+
+ -
+
+
+ Show checkmarks
+
+
+ Show check marks in the GUI. Values of 'yes', 'checked', and 'true'
+will show a green check. Values of 'no', 'unchecked', and 'false' will show a red X.
+Everything else will show nothing.
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 10
+ 0
+
+
+
+
+ 20
+ 0
+
+
+
+
+
-