mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:03:26 +02:00
Don't show decorations for is_multiple columns
This commit is contained in:
parent
52209e7f58
commit
f4cc10dd42
2 changed files with 11 additions and 13 deletions
|
|
@ -687,13 +687,14 @@ def number_type(r, idx=-1):
|
|||
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 in ['text', 'composite', 'enumeration']:
|
||||
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':
|
||||
|
|
@ -702,7 +703,8 @@ def number_type(r, idx=-1):
|
|||
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':
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ def __init__(self, parent, editing, standard_colheads, standard_colnames):
|
|||
elif ct == 'enumeration':
|
||||
self.enum_box.setText(','.join(c['display'].get('enum_values', [])))
|
||||
self.datatype_changed()
|
||||
if ct in ['text', '*text', 'composite', 'enumeration']:
|
||||
if ct in ['text', 'composite', 'enumeration']:
|
||||
self.use_decorations.setChecked(c['display'].get('use_decorations', False))
|
||||
self.exec_()
|
||||
|
||||
|
|
@ -163,11 +163,7 @@ def datatype_changed(self, *args):
|
|||
getattr(self, 'composite_'+x).setVisible(col_type == 'composite')
|
||||
for x in ('box', 'default_label', 'label'):
|
||||
getattr(self, 'enum_'+x).setVisible(col_type == 'enumeration')
|
||||
if col_type in ['text', '*text', 'composite', 'enumeration']:
|
||||
self.use_decorations.setVisible(True)
|
||||
else:
|
||||
self.use_decorations.setVisible(False)
|
||||
self.use_decorations.setChecked(False)
|
||||
self.use_decorations.setVisible(col_type in ['text', 'composite', 'enumeration'])
|
||||
|
||||
def accept(self):
|
||||
col = unicode(self.column_name_box.text()).strip()
|
||||
|
|
@ -240,7 +236,7 @@ def accept(self):
|
|||
'list more than once').format(l[i]))
|
||||
display_dict = {'enum_values': l}
|
||||
|
||||
if col_type in ['text', '*text', 'composite', 'enumeration']:
|
||||
if col_type in ['text', 'composite', 'enumeration']:
|
||||
display_dict['use_decorations'] = self.use_decorations.checkState()
|
||||
|
||||
if not self.editing_col:
|
||||
|
|
|
|||
Loading…
Reference in a new issue