Preferences UI for configuring emblems to be displayed in the cover grid, next to covers

This commit is contained in:
Kovid Goyal 2014-07-29 14:30:32 +05:30
parent de26f1e9a3
commit ba07a4c5f9
4 changed files with 478 additions and 396 deletions

View File

@ -407,6 +407,7 @@ class DB(object):
defs['categories_using_hierarchy'] = [] defs['categories_using_hierarchy'] = []
defs['column_color_rules'] = [] defs['column_color_rules'] = []
defs['column_icon_rules'] = [] defs['column_icon_rules'] = []
defs['cover_grid_icon_rules'] = []
defs['grouped_search_make_user_categories'] = [] defs['grouped_search_make_user_categories'] = []
defs['similar_authors_search_key'] = 'authors' defs['similar_authors_search_key'] = 'authors'
defs['similar_authors_match_kind'] = 'match_any' defs['similar_authors_match_kind'] = 'match_any'

View File

@ -278,24 +278,31 @@ class ConditionEditor(QWidget): # {{{
class RuleEditor(QDialog): # {{{ class RuleEditor(QDialog): # {{{
@property
def doing_multiple(self):
return hasattr(self, 'multiple_icon_cb') and self.multiple_icon_cb.isChecked()
def __init__(self, fm, pref_name, parent=None): def __init__(self, fm, pref_name, parent=None):
QDialog.__init__(self, parent) QDialog.__init__(self, parent)
self.fm = fm self.fm = fm
if pref_name == 'column_color_rules': if pref_name == 'column_color_rules':
self.rule_kind = 'color' self.rule_kind = 'color'
rule_text = _('coloring') rule_text = _('column coloring')
else: elif pref_name == 'column_icon_rules':
self.rule_kind = 'icon' self.rule_kind = 'icon'
rule_text = _('icon') rule_text = _('column icon')
elif pref_name == 'cover_grid_icon_rules':
self.rule_kind = 'emblem'
rule_text = _('cover grid emblem')
self.setWindowIcon(QIcon(I('format-fill-color.png'))) self.setWindowIcon(QIcon(I('format-fill-color.png')))
self.setWindowTitle(_('Create/edit a column {0} rule').format(rule_text)) self.setWindowTitle(_('Create/edit a {0} rule').format(rule_text))
self.l = l = QGridLayout(self) self.l = l = QGridLayout(self)
self.setLayout(l) self.setLayout(l)
self.l1 = l1 = QLabel(_('Create a column {0} rule by' self.l1 = l1 = QLabel(_('Create a {0} rule by'
' filling in the boxes below'.format(rule_text))) ' filling in the boxes below'.format(rule_text)))
l.addWidget(l1, 0, 0, 1, 8) l.addWidget(l1, 0, 0, 1, 8)
@ -303,12 +310,12 @@ class RuleEditor(QDialog): # {{{
self.f1.setFrameShape(QFrame.HLine) self.f1.setFrameShape(QFrame.HLine)
l.addWidget(self.f1, 1, 0, 1, 8) l.addWidget(self.f1, 1, 0, 1, 8)
self.l2 = l2 = QLabel(_('Set the')) self.l2 = l2 = QLabel(_('Add the emblem:') if self.rule_kind == 'emblem' else _('Set the'))
l.addWidget(l2, 2, 0) l.addWidget(l2, 2, 0)
if self.rule_kind == 'color': if self.rule_kind == 'color':
l.addWidget(QLabel(_('color'))) l.addWidget(QLabel(_('color')))
else: elif self.rule_kind == 'icon':
self.kind_box = QComboBox(self) self.kind_box = QComboBox(self)
for tt, t in icon_rule_kinds: for tt, t in icon_rule_kinds:
self.kind_box.addItem(tt, t) self.kind_box.addItem(tt, t)
@ -317,6 +324,8 @@ class RuleEditor(QDialog): # {{{
'If you choose composed icons and multiple rules match, then all the' 'If you choose composed icons and multiple rules match, then all the'
' matching icons will be combined, otherwise the icon from the' ' matching icons will be combined, otherwise the icon from the'
' first rule to match will be used.'))) ' first rule to match will be used.')))
else:
pass
self.l3 = l3 = QLabel(_('of the column:')) self.l3 = l3 = QLabel(_('of the column:'))
l.addWidget(l3, 2, 2) l.addWidget(l3, 2, 2)
@ -326,17 +335,12 @@ class RuleEditor(QDialog): # {{{
self.l4 = l4 = QLabel(_('to')) self.l4 = l4 = QLabel(_('to'))
l.addWidget(l4, 2, 4) l.addWidget(l4, 2, 4)
if self.rule_kind == 'emblem':
l3.setVisible(False), self.column_box.setVisible(False), l4.setVisible(False)
if self.rule_kind == 'color': def create_filename_box(folder='cc_icons'):
self.color_box = ColorButton(parent=self)
self.color_label = QLabel('Sample text Sample text')
self.color_label.setTextFormat(Qt.RichText)
l.addWidget(self.color_box, 2, 5)
l.addWidget(self.color_label, 2, 6)
l.addItem(QSpacerItem(10, 10, QSizePolicy.Expanding), 2, 7)
else:
self.filename_box = QComboBox() self.filename_box = QComboBox()
d = os.path.join(config_dir, 'cc_icons') d = os.path.join(config_dir, folder)
self.icon_file_names = [] self.icon_file_names = []
if os.path.exists(d): if os.path.exists(d):
for icon_file in os.listdir(d): for icon_file in os.listdir(d):
@ -346,6 +350,25 @@ class RuleEditor(QDialog): # {{{
self.icon_file_names.append(icon_file) self.icon_file_names.append(icon_file)
self.icon_file_names.sort(key=sort_key) self.icon_file_names.sort(key=sort_key)
if self.rule_kind == 'color':
self.color_box = ColorButton(parent=self)
self.color_label = QLabel('Sample text Sample text')
self.color_label.setTextFormat(Qt.RichText)
l.addWidget(self.color_box, 2, 5)
l.addWidget(self.color_label, 2, 6)
l.addItem(QSpacerItem(10, 10, QSizePolicy.Expanding), 2, 7)
elif self.rule_kind == 'emblem':
create_filename_box()
self.update_filename_box()
self.filename_button = QPushButton(QIcon(I('document_open.png')),
_('&Add new image'))
l.addWidget(self.filename_box)
l.addWidget(self.filename_button, 2, 6)
l.addWidget(QLabel(_('(Images should be square-ish)')), 2, 7)
l.setColumnStretch(7, 10)
else:
create_filename_box()
vb = QVBoxLayout() vb = QVBoxLayout()
self.multiple_icon_cb = QCheckBox(_('Choose more than one icon')) self.multiple_icon_cb = QCheckBox(_('Choose more than one icon'))
vb.addWidget(self.multiple_icon_cb) vb.addWidget(self.multiple_icon_cb)
@ -420,7 +443,7 @@ class RuleEditor(QDialog): # {{{
self.update_icon_filenames_in_box() self.update_icon_filenames_in_box()
def update_filename_box(self): def update_filename_box(self):
doing_multiple = self.multiple_icon_cb.isChecked() doing_multiple = self.doing_multiple
model = QStandardItemModel() model = QStandardItemModel()
self.filename_box.setModel(model) self.filename_box.setModel(model)
@ -477,7 +500,7 @@ class RuleEditor(QDialog): # {{{
except: except:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
if self.multiple_icon_cb.isChecked(): if self.doing_multiple:
if icon_name not in self.rule_icon_files: if icon_name not in self.rule_icon_files:
self.rule_icon_files.append(icon_name) self.rule_icon_files.append(icon_name)
self.update_icon_filenames_in_box() self.update_icon_filenames_in_box()
@ -490,7 +513,7 @@ class RuleEditor(QDialog): # {{{
return return
def get_filenames_from_box(self): def get_filenames_from_box(self):
if self.multiple_icon_cb.isChecked(): if self.doing_multiple:
model = self.filename_box.model() model = self.filename_box.model()
fnames = [] fnames = []
for i in range(1, model.rowCount()): for i in range(1, model.rowCount()):
@ -504,7 +527,7 @@ class RuleEditor(QDialog): # {{{
def update_icon_filenames_in_box(self): def update_icon_filenames_in_box(self):
if self.rule_icon_files: if self.rule_icon_files:
if not self.multiple_icon_cb.isChecked(): if not self.doing_multiple:
idx = self.filename_box.findText(self.rule_icon_files[0]) idx = self.filename_box.findText(self.rule_icon_files[0])
if idx >= 0: if idx >= 0:
self.filename_box.setCurrentIndex(idx) self.filename_box.setCurrentIndex(idx)
@ -528,10 +551,11 @@ class RuleEditor(QDialog): # {{{
if rule.color: if rule.color:
self.color_box.color = rule.color self.color_box.color = rule.color
else: else:
for i,tup in enumerate(icon_rule_kinds): if self.rule_kind == 'icon':
if kind == tup[1]: for i, tup in enumerate(icon_rule_kinds):
self.kind_box.setCurrentIndex(i) if kind == tup[1]:
break self.kind_box.setCurrentIndex(i)
break
self.rule_icon_files = [ic.strip() for ic in rule.color.split(':')] self.rule_icon_files = [ic.strip() for ic in rule.color.split(':')]
if len(self.rule_icon_files) > 1: if len(self.rule_icon_files) > 1:
self.multiple_icon_cb.setChecked(True) self.multiple_icon_cb.setChecked(True)
@ -602,7 +626,7 @@ class RuleEditor(QDialog): # {{{
kind = unicode(self.kind_box.itemData( kind = unicode(self.kind_box.itemData(
self.kind_box.currentIndex()).toString()) self.kind_box.currentIndex()).toString())
else: else:
kind = 'color' kind = self.rule_kind
return kind, col, r return kind, col, r
# }}} # }}}
@ -761,8 +785,8 @@ class RulesModel(QAbstractListModel): # {{{
continue continue
break break
return ( return (
_('<li>If the <b>%(col)s</b> column <b>%(action)s</b> value: <b>%(val)s</b>') % _('<li>If the <b>%(col)s</b> column <b>%(action)s</b> value: <b>%(val)s</b>') % dict(
dict(col=c, action=action_name, val=prepare_string_for_xml(v))) col=c, action=action_name, val=prepare_string_for_xml(v)))
# }}} # }}}
@ -824,20 +848,27 @@ class EditRules(QWidget): # {{{
self.fm = fm self.fm = fm
self.mi = mi self.mi = mi
if pref_name == 'column_color_rules': if pref_name == 'column_color_rules':
self.l1.setText('<p>'+_( text = _(
'You can control the color of columns in the' 'You can control the color of columns in the'
' book list by creating "rules" that tell calibre' ' book list by creating "rules" that tell calibre'
' what color to use. Click the Add Rule button below' ' what color to use. Click the Add Rule button below'
' to get started.<p>You can <b>change an existing rule</b> by' ' to get started.<p>You can <b>change an existing rule</b> by'
' double clicking it.')) ' double clicking it.')
else: elif pref_name == 'column_icon_rules':
self.l1.setText('<p>'+_( text = _(
'You can add icons to columns in the' 'You can add icons to columns in the'
' book list by creating "rules" that tell calibre' ' book list by creating "rules" that tell calibre'
' what icon to use. Click the Add Rule button below' ' what icon to use. Click the Add Rule button below'
' to get started.<p>You can <b>change an existing rule</b> by' ' to get started.<p>You can <b>change an existing rule</b> by'
' double clicking it.')) ' double clicking it.')
elif pref_name == 'cover_grid_icon_rules':
text = _('You can add emblems (small icons) that are displayed on the side of covers'
' in the cover grid by creating "rules" that tell calibre'
' what image to use. Click the Add Rule button below'
' to get started.<p>You can <b>change an existing rule</b> by'
' double clicking it.')
# self.add_advanced_button.setVisible(False) # self.add_advanced_button.setVisible(False)
self.l1.setText('<p>'+ text)
def add_rule(self): def add_rule(self):
d = RuleEditor(self.model.fm, self.pref_name) d = RuleEditor(self.model.fm, self.pref_name)

