mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
Fix #1924674 [Column icon editor: Advanced template has no column selected by default](https://bugs.launchpad.net/calibre/+bug/1924674)
This commit is contained in:
commit
f51826b188
@ -710,19 +710,22 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
|||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
txt = unicode_type(self.textbox.toPlainText()).rstrip()
|
txt = unicode_type(self.textbox.toPlainText()).rstrip()
|
||||||
|
if (self.coloring or self.iconing or self.embleming) and not txt:
|
||||||
|
error_dialog(self, _('No template provided'),
|
||||||
|
_('The template box cannot be empty'), show=True)
|
||||||
|
return
|
||||||
if self.coloring:
|
if self.coloring:
|
||||||
if self.colored_field.currentIndex() == -1:
|
if self.colored_field.currentIndex() == -1:
|
||||||
error_dialog(self, _('No column chosen'),
|
error_dialog(self, _('No column chosen'),
|
||||||
_('You must specify a column to be colored'), show=True)
|
_('You must specify a column to be colored'), show=True)
|
||||||
return
|
return
|
||||||
if not txt:
|
|
||||||
error_dialog(self, _('No template provided'),
|
|
||||||
_('The template box cannot be empty'), show=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
self.rule = (unicode_type(self.colored_field.itemData(
|
self.rule = (unicode_type(self.colored_field.itemData(
|
||||||
self.colored_field.currentIndex()) or ''), txt)
|
self.colored_field.currentIndex()) or ''), txt)
|
||||||
elif self.iconing:
|
elif self.iconing:
|
||||||
|
if self.icon_field.currentIndex() == -1:
|
||||||
|
error_dialog(self, _('No column chosen'),
|
||||||
|
_('You must specify the column where the icons are applied'), show=True)
|
||||||
|
return
|
||||||
rt = unicode_type(self.icon_kind.itemData(self.icon_kind.currentIndex()) or '')
|
rt = unicode_type(self.icon_kind.itemData(self.icon_kind.currentIndex()) or '')
|
||||||
self.rule = (rt,
|
self.rule = (rt,
|
||||||
unicode_type(self.icon_field.itemData(
|
unicode_type(self.icon_field.itemData(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user