mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix regression in advanced column color rules. Fixes #1118678 (Adding Advance Column Color Rule - ERROR: Unhandled exception)
This commit is contained in:
commit
6f0d7806c9
@ -197,7 +197,8 @@ class TemplateHighlighter(QSyntaxHighlighter):
|
|||||||
|
|
||||||
class TemplateDialog(QDialog, Ui_TemplateDialog):
|
class TemplateDialog(QDialog, Ui_TemplateDialog):
|
||||||
|
|
||||||
def __init__(self, parent, text, mi=None, fm=None, color_field=None):
|
def __init__(self, parent, text, mi=None, fm=None, color_field=None,
|
||||||
|
rule_kind='color'):
|
||||||
QDialog.__init__(self, parent)
|
QDialog.__init__(self, parent)
|
||||||
Ui_TemplateDialog.__init__(self)
|
Ui_TemplateDialog.__init__(self)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
@ -264,7 +265,8 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
|||||||
self.function.setCurrentIndex(0)
|
self.function.setCurrentIndex(0)
|
||||||
self.function.currentIndexChanged[str].connect(self.function_changed)
|
self.function.currentIndexChanged[str].connect(self.function_changed)
|
||||||
self.textbox_changed()
|
self.textbox_changed()
|
||||||
self.rule = (None, '')
|
self.rule = (rule_kind, None, '')
|
||||||
|
self.rule_kind = rule_kind
|
||||||
|
|
||||||
tt = _('Template language tutorial')
|
tt = _('Template language tutorial')
|
||||||
self.template_tutorial.setText(
|
self.template_tutorial.setText(
|
||||||
@ -323,5 +325,5 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
|||||||
_('The template box cannot be empty'), show=True)
|
_('The template box cannot be empty'), show=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.rule = (unicode(self.colored_field.currentText()), txt)
|
self.rule = (self.rule_kind, unicode(self.colored_field.currentText()), txt)
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user