mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
69a19b07a8
@ -182,6 +182,18 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
getattr(self, 'enum_'+x).setVisible(col_type == 'enumeration')
|
||||
self.use_decorations.setVisible(col_type in ['text', 'composite', 'enumeration'])
|
||||
self.is_names.setVisible(col_type == '*text')
|
||||
if col_type == 'int':
|
||||
self.number_format_box.setToolTip('<p>' +
|
||||
_('Examples: The format <code>{0:0>4d}</code> '
|
||||
'gives a 4-digit number with leading zeros. The format '
|
||||
'<code>{0:d} days</code> prints the number then the word "days"')+ '</p>')
|
||||
elif col_type == 'float':
|
||||
self.number_format_box.setToolTip('<p>' +
|
||||
_('Examples: The format <code>{0:.1f}</code> gives a floating '
|
||||
'point number with 1 digit after the decimal point. The format '
|
||||
'<code>Price: $ {0:,.2f}</code> prints '
|
||||
'"Price $ " then displays the number with 2 digits '
|
||||
'after the decimal point and thousands separated by commas.') + '</p>')
|
||||
|
||||
def accept(self):
|
||||
col = unicode(self.column_name_box.text()).strip()
|
||||
|
@ -179,10 +179,6 @@ Everything else will show nothing.</string>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><p>Use 0 (a zero) for the field name. Example: {0:0>5.2f} gives a 5-digit floating point number, 2 digits after the decimal point, with leading zeros
|
||||
</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -198,7 +194,9 @@ Everything else will show nothing.</string>
|
||||
<item>
|
||||
<widget class="QLabel" name="number_format_default_label">
|
||||
<property name="toolTip">
|
||||
<string><p>Example: ${0:,.2f} gives floating point number prefixed by a dollar sign, 2 digits after the decimal point, with thousands separated by commas</string>
|
||||
<string><p>The format specifier must begin with <code>{0:</code>
|
||||
and end with <code>}</code> You can have text before and after the format specifier.
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><p>Default: Not formatted. For format language details see <a href="http://docs.python.org/library/string.html#format-string-syntax">the python documentation</a></string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user