This commit is contained in:
Kovid Goyal 2011-05-28 14:27:41 -06:00
commit 69a19b07a8
2 changed files with 15 additions and 5 deletions

View File

@ -182,6 +182,18 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
getattr(self, 'enum_'+x).setVisible(col_type == 'enumeration') getattr(self, 'enum_'+x).setVisible(col_type == 'enumeration')
self.use_decorations.setVisible(col_type in ['text', 'composite', 'enumeration']) self.use_decorations.setVisible(col_type in ['text', 'composite', 'enumeration'])
self.is_names.setVisible(col_type == '*text') 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}&nbsp;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:&nbsp;$&nbsp;{0:,.2f}</code> prints '
'"Price&nbsp;$&nbsp;" then displays the number with 2 digits '
'after the decimal point and thousands separated by commas.') + '</p>')
def accept(self): def accept(self):
col = unicode(self.column_name_box.text()).strip() col = unicode(self.column_name_box.text()).strip()

View File

@ -179,10 +179,6 @@ Everything else will show nothing.</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip">
<string>&lt;p&gt;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> </widget>
</item> </item>
<item> <item>
@ -198,7 +194,9 @@ Everything else will show nothing.</string>
<item> <item>
<widget class="QLabel" name="number_format_default_label"> <widget class="QLabel" name="number_format_default_label">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;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>&lt;p&gt;The format specifier must begin with &lt;code&gt;{0:&lt;/code&gt;
and end with &lt;code&gt;}&lt;/code&gt; You can have text before and after the format specifier.
</string>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;p&gt;Default: Not formatted. For format language details see &lt;a href="http://docs.python.org/library/string.html#format-string-syntax"&gt;the python documentation&lt;/a&gt;</string> <string>&lt;p&gt;Default: Not formatted. For format language details see &lt;a href="http://docs.python.org/library/string.html#format-string-syntax"&gt;the python documentation&lt;/a&gt;</string>