mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix error when blanking the column box of a condition in a coloring rule
This commit is contained in:
parent
66f98e8ee2
commit
5ac8b6bdfa
@ -159,21 +159,22 @@ class ConditionEditor(QWidget): # {{{
|
|||||||
self.action_box.clear()
|
self.action_box.clear()
|
||||||
self.action_box.addItem('', '')
|
self.action_box.addItem('', '')
|
||||||
col = self.current_col
|
col = self.current_col
|
||||||
m = self.fm[col]
|
if col:
|
||||||
dt = m['datatype']
|
m = self.fm[col]
|
||||||
if dt in self.action_map:
|
dt = m['datatype']
|
||||||
actions = self.action_map[dt]
|
if dt in self.action_map:
|
||||||
else:
|
actions = self.action_map[dt]
|
||||||
if col == 'ondevice':
|
|
||||||
k = 'ondevice'
|
|
||||||
elif col == 'identifiers':
|
|
||||||
k = 'identifiers'
|
|
||||||
else:
|
else:
|
||||||
k = 'multiple' if m['is_multiple'] else 'single'
|
if col == 'ondevice':
|
||||||
actions = self.action_map[k]
|
k = 'ondevice'
|
||||||
|
elif col == 'identifiers':
|
||||||
|
k = 'identifiers'
|
||||||
|
else:
|
||||||
|
k = 'multiple' if m['is_multiple'] else 'single'
|
||||||
|
actions = self.action_map[k]
|
||||||
|
|
||||||
for text, key in actions:
|
for text, key in actions:
|
||||||
self.action_box.addItem(text, key)
|
self.action_box.addItem(text, key)
|
||||||
self.action_box.setCurrentIndex(0)
|
self.action_box.setCurrentIndex(0)
|
||||||
self.action_box.blockSignals(False)
|
self.action_box.blockSignals(False)
|
||||||
self.init_value_box()
|
self.init_value_box()
|
||||||
@ -184,10 +185,12 @@ class ConditionEditor(QWidget): # {{{
|
|||||||
self.value_box.setInputMask('')
|
self.value_box.setInputMask('')
|
||||||
self.value_box.setValidator(None)
|
self.value_box.setValidator(None)
|
||||||
col = self.current_col
|
col = self.current_col
|
||||||
|
if not col:
|
||||||
|
return
|
||||||
m = self.fm[col]
|
m = self.fm[col]
|
||||||
dt = m['datatype']
|
dt = m['datatype']
|
||||||
action = self.current_action
|
action = self.current_action
|
||||||
if not col or not action:
|
if not action:
|
||||||
return
|
return
|
||||||
tt = ''
|
tt = ''
|
||||||
if col == 'identifiers':
|
if col == 'identifiers':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user