mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change the default template for the Formats custom column to include spaces after the commas
This commit is contained in:
parent
4df998fdd2
commit
17fc7b06f0
@ -210,7 +210,7 @@ class CreateCustomColumn(QDialog):
|
|||||||
self.composite_box.setText(
|
self.composite_box.setText(
|
||||||
{
|
{
|
||||||
'isbn': '{identifiers:select(isbn)}',
|
'isbn': '{identifiers:select(isbn)}',
|
||||||
'formats': "{:'approximate_formats()'}",
|
'formats': "{:'re(approximate_formats(), ',', ', ')'}",
|
||||||
}[which])
|
}[which])
|
||||||
self.composite_sort_by.setCurrentIndex(0)
|
self.composite_sort_by.setCurrentIndex(0)
|
||||||
if which == 'text':
|
if which == 'text':
|
||||||
@ -372,8 +372,8 @@ class CreateCustomColumn(QDialog):
|
|||||||
cmc.setToolTip(_("If checked, this column will appear in the Tag browser as a category"))
|
cmc.setToolTip(_("If checked, this column will appear in the Tag browser as a category"))
|
||||||
l.addWidget(cmc)
|
l.addWidget(cmc)
|
||||||
self.composite_contains_html = cch = QCheckBox(_("Show as HTML in Book details"))
|
self.composite_contains_html = cch = QCheckBox(_("Show as HTML in Book details"))
|
||||||
cch.setToolTip('<p>' +
|
cch.setToolTip('<p>' + _(
|
||||||
_('If checked, this column will be displayed as HTML in '
|
'If checked, this column will be displayed as HTML in '
|
||||||
'Book details and the Content server. This can be used to '
|
'Book details and the Content server. This can be used to '
|
||||||
'construct links with the template language. For example, '
|
'construct links with the template language. For example, '
|
||||||
'the template '
|
'the template '
|
||||||
@ -414,13 +414,13 @@ class CreateCustomColumn(QDialog):
|
|||||||
'<p>' + _('Default: Not formatted. For format language details see'
|
'<p>' + _('Default: Not formatted. For format language details see'
|
||||||
' <a href="https://docs.python.org/library/string.html#format-string-syntax">the Python documentation</a>'))
|
' <a href="https://docs.python.org/library/string.html#format-string-syntax">the Python documentation</a>'))
|
||||||
if col_type == 'int':
|
if col_type == 'int':
|
||||||
self.format_box.setToolTip('<p>' +
|
self.format_box.setToolTip('<p>' + _(
|
||||||
_('Examples: The format <code>{0:0>4d}</code> '
|
'Examples: The format <code>{0:0>4d}</code> '
|
||||||
'gives a 4-digit number with leading zeros. The format '
|
'gives a 4-digit number with leading zeros. The format '
|
||||||
'<code>{0:d} days</code> prints the number then the word "days"')+ '</p>')
|
'<code>{0:d} days</code> prints the number then the word "days"')+ '</p>')
|
||||||
else:
|
else:
|
||||||
self.format_box.setToolTip('<p>' +
|
self.format_box.setToolTip('<p>' + _(
|
||||||
_('Examples: The format <code>{0:.1f}</code> gives a floating '
|
'Examples: The format <code>{0:.1f}</code> gives a floating '
|
||||||
'point number with 1 digit after the decimal point. The format '
|
'point number with 1 digit after the decimal point. The format '
|
||||||
'<code>Price: $ {0:,.2f}</code> prints '
|
'<code>Price: $ {0:,.2f}</code> prints '
|
||||||
'"Price $ " then displays the number with 2 digits '
|
'"Price $ " then displays the number with 2 digits '
|
||||||
@ -447,7 +447,7 @@ class CreateCustomColumn(QDialog):
|
|||||||
return self.simple_error('', _('No lookup name was provided'))
|
return self.simple_error('', _('No lookup name was provided'))
|
||||||
if col.startswith('#'):
|
if col.startswith('#'):
|
||||||
col = col[1:]
|
col = col[1:]
|
||||||
if re.match('^\w*$', col) is None or not col[0].isalpha() or col.lower() != col:
|
if re.match(r'^\w*$', col) is None or not col[0].isalpha() or col.lower() != col:
|
||||||
return self.simple_error('', _('The lookup name must contain only '
|
return self.simple_error('', _('The lookup name must contain only '
|
||||||
'lower case letters, digits and underscores, and start with a letter'))
|
'lower case letters, digits and underscores, and start with a letter'))
|
||||||
if col.endswith('_index'):
|
if col.endswith('_index'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user