Fixes #1947841 [Rules editor: Title & Author is/is not set](https://bugs.launchpad.net/calibre/+bug/1947841)
This commit is contained in:
Kovid Goyal 2021-10-20 18:13:16 +05:30
commit ae41b9b4aa
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -93,6 +93,12 @@ class ConditionEditor(QWidget): # {{{
(_('is set'), 'is set'), (_('is set'), 'is set'),
(_('is not set'), 'is not set'), (_('is not set'), 'is not set'),
), ),
'multiple_no_isset' : (
(_('has'), 'has'),
(_('does not have'), 'does not have'),
(_('has pattern'), 'has pattern'),
(_('does not have pattern'), 'does not have pattern'),
),
'single' : ( 'single' : (
(_('is'), 'is'), (_('is'), 'is'),
(_('is not'), 'is not'), (_('is not'), 'is not'),
@ -103,6 +109,14 @@ class ConditionEditor(QWidget): # {{{
(_('is set'), 'is set'), (_('is set'), 'is set'),
(_('is not set'), 'is not set'), (_('is not set'), 'is not set'),
), ),
'single_no_isset' : (
(_('is'), 'is'),
(_('is not'), 'is not'),
(_('contains'), 'contains'),
(_('does not contain'), 'does not contain'),
(_('matches pattern'), 'matches pattern'),
(_('does not match pattern'), 'does not match pattern'),
),
} }
for x in ('float', 'rating'): for x in ('float', 'rating'):
@ -229,6 +243,10 @@ class ConditionEditor(QWidget): # {{{
k = 'ondevice' k = 'ondevice'
elif col == 'identifiers': elif col == 'identifiers':
k = 'identifiers' k = 'identifiers'
elif col == 'authors':
k = 'multiple_no_isset'
elif col == 'title':
k = 'single_no_isset'
else: else:
k = 'multiple' if m['is_multiple'] else 'single' k = 'multiple' if m['is_multiple'] else 'single'
actions = self.action_map[k] actions = self.action_map[k]