mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Get rid of another .ui file
This commit is contained in:
parent
d331c1fbe2
commit
edb17d89ce
@ -6,7 +6,11 @@ __copyright__ = '2010, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
import re
|
||||
from functools import partial
|
||||
|
||||
from PyQt5.Qt import QDialog, Qt, QColor
|
||||
from PyQt5.Qt import (
|
||||
QDialog, Qt, QColor, QIcon, QVBoxLayout, QLabel, QGridLayout,
|
||||
QDialogButtonBox, QWidget, QLineEdit, QHBoxLayout, QComboBox,
|
||||
QCheckBox
|
||||
)
|
||||
|
||||
from calibre.gui2.preferences.create_custom_column_ui import Ui_QCreateCustomColumn
|
||||
from calibre.gui2 import error_dialog
|
||||
@ -81,10 +85,9 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
|
||||
def __init__(self, parent, current_row, current_key, standard_colheads, standard_colnames):
|
||||
QDialog.__init__(self, parent)
|
||||
Ui_QCreateCustomColumn.__init__(self)
|
||||
self.setupUi(self)
|
||||
self.setup_ui()
|
||||
self.setWindowTitle(_('Create a custom column'))
|
||||
self.heading_label.setText(_('Create a custom column'))
|
||||
self.heading_label.setText('<b>' + _('Create a custom column'))
|
||||
# Remove help icon on title bar
|
||||
icon = self.windowIcon()
|
||||
self.setWindowFlags(self.windowFlags()&(~Qt.WindowContextHelpButtonHint))
|
||||
@ -92,18 +95,6 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
|
||||
self.simple_error = partial(error_dialog, self, show=True,
|
||||
show_copy_button=False)
|
||||
self.button_box.accepted.connect(self.accept)
|
||||
self.button_box.rejected.connect(self.reject)
|
||||
self.shortcuts.linkActivated.connect(self.shortcut_activated)
|
||||
text = '<p>'+_('Quick create:')
|
||||
for col, name in [('isbn', _('ISBN')), ('formats', _('Formats')),
|
||||
('yesno', _('Yes/No')),
|
||||
('tags', _('Tags')), ('series', _('Series')), ('rating',
|
||||
_('Rating')), ('people', _("People's names"))]:
|
||||
text += ' <a href="col:%s">%s</a>,'%(col, name)
|
||||
text = text[:-1]
|
||||
self.shortcuts.setText(text)
|
||||
|
||||
for sort_by in [_('Text'), _('Number'), _('Date'), _('Yes/No')]:
|
||||
self.composite_sort_by.addItem(sort_by)
|
||||
|
||||
@ -126,7 +117,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
return
|
||||
|
||||
self.setWindowTitle(_('Edit a custom column'))
|
||||
self.heading_label.setText(_('Edit a custom column'))
|
||||
self.heading_label.setText('<b>' + _('Edit a custom column'))
|
||||
self.shortcuts.setVisible(False)
|
||||
idx = current_row
|
||||
if idx < 0:
|
||||
@ -152,7 +143,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
self.column_type_box.setEnabled(False)
|
||||
if ct == 'datetime':
|
||||
if c['display'].get('date_format', None):
|
||||
self.date_format_box.setText(c['display'].get('date_format', ''))
|
||||
self.format_box.setText(c['display'].get('date_format', ''))
|
||||
elif ct in ['composite', '*composite']:
|
||||
self.composite_box.setText(c['display'].get('composite_template', ''))
|
||||
sb = c['display'].get('composite_sort', 'text')
|
||||
@ -171,7 +162,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
self.enum_colors.setText(','.join(c['display'].get('enum_colors', [])))
|
||||
elif ct in ['int', 'float']:
|
||||
if c['display'].get('number_format', None):
|
||||
self.number_format_box.setText(c['display'].get('number_format', ''))
|
||||
self.format_box.setText(c['display'].get('number_format', ''))
|
||||
self.datatype_changed()
|
||||
if ct in ['text', 'composite', 'enumeration']:
|
||||
self.use_decorations.setChecked(c['display'].get('use_decorations', False))
|
||||
@ -179,19 +170,6 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
self.is_names.setChecked(c['display'].get('is_names', False))
|
||||
self.description_box.setText(c['display'].get('description', ''))
|
||||
|
||||
self.composite_contains_html.setToolTip('<p>' +
|
||||
_('If checked, this column will be displayed as HTML in '
|
||||
'book details and the content server. This can be used to '
|
||||
'construct links with the template language. For example, '
|
||||
'the template '
|
||||
'<pre><big><b>{title}</b></big>'
|
||||
'{series:| [|}{series_index:| [|]]}</pre>'
|
||||
'will create a field displaying the title in bold large '
|
||||
'characters, along with the series, for example <br>"<big><b>'
|
||||
'An Oblique Approach</b></big> [Belisarius [1]]". The template '
|
||||
'<pre><a href="http://www.beam-ebooks.de/ebook/{identifiers'
|
||||
':select(beam)}">Beam book</a></pre> '
|
||||
'will generate a link to the book on the Beam ebooks site.') + '</p>')
|
||||
self.exec_()
|
||||
|
||||
def shortcut_activated(self, url):
|
||||
@ -221,14 +199,184 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
}[which])
|
||||
self.composite_sort_by.setCurrentIndex(0)
|
||||
|
||||
def setup_ui(self):
|
||||
self.setWindowModality(Qt.ApplicationModal)
|
||||
self.setWindowIcon(QIcon(I('column.png')))
|
||||
self.vl = l = QVBoxLayout(self)
|
||||
self.heading_label = la = QLabel('')
|
||||
l.addWidget(la)
|
||||
self.shortcuts = s = QLabel('')
|
||||
s.setWordWrap(True)
|
||||
s.linkActivated.connect(self.shortcut_activated)
|
||||
text = '<p>'+_('Quick create:')
|
||||
for col, name in [('isbn', _('ISBN')), ('formats', _('Formats')),
|
||||
('yesno', _('Yes/No')),
|
||||
('tags', _('Tags')), ('series', _('Series')), ('rating',
|
||||
_('Rating')), ('people', _("People's names"))]:
|
||||
text += ' <a href="col:%s">%s</a>,'%(col, name)
|
||||
text = text[:-1]
|
||||
s.setText(text)
|
||||
l.addWidget(s)
|
||||
self.g = g = QGridLayout()
|
||||
l.addLayout(g)
|
||||
l.addStretch(10)
|
||||
self.button_box = bb = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self)
|
||||
bb.accepted.connect(self.accept), bb.rejected.connect(self.reject)
|
||||
l.addWidget(bb)
|
||||
|
||||
def add_row(text, widget):
|
||||
if text is None:
|
||||
f = g.addWidget if isinstance(widget, QWidget) else g.addLayout
|
||||
f(widget, g.rowCount(), 0, 1, -1)
|
||||
return
|
||||
|
||||
row = g.rowCount()
|
||||
la = QLabel(text)
|
||||
g.addWidget(la, row, 0, 1, 1)
|
||||
if isinstance(widget, QWidget):
|
||||
la.setBuddy(widget)
|
||||
g.addWidget(widget, row, 1, 1, 1)
|
||||
else:
|
||||
widget.setContentsMargins(0, 0, 0, 0)
|
||||
g.addLayout(widget, row, 1, 1, 1)
|
||||
for i in range(widget.count()):
|
||||
w = widget.itemAt(i).widget()
|
||||
if isinstance(w, QWidget):
|
||||
la.setBuddy(w)
|
||||
break
|
||||
return la
|
||||
|
||||
# Lookup name
|
||||
self.column_name_box = cnb = QLineEdit(self)
|
||||
cnb.setToolTip(_("Used for searching the column. Must contain only digits and lower case letters."))
|
||||
add_row(_("&Lookup name"), cnb)
|
||||
|
||||
# Heading
|
||||
self.column_heading_box = chb = QLineEdit(self)
|
||||
chb.setToolTip(_("Column heading in the library view and category name in the tag browser"))
|
||||
add_row(_("Column &heading"), chb)
|
||||
|
||||
# Column Type
|
||||
h = QHBoxLayout()
|
||||
self.column_type_box = ctb = QComboBox(self)
|
||||
ctb.setMinimumWidth(70)
|
||||
ctb.setToolTip(_("What kind of information will be kept in the column."))
|
||||
h.addWidget(ctb)
|
||||
self.use_decorations = ud = QCheckBox(_("Show &checkmarks"), self)
|
||||
ud.setToolTip(_("Show check marks in the GUI. Values of 'yes', 'checked', and 'true'\n"
|
||||
"will show a green check. Values of 'no', 'unchecked', and 'false' will show a red X.\n"
|
||||
"Everything else will show nothing."))
|
||||
h.addWidget(ud)
|
||||
self.is_names = ins = QCheckBox(_("Contains names"), self)
|
||||
ins.setToolTip(_("Check this box if this column contains names, like the authors column."))
|
||||
h.addWidget(ins)
|
||||
add_row(_("&Column type"), h)
|
||||
|
||||
# Description
|
||||
self.description_box = d = QLineEdit(self)
|
||||
d.setToolTip(_("Optional text describing what this column is for"))
|
||||
add_row(_("D&escription"), d)
|
||||
|
||||
# Date/number formatting
|
||||
h = QHBoxLayout()
|
||||
self.format_box = fb = QLineEdit(self)
|
||||
h.addWidget(fb)
|
||||
self.format_default_label = la = QLabel('')
|
||||
la.setOpenExternalLinks(True)
|
||||
h.addWidget(la)
|
||||
self.format_label = add_row('', h)
|
||||
|
||||
# Template
|
||||
self.composite_box = cb = QLineEdit(self)
|
||||
self.composite_default_label = cdl = QLabel(_("Default: (nothing)"))
|
||||
cb.setToolTip(_("Field template. Uses the same syntax as save templates."))
|
||||
cdl.setToolTip(_("Similar to save templates. For example, %s") % "{title} {isbn}")
|
||||
h = QHBoxLayout()
|
||||
h.addWidget(cb), h.addWidget(cdl)
|
||||
self.composite_label = add_row(_("&Template"), h)
|
||||
|
||||
# Values for enum type
|
||||
l = QGridLayout()
|
||||
self.enum_box = eb = QLineEdit(self)
|
||||
eb.setToolTip(_(
|
||||
"A comma-separated list of permitted values. The empty value is always\n"
|
||||
"included, and is the default. For example, the list 'one,two,three' has\n"
|
||||
"four values, the first of them being the empty value."))
|
||||
self.enum_default_label = la = QLabel(_("Values"))
|
||||
la.setBuddy(eb)
|
||||
l.addWidget(eb), l.addWidget(la, 0, 1)
|
||||
self.enum_colors = ec = QLineEdit(self)
|
||||
ec.setToolTip(_("A list of color names to use when displaying an item. The\n"
|
||||
"list must be empty or contain a color for each value."))
|
||||
self.enum_colors_label = la = QLabel(_('Colors'))
|
||||
la.setBuddy(ec)
|
||||
l.addWidget(ec), l.addWidget(la, 1, 1)
|
||||
self.enum_label = add_row(_('&Values'), l)
|
||||
|
||||
# Composite display properties
|
||||
l = QHBoxLayout()
|
||||
self.composite_sort_by_label = la = QLabel(_("&Sort/search column by"))
|
||||
self.composite_sort_by = csb = QComboBox(self)
|
||||
la.setBuddy(csb), csb.setToolTip(_("How this column should handled in the GUI when sorting and searching"))
|
||||
l.addWidget(la), l.addWidget(csb)
|
||||
self.composite_make_category = cmc = QCheckBox(_("Show in tags browser"))
|
||||
cmc.setToolTip(_("If checked, this column will appear in the tags browser as a category"))
|
||||
l.addWidget(cmc)
|
||||
self.composite_contains_html = cch = QCheckBox(_("Show as HTML in book details"))
|
||||
cch.setToolTip('<p>' +
|
||||
_('If checked, this column will be displayed as HTML in '
|
||||
'book details and the content server. This can be used to '
|
||||
'construct links with the template language. For example, '
|
||||
'the template '
|
||||
'<pre><big><b>{title}</b></big>'
|
||||
'{series:| [|}{series_index:| [|]]}</pre>'
|
||||
'will create a field displaying the title in bold large '
|
||||
'characters, along with the series, for example <br>"<big><b>'
|
||||
'An Oblique Approach</b></big> [Belisarius [1]]". The template '
|
||||
'<pre><a href="http://www.beam-ebooks.de/ebook/{identifiers'
|
||||
':select(beam)}">Beam book</a></pre> '
|
||||
'will generate a link to the book on the Beam ebooks site.') + '</p>')
|
||||
l.addWidget(cch)
|
||||
add_row(None, l)
|
||||
|
||||
self.resize(self.sizeHint())
|
||||
|
||||
def datatype_changed(self, *args):
|
||||
try:
|
||||
col_type = self.column_types[self.column_type_box.currentIndex()]['datatype']
|
||||
except:
|
||||
col_type = None
|
||||
needs_format = col_type in ('datetime', 'int', 'float')
|
||||
for x in ('box', 'default_label', 'label'):
|
||||
getattr(self, 'date_format_'+x).setVisible(col_type == 'datetime')
|
||||
getattr(self, 'number_format_'+x).setVisible(col_type in ['int', 'float'])
|
||||
getattr(self, 'format_'+x).setVisible(needs_format)
|
||||
if needs_format:
|
||||
if col_type == 'datetime':
|
||||
l, dl = _('&Format for dates'), _('Default: dd MMM yyyy.')
|
||||
self.format_box.setToolTip(_(
|
||||
"<p>Date format. Use 1-4 \'d\'s for day, 1-4 \'M\'s for month, and 2 or 4 \'y\'s for year.</p>\n"
|
||||
"<p>For example:\n"
|
||||
"<ul>\n"
|
||||
"<li> ddd, d MMM yyyy gives Mon, 5 Jan 2010<li>\n"
|
||||
"<li>dd MMMM yy gives 05 January 10</li>\n"
|
||||
"</ul> "))
|
||||
else:
|
||||
l, dl = _('&Format for numbers'), (
|
||||
'<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>'))
|
||||
if col_type == 'int':
|
||||
self.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>')
|
||||
else:
|
||||
self.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>'
|
||||
)
|
||||
self.format_label.setText(l), self.format_default_label.setText(dl)
|
||||
for x in ('box', 'default_label', 'label', 'sort_by', 'sort_by_label',
|
||||
'make_category', 'contains_html'):
|
||||
getattr(self, 'composite_'+x).setVisible(col_type in ['composite', '*composite'])
|
||||
@ -236,18 +384,6 @@ 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()
|
||||
@ -297,8 +433,8 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
display_dict = {}
|
||||
|
||||
if col_type == 'datetime':
|
||||
if unicode(self.date_format_box.text()).strip():
|
||||
display_dict = {'date_format':unicode(self.date_format_box.text()).strip()}
|
||||
if unicode(self.format_box.text()).strip():
|
||||
display_dict = {'date_format':unicode(self.format_box.text()).strip()}
|
||||
else:
|
||||
display_dict = {'date_format': None}
|
||||
elif col_type == 'composite':
|
||||
@ -338,8 +474,8 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
elif col_type == 'text' and is_multiple:
|
||||
display_dict = {'is_names': self.is_names.isChecked()}
|
||||
elif col_type in ['int', 'float']:
|
||||
if unicode(self.number_format_box.text()).strip():
|
||||
display_dict = {'number_format':unicode(self.number_format_box.text()).strip()}
|
||||
if unicode(self.format_box.text()).strip():
|
||||
display_dict = {'number_format':unicode(self.format_box.text()).strip()}
|
||||
else:
|
||||
display_dict = {'number_format': None}
|
||||
|
||||
|
@ -1,483 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QCreateCustomColumn</class>
|
||||
<widget class="QDialog" name="QCreateCustomColumn">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>831</width>
|
||||
<height>344</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../../../../resources/images.qrc">
|
||||
<normaloff>:/images/column.png</normaloff>:/images/column.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="5" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>&Lookup name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>column_name_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Column &heading</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>column_heading_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="column_name_box">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Used for searching the column. Must contain only digits and lower case letters.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="column_heading_box">
|
||||
<property name="toolTip">
|
||||
<string>Column heading in the library view and category name in the tag browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>&Column type</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>column_type_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QComboBox" name="column_type_box">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>What kind of information will be kept in the column.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="use_decorations">
|
||||
<property name="toolTip">
|
||||
<string>Show check marks in the GUI. Values of 'yes', 'checked', and 'true'
|
||||
will show a green check. Values of 'no', 'unchecked', and 'false' will show a red X.
|
||||
Everything else will show nothing.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show checkmarks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="is_names">
|
||||
<property name="toolTip">
|
||||
<string>Check this box if this column contains names, like the authors column.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Contains names</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_27">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_31">
|
||||
<property name="text">
|
||||
<string>D&escription</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>description_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLineEdit" name="description_box">
|
||||
<property name="toolTip">
|
||||
<string>Optional text describing what this column is for</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="date_format_box">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><p>Date format. Use 1-4 'd's for day, 1-4 'M's for month, and 2 or 4 'y's for year.</p>
|
||||
<p>For example:
|
||||
<ul>
|
||||
<li> ddd, d MMM yyyy gives Mon, 5 Jan 2010<li>
|
||||
<li>dd MMMM yy gives 05 January 10</li>
|
||||
</ul> </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="number_format_box">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="date_format_default_label">
|
||||
<property name="toolTip">
|
||||
<string>Use MMM yyyy for month + year, yyyy for year only</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default: dd MMM yyyy.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="number_format_default_label">
|
||||
<property name="toolTip">
|
||||
<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>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="date_format_label">
|
||||
<property name="text">
|
||||
<string>Format for &dates</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>date_format_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="number_format_label">
|
||||
<property name="text">
|
||||
<string>Format for &numbers</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>number_format_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="composite_label">
|
||||
<property name="text">
|
||||
<string>&Template</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>composite_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="composite_box">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Field template. Uses the same syntax as save templates.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="composite_default_label">
|
||||
<property name="toolTip">
|
||||
<string>Similar to save templates. For example, {title} {isbn}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default: (nothing)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<layout class="QHBoxLayout" name="composite_layout">
|
||||
<item>
|
||||
<widget class="QLabel" name="composite_sort_by_label">
|
||||
<property name="text">
|
||||
<string>&Sort/search column by</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>composite_sort_by</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="composite_sort_by">
|
||||
<property name="toolTip">
|
||||
<string>How this column should handled in the GUI when sorting and searching</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="composite_make_category">
|
||||
<property name="toolTip">
|
||||
<string>If checked, this column will appear in the tags browser as a category</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show in tags browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="composite_contains_html">
|
||||
<property name="text">
|
||||
<string>Show as HTML in book details</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_24">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="4">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="enum_label">
|
||||
<property name="text">
|
||||
<string>Values</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>enum_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<layout class="QGridLayout" name="horizontalLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="enum_box">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>A comma-separated list of permitted values. The empty value is always
|
||||
included, and is the default. For example, the list 'one,two,three' has
|
||||
four values, the first of them being the empty value.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="enum_default_label">
|
||||
<property name="toolTip">
|
||||
<string>The empty string is always the first value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="enum_colors">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>A list of color names to use when displaying an item. The
|
||||
list must be empty or contain a color for each value.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="enum_colors_label">
|
||||
<property name="text">
|
||||
<string>Colors</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QDialogButtonBox" name="button_box">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="heading_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="shortcuts">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>column_name_box</tabstop>
|
||||
<tabstop>column_heading_box</tabstop>
|
||||
<tabstop>column_type_box</tabstop>
|
||||
<tabstop>date_format_box</tabstop>
|
||||
<tabstop>composite_box</tabstop>
|
||||
<tabstop>button_box</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../../../resources/images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
x
Reference in New Issue
Block a user