View File

@ -11,7 +11,7 @@ from functools import partial
from PyQt4.Qt import ( from PyQt4.Qt import (
QApplication, QFont, QFontInfo, QFontDialog, QColorDialog, QPainter, QApplication, QFont, QFontInfo, QFontDialog, QColorDialog, QPainter,
QAbstractListModel, Qt, QIcon, QKeySequence, QColor, pyqtSignal, QAbstractListModel, Qt, QIcon, QKeySequence, QColor, pyqtSignal,
QWidget, QSizePolicy, QBrush, QPixmap, QSize, QPushButton) QWidget, QSizePolicy, QBrush, QPixmap, QSize, QPushButton, QVBoxLayout)
from calibre import human_readable from calibre import human_readable
from calibre.gui2.preferences import ConfigWidgetBase, test_widget, CommaSeparatedList from calibre.gui2.preferences import ConfigWidgetBase, test_widget, CommaSeparatedList
@ -240,6 +240,11 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.tabWidget.addTab(self.icon_rules, self.tabWidget.addTab(self.icon_rules,
QIcon(I('icon_choose.png')), _('Column icons')) QIcon(I('icon_choose.png')), _('Column icons'))
self.grid_rules = EditRules(self.emblems_tab)
self.grid_rules.changed.connect(self.changed_signal)
self.emblems_tab.setLayout(QVBoxLayout())
self.emblems_tab.layout().addWidget(self.grid_rules)
self.tabWidget.setCurrentIndex(0) self.tabWidget.setCurrentIndex(0)
keys = [QKeySequence('F11', QKeySequence.PortableText), QKeySequence( keys = [QKeySequence('F11', QKeySequence.PortableText), QKeySequence(
'Ctrl+Shift+F', QKeySequence.PortableText)] 'Ctrl+Shift+F', QKeySequence.PortableText)]
@ -320,6 +325,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
mi=None mi=None
self.edit_rules.initialize(db.field_metadata, db.prefs, mi, 'column_color_rules') self.edit_rules.initialize(db.field_metadata, db.prefs, mi, 'column_color_rules')
self.icon_rules.initialize(db.field_metadata, db.prefs, mi, 'column_icon_rules') self.icon_rules.initialize(db.field_metadata, db.prefs, mi, 'column_icon_rules')
self.grid_rules.initialize(db.field_metadata, db.prefs, mi, 'cover_grid_icon_rules')
self.set_cg_color(gprefs['cover_grid_color']) self.set_cg_color(gprefs['cover_grid_color'])
self.set_cg_texture(gprefs['cover_grid_texture']) self.set_cg_texture(gprefs['cover_grid_texture'])
self.update_aspect_ratio() self.update_aspect_ratio()
@ -365,6 +371,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.display_model.restore_defaults() self.display_model.restore_defaults()
self.edit_rules.clear() self.edit_rules.clear()
self.icon_rules.clear() self.icon_rules.clear()
self.grid_rules.clear()
self.changed_signal.emit() self.changed_signal.emit()
self.set_cg_color(gprefs.defaults['cover_grid_color']) self.set_cg_color(gprefs.defaults['cover_grid_color'])
self.set_cg_texture(gprefs.defaults['cover_grid_texture']) self.set_cg_texture(gprefs.defaults['cover_grid_texture'])
@ -453,6 +460,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.display_model.commit() self.display_model.commit()
self.edit_rules.commit(self.gui.current_db.prefs) self.edit_rules.commit(self.gui.current_db.prefs)
self.icon_rules.commit(self.gui.current_db.prefs) self.icon_rules.commit(self.gui.current_db.prefs)
self.grid_rules.commit(self.gui.current_db.prefs)
gprefs['cover_grid_color'] = tuple(self.cg_bg_widget.bcol.getRgb())[:3] gprefs['cover_grid_color'] = tuple(self.cg_bg_widget.bcol.getRgb())[:3]
gprefs['cover_grid_texture'] = self.cg_bg_widget.btex gprefs['cover_grid_texture'] = self.cg_bg_widget.btex
return rr return rr

View File

@ -233,375 +233,417 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="label_19"> <widget class="QTabWidget" name="tabWidget_2">
<property name="text"> <property name="tabPosition">
<string>Control the cover grid view. You can enable this view by clicking the grid button in the bottom right corner of the main calibre window.</string> <enum>QTabWidget::West</enum>
</property> </property>
<property name="wordWrap"> <property name="currentIndex">
<bool>true</bool> <number>0</number>
</property> </property>
</widget> <widget class="QWidget" name="tab_5">
</item> <attribute name="title">
<item> <string>Main</string>
<spacer name="verticalSpacer_6"> </attribute>
<property name="orientation"> <layout class="QVBoxLayout" name="verticalLayout_3">
<enum>Qt::Vertical</enum> <item>
</property> <widget class="QLabel" name="label_19">
<property name="sizeType"> <property name="text">
<enum>QSizePolicy::Fixed</enum> <string>Control the cover grid view. You can enable this view by clicking the grid button in the bottom right corner of the main calibre window.</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="wordWrap">
<size> <bool>true</bool>
<width>20</width> </property>
<height>10</height> </widget>
</size> </item>
</property> <item>
</spacer> <spacer name="verticalSpacer_6">
</item> <property name="orientation">
<item> <enum>Qt::Vertical</enum>
<widget class="QCheckBox" name="opt_cover_grid_show_title"> </property>
<property name="text"> <property name="sizeType">
<string>Show a field (such as title) &amp;under the covers</string> <enum>QSizePolicy::Fixed</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item> <width>20</width>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <height>10</height>
<item> </size>
<widget class="QLabel" name="label_14"> </property>
<property name="text"> </spacer>
<string>&amp;Field to show under the covers:</string> </item>
</property> <item>
<property name="buddy"> <widget class="QCheckBox" name="opt_cover_grid_show_title">
<cstring>opt_field_under_covers_in_grid</cstring> <property name="text">
</property> <string>Show a field (such as title) &amp;under the covers</string>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QComboBox" name="opt_field_under_covers_in_grid"/> <item>
</item> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<spacer name="horizontalSpacer_2"> <widget class="QLabel" name="label_14">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>&amp;Field to show under the covers:</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="buddy">
<size> <cstring>opt_field_under_covers_in_grid</cstring>
<width>40</width> </property>
<height>20</height> </widget>
</size> </item>
</property> <item>
</spacer> <widget class="QComboBox" name="opt_field_under_covers_in_grid"/>
</item> </item>
</layout> <item>
</item> <spacer name="horizontalSpacer_2">
<item> <property name="orientation">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <enum>Qt::Horizontal</enum>
<item> </property>
<widget class="QLabel" name="label_16"> <property name="sizeHint" stdset="0">
<property name="text"> <size>
<string>&amp;Spacing between covers:</string> <width>40</width>
</property> <height>20</height>
<property name="buddy"> </size>
<cstring>opt_cover_grid_spacing</cstring> </property>
</property> </spacer>
</widget> </item>
</item> </layout>
<item> </item>
<widget class="QDoubleSpinBox" name="opt_cover_grid_spacing"> <item>
<property name="toolTip"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<string>The spacing between covers. A value of zero means calculate automatically based on cover size.</string> <item>
</property> <widget class="QLabel" name="label_16">
<property name="specialValueText"> <property name="text">
<string>Automatic</string> <string>&amp;Spacing between covers:</string>
</property> </property>
<property name="suffix"> <property name="buddy">
<string> cm</string> <cstring>opt_cover_grid_spacing</cstring>
</property> </property>
<property name="decimals"> </widget>
<number>2</number> </item>
</property> <item>
<property name="singleStep"> <widget class="QDoubleSpinBox" name="opt_cover_grid_spacing">
<double>0.100000000000000</double> <property name="toolTip">
</property> <string>The spacing between covers. A value of zero means calculate automatically based on cover size.</string>
</widget> </property>
</item> <property name="specialValueText">
<item> <string>Automatic</string>
<spacer name="horizontalSpacer"> </property>
<property name="orientation"> <property name="suffix">
<enum>Qt::Horizontal</enum> <string> cm</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="decimals">
<size> <number>2</number>
<width>40</width> </property>
<height>20</height> <property name="singleStep">
</size> <double>0.100000000000000</double>
</property> </property>
</spacer> </widget>
</item> </item>
</layout> <item>
</item> <spacer name="horizontalSpacer">
<item> <property name="orientation">
<widget class="QGroupBox" name="cg_background_box"> <enum>Qt::Horizontal</enum>
<property name="title"> </property>
<string>Background for the cover grid</string> <property name="sizeHint" stdset="0">
</property> <size>
<layout class="QGridLayout" name="gridLayout_5"/> <width>40</width>
</widget> <height>20</height>
</item> </size>
<item> </property>
<widget class="QGroupBox" name="groupBox_4"> </spacer>
<property name="title"> </item>
<string>Cover size</string> </layout>
</property> </item>
<layout class="QGridLayout" name="gridLayout_4"> <item>
<item row="3" column="0" colspan="5"> <widget class="QGroupBox" name="cg_background_box">
<widget class="QLabel" name="cover_grid_aspect_ratio"> <property name="title">
<property name="text"> <string>Background for the cover grid</string>
<string/> </property>
</property> <layout class="QGridLayout" name="gridLayout_5"/>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QLabel" name="label_11"> <widget class="QGroupBox" name="groupBox_4">
<property name="text"> <property name="title">
<string>Cover &amp;Width: </string> <string>Cover size</string>
</property> </property>
<property name="buddy"> <layout class="QGridLayout" name="gridLayout_4">
<cstring>opt_cover_grid_width</cstring> <item row="3" column="0" colspan="5">
</property> <widget class="QLabel" name="cover_grid_aspect_ratio">
</widget> <property name="text">
</item> <string/>
<item row="1" column="1"> </property>
<widget class="QDoubleSpinBox" name="opt_cover_grid_width"> </widget>
<property name="toolTip"> </item>
<string>The width of displayed covers. <item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Cover &amp;Width: </string>
</property>
<property name="buddy">
<cstring>opt_cover_grid_width</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="opt_cover_grid_width">
<property name="toolTip">
<string>The width of displayed covers.
A value of zero means calculate automatically.</string> A value of zero means calculate automatically.</string>
</property> </property>
<property name="specialValueText"> <property name="specialValueText">
<string>Automatic</string> <string>Automatic</string>
</property> </property>
<property name="suffix"> <property name="suffix">
<string> cm</string> <string> cm</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>1</number> <number>1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QPushButton" name="cover_grid_larger_cover"> <widget class="QPushButton" name="cover_grid_larger_cover">
<property name="toolTip"> <property name="toolTip">
<string>Make the covers larger, maintaining current aspect ratio.</string> <string>Make the covers larger, maintaining current aspect ratio.</string>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Larger covers</string> <string>&amp;Larger covers</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/plus.png</normaloff>:/images/plus.png</iconset> <normaloff>:/images/plus.png</normaloff>:/images/plus.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string>Cover &amp;Height: </string> <string>Cover &amp;Height: </string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>opt_cover_grid_height</cstring> <cstring>opt_cover_grid_height</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QDoubleSpinBox" name="opt_cover_grid_height"> <widget class="QDoubleSpinBox" name="opt_cover_grid_height">
<property name="toolTip"> <property name="toolTip">
<string>The height of displayed covers. <string>The height of displayed covers.
A value of zero means calculate automatically.</string> A value of zero means calculate automatically.</string>
</property> </property>
<property name="specialValueText"> <property name="specialValueText">
<string>Automatic</string> <string>Automatic</string>
</property> </property>
<property name="suffix"> <property name="suffix">
<string> cm</string> <string> cm</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>1</number> <number>1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
<widget class="QPushButton" name="cover_grid_smaller_cover"> <widget class="QPushButton" name="cover_grid_smaller_cover">
<property name="toolTip"> <property name="toolTip">
<string>Make the covers smaller, maintaining current aspect ratio.</string> <string>Make the covers smaller, maintaining current aspect ratio.</string>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Smaller covers</string> <string>&amp;Smaller covers</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/minus.png</normaloff>:/images/minus.png</iconset> <normaloff>:/images/minus.png</normaloff>:/images/minus.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="1" column="4">
<spacer name="horizontalSpacer_4"> <spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="0" colspan="5"> <item row="0" column="0" colspan="5">
<widget class="QLabel" name="label_20"> <widget class="QLabel" name="label_20">
<property name="text"> <property name="text">
<string>By default, calibre chooses a cover size based on your computer's screen size. You can change the cover size here:</string> <string>By default, calibre chooses a cover size based on your computer's screen size. You can change the cover size here:</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3" rowspan="2"> <item row="1" column="3" rowspan="2">
<widget class="QPushButton" name="cover_grid_reset_size"> <widget class="QPushButton" name="cover_grid_reset_size">
<property name="toolTip"> <property name="toolTip">
<string>Reset size to automatic</string> <string>Reset size to automatic</string>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Reset size</string> <string>&amp;Reset size</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>170</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="emblems_tab">
<attribute name="title">
<string>Emblems</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Performance</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Caching of covers for improved performance</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="2">
<widget class="QSpinBox" name="opt_cover_grid_disk_cache_size">
<property name="specialValueText">
<string>Disable</string>
</property>
<property name="suffix">
<string> MB</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="cover_grid_open_cache">
<property name="text">
<string>Open cache directory</string>
</property>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="5">
<widget class="QLabel" name="label_13">
<property name="text">
<string>There are two kinds of caches that calibre uses to improve performance when rendering covers in the grid view. A disk cache that is kept on your hard disk and stores the cover thumbnails and an in memory cache used to ensure flicker free rendering of covers. For best results, keep the memory cache small and the disk cache large, unless you have a lot of extra RAM in your computer and dont mind it being used by the memory cache.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="3" colspan="2">
<widget class="QLabel" name="cover_grid_current_disk_cache">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="2" colspan="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>310</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Number of covers to cache in &amp;memory (keep this small):</string>
</property>
<property name="buddy">
<cstring>opt_cover_grid_cache_size</cstring>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Maximum amount of disk space to use for caching thumbnails: </string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="cover_grid_empty_cache">
<property name="text">
<string>Empty disk cache</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="opt_cover_grid_cache_size">
<property name="toolTip">
<string>The maximum number of covers to keep in memory. Increasing this will make rendering faster, at the cost of more memory usage.</string>
</property>
<property name="maximum">
<number>50000</number>
</property>
</widget>
</item>
<item row="4" column="1">
<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>
</layout>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Caching of covers for improved performance</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="5">
<widget class="QLabel" name="label_13">
<property name="text">
<string>There are two kinds of caches that calibre uses to improve performance when rendering covers in the grid view. A disk cache that is kept on your hard disk and stores the cover thumbnails and an in memory cache used to ensure flicker free rendering of covers. For best results, keep the memory cache small and the disk cache large, unless you have a lot of extra RAM in your computer and dont mind it being used by the memory cache.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Number of covers to cache in &amp;memory (keep this small):</string>
</property>
<property name="buddy">
<cstring>opt_cover_grid_cache_size</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="opt_cover_grid_cache_size">
<property name="toolTip">
<string>The maximum number of covers to keep in memory. Increasing this will make rendering faster, at the cost of more memory usage.</string>
</property>
<property name="maximum">
<number>50000</number>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Maximum amount of disk space to use for caching thumbnails: </string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="opt_cover_grid_disk_cache_size">
<property name="specialValueText">
<string>Disable</string>
</property>
<property name="suffix">
<string> MB</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="3" colspan="2">
<widget class="QLabel" name="cover_grid_current_disk_cache">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="cover_grid_empty_cache">
<property name="text">
<string>Empty disk cache</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>310</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="cover_grid_open_cache">
<property name="text">
<string>Open cache directory</string>
</property>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_4"> <widget class="QWidget" name="tab_4">