# Form implementation generated from reading ui file '/home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_tabs/cover_grid.ui'
#
# Created by: PyQt6 UI code generator 6.8.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtGui, QtWidgets


class Ui_Form(object):
    def setupUi(self, cover_grid_tab):
        cover_grid_tab.setObjectName("cover_grid_tab")
        self.tab_5 = QtWidgets.QWidget()
        self.tab_5.setObjectName("tab_5")
        self.formLayout_2 = QtWidgets.QFormLayout(self.tab_5)
        self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_19 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_19.setWordWrap(True)
        self.label_19.setObjectName("label_19")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.label_19)
        spacerItem = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
        self.formLayout_2.setItem(3, QtWidgets.QFormLayout.ItemRole.FieldRole, spacerItem)
        self.label_14 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_14.setObjectName("label_14")
        self.formLayout_2.setWidget(5, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_14)
        self.opt_field_under_covers_in_grid = QtWidgets.QComboBox(parent=self.tab_5)
        self.opt_field_under_covers_in_grid.setObjectName("opt_field_under_covers_in_grid")
        self.formLayout_2.setWidget(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_field_under_covers_in_grid)
        self.label_16 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_16.setObjectName("label_16")
        self.formLayout_2.setWidget(6, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_16)
        self.opt_cover_grid_spacing = QtWidgets.QDoubleSpinBox(parent=self.tab_5)
        self.opt_cover_grid_spacing.setDecimals(2)
        self.opt_cover_grid_spacing.setSingleStep(0.1)
        self.opt_cover_grid_spacing.setObjectName("opt_cover_grid_spacing")
        self.formLayout_2.setWidget(6, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_cover_grid_spacing)
        self.cg_background_box = QtWidgets.QGroupBox(parent=self.tab_5)
        self.cg_background_box.setObjectName("cg_background_box")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.cg_background_box)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.formLayout_2.setWidget(7, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.cg_background_box)
        self.groupBox_4 = QtWidgets.QGroupBox(parent=self.tab_5)
        self.groupBox_4.setObjectName("groupBox_4")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_4)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.cover_grid_larger_cover = QtWidgets.QPushButton(parent=self.groupBox_4)
        icon = QtGui.QIcon.ic("plus.png")
        self.cover_grid_larger_cover.setIcon(icon)
        self.cover_grid_larger_cover.setObjectName("cover_grid_larger_cover")
        self.gridLayout_4.addWidget(self.cover_grid_larger_cover, 1, 2, 1, 1)
        self.cover_grid_smaller_cover = QtWidgets.QPushButton(parent=self.groupBox_4)
        icon1 = QtGui.QIcon.ic("minus.png")
        self.cover_grid_smaller_cover.setIcon(icon1)
        self.cover_grid_smaller_cover.setObjectName("cover_grid_smaller_cover")
        self.gridLayout_4.addWidget(self.cover_grid_smaller_cover, 2, 2, 1, 1)
        self.label_12 = QtWidgets.QLabel(parent=self.groupBox_4)
        self.label_12.setObjectName("label_12")
        self.gridLayout_4.addWidget(self.label_12, 2, 0, 1, 1)
        self.label_11 = QtWidgets.QLabel(parent=self.groupBox_4)
        self.label_11.setObjectName("label_11")
        self.gridLayout_4.addWidget(self.label_11, 1, 0, 1, 1)
        self.opt_cover_grid_height = QtWidgets.QDoubleSpinBox(parent=self.groupBox_4)
        self.opt_cover_grid_height.setDecimals(1)
        self.opt_cover_grid_height.setObjectName("opt_cover_grid_height")
        self.gridLayout_4.addWidget(self.opt_cover_grid_height, 2, 1, 1, 1)
        self.cover_grid_reset_size = QtWidgets.QPushButton(parent=self.groupBox_4)
        self.cover_grid_reset_size.setObjectName("cover_grid_reset_size")
        self.gridLayout_4.addWidget(self.cover_grid_reset_size, 1, 3, 2, 1)
        self.cover_grid_aspect_ratio = QtWidgets.QLabel(parent=self.groupBox_4)
        self.cover_grid_aspect_ratio.setText("")
        self.cover_grid_aspect_ratio.setObjectName("cover_grid_aspect_ratio")
        self.gridLayout_4.addWidget(self.cover_grid_aspect_ratio, 3, 0, 1, 5)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.gridLayout_4.addItem(spacerItem1, 1, 4, 1, 1)
        self.opt_cover_grid_width = QtWidgets.QDoubleSpinBox(parent=self.groupBox_4)
        self.opt_cover_grid_width.setDecimals(1)
        self.opt_cover_grid_width.setObjectName("opt_cover_grid_width")
        self.gridLayout_4.addWidget(self.opt_cover_grid_width, 1, 1, 1, 1)
        self.cover_size_label = QtWidgets.QLabel(parent=self.groupBox_4)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cover_size_label.sizePolicy().hasHeightForWidth())
        self.cover_size_label.setSizePolicy(sizePolicy)
        self.cover_size_label.setWordWrap(True)
        self.cover_size_label.setObjectName("cover_size_label")
        self.gridLayout_4.addWidget(self.cover_size_label, 0, 0, 1, 5)
        self.formLayout_2.setWidget(10, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.groupBox_4)
        self.opt_emblem_size = QtWidgets.QSpinBox(parent=self.tab_5)
        self.opt_emblem_size.setMinimum(16)
        self.opt_emblem_size.setMaximum(1000)
        self.opt_emblem_size.setObjectName("opt_emblem_size")
        self.formLayout_2.setWidget(11, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_emblem_size)
        self.label_21 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_21.setObjectName("label_21")
        self.formLayout_2.setWidget(11, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_21)
        self.opt_cover_grid_show_title = QtWidgets.QCheckBox(parent=self.tab_5)
        self.opt_cover_grid_show_title.setObjectName("opt_cover_grid_show_title")
        self.formLayout_2.setWidget(4, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.opt_cover_grid_show_title)
        self.label_22 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_22.setObjectName("label_22")
        self.formLayout_2.setWidget(12, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_22)
        self.opt_emblem_position = QtWidgets.QComboBox(parent=self.tab_5)
        self.opt_emblem_position.setObjectName("opt_emblem_position")
        self.formLayout_2.setWidget(12, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_emblem_position)
        cover_grid_tab.addTab(self.tab_5, "")
        self.grid_rules = GridEmblemnRules()
        self.grid_rules.setObjectName("grid_rules")
        cover_grid_tab.addTab(self.grid_rules, "")
        self.tab_6 = QtWidgets.QWidget()
        self.tab_6.setObjectName("tab_6")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab_6)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.groupBox_3 = QtWidgets.QGroupBox(parent=self.tab_6)
        self.groupBox_3.setObjectName("groupBox_3")
        self.gridLayout = QtWidgets.QGridLayout(self.groupBox_3)
        self.gridLayout.setObjectName("gridLayout")
        self.label_13 = QtWidgets.QLabel(parent=self.groupBox_3)
        self.label_13.setWordWrap(True)
        self.label_13.setObjectName("label_13")
        self.gridLayout.addWidget(self.label_13, 0, 0, 1, 5)
        self.opt_cover_grid_disk_cache_size = QtWidgets.QSpinBox(parent=self.groupBox_3)
        self.opt_cover_grid_disk_cache_size.setMinimum(100)
        self.opt_cover_grid_disk_cache_size.setSingleStep(100)
        self.opt_cover_grid_disk_cache_size.setObjectName("opt_cover_grid_disk_cache_size")
        self.gridLayout.addWidget(self.opt_cover_grid_disk_cache_size, 2, 2, 1, 1)
        self.cover_grid_empty_cache = QtWidgets.QPushButton(parent=self.groupBox_3)
        self.cover_grid_empty_cache.setObjectName("cover_grid_empty_cache")
        self.gridLayout.addWidget(self.cover_grid_empty_cache, 4, 0, 1, 1)
        self.cover_grid_open_cache = QtWidgets.QPushButton(parent=self.groupBox_3)
        self.cover_grid_open_cache.setObjectName("cover_grid_open_cache")
        self.gridLayout.addWidget(self.cover_grid_open_cache, 4, 1, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(310, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.gridLayout.addItem(spacerItem2, 4, 2, 1, 3)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
        self.gridLayout.addItem(spacerItem3, 5, 1, 1, 1)
        spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.gridLayout.addItem(spacerItem4, 1, 3, 1, 1)
        self.label_15 = QtWidgets.QLabel(parent=self.groupBox_3)
        self.label_15.setObjectName("label_15")
        self.gridLayout.addWidget(self.label_15, 1, 0, 1, 2)
        self.label_18 = QtWidgets.QLabel(parent=self.groupBox_3)
        self.label_18.setObjectName("label_18")
        self.gridLayout.addWidget(self.label_18, 2, 0, 1, 2)
        self.opt_cover_grid_cache_size_multiple = QtWidgets.QSpinBox(parent=self.groupBox_3)
        self.opt_cover_grid_cache_size_multiple.setMinimum(2)
        self.opt_cover_grid_cache_size_multiple.setMaximum(100)
        self.opt_cover_grid_cache_size_multiple.setObjectName("opt_cover_grid_cache_size_multiple")
        self.gridLayout.addWidget(self.opt_cover_grid_cache_size_multiple, 1, 2, 1, 1)
        self.cover_grid_current_disk_cache = QtWidgets.QLabel(parent=self.groupBox_3)
        self.cover_grid_current_disk_cache.setText("")
        self.cover_grid_current_disk_cache.setObjectName("cover_grid_current_disk_cache")
        self.gridLayout.addWidget(self.cover_grid_current_disk_cache, 3, 2, 1, 1)
        self.verticalLayout_2.addWidget(self.groupBox_3)
        cover_grid_tab.addTab(self.tab_6, "")
        self.label_14.setBuddy(self.opt_field_under_covers_in_grid)
        self.label_16.setBuddy(self.opt_cover_grid_spacing)
        self.label_12.setBuddy(self.opt_cover_grid_height)
        self.label_11.setBuddy(self.opt_cover_grid_width)
        self.label_21.setBuddy(self.opt_emblem_size)
        self.label_22.setBuddy(self.opt_emblem_position)
        self.label_15.setBuddy(self.opt_cover_grid_cache_size_multiple)
        self.label_18.setBuddy(self.opt_cover_grid_disk_cache_size)

        self.retranslateUi(cover_grid_tab)
        cover_grid_tab.setCurrentIndex(0)
        self.opt_cover_grid_show_title.toggled['bool'].connect(self.opt_field_under_covers_in_grid.setEnabled) # type: ignore
        QtCore.QMetaObject.connectSlotsByName(cover_grid_tab)

    def retranslateUi(self, cover_grid_tab):

        self.label_19.setText(_("Control the Cover grid view. You can enable this view by clicking the \"Layout\" button in the bottom right corner of the main calibre window."))
        self.label_14.setText(_("Field to show &under the covers:"))
        self.label_16.setText(_("Spac&ing between covers:"))
        self.opt_cover_grid_spacing.setToolTip(_("The spacing between covers. A value of zero means calculate automatically based on cover size."))
        self.opt_cover_grid_spacing.setSpecialValueText(_("Automatic"))
        self.opt_cover_grid_spacing.setSuffix(_(" cm"))
        self.cg_background_box.setTitle(_("Background for the Cover grid"))
        self.groupBox_4.setTitle(_("Cover size"))
        self.cover_grid_larger_cover.setToolTip(_("Make the covers larger, maintaining current aspect ratio."))
        self.cover_grid_larger_cover.setText(_("&Larger covers"))
        self.cover_grid_smaller_cover.setToolTip(_("Make the covers smaller, maintaining current aspect ratio."))
        self.cover_grid_smaller_cover.setText(_("&Smaller covers"))
        self.label_12.setText(_("Cover &height: "))
        self.label_11.setText(_("Cover &width: "))
        self.opt_cover_grid_height.setToolTip(_("The height of displayed covers.\n"
"A value of zero means calculate automatically."))
        self.opt_cover_grid_height.setSpecialValueText(_("Automatic"))
        self.opt_cover_grid_height.setSuffix(_(" cm"))
        self.cover_grid_reset_size.setToolTip(_("Reset size to automatic"))
        self.cover_grid_reset_size.setText(_("&Reset size"))
        self.opt_cover_grid_width.setToolTip(_("The width of displayed covers.\n"
"A value of zero means calculate automatically."))
        self.opt_cover_grid_width.setSpecialValueText(_("Automatic"))
        self.opt_cover_grid_width.setSuffix(_(" cm"))
        self.cover_size_label.setText(_("By default, calibre chooses a cover size based on your computer\'s screen size. You can change the cover size here:"))
        self.opt_emblem_size.setSuffix(_(" px"))
        self.label_21.setText(_("Size of the emblems (if any) shown &next to the covers: "))
        self.opt_cover_grid_show_title.setText(_("Show a &field (such as title) under the covers"))
        self.label_22.setText(_("&Location of the emblems shown next to the covers:"))
        cover_grid_tab.setTabText(cover_grid_tab.indexOf(self.tab_5), _("&Layout"))
        cover_grid_tab.setTabText(cover_grid_tab.indexOf(self.grid_rules), _("&Emblems"))
        self.groupBox_3.setTitle(_("Caching of covers for improved performance"))
        self.label_13.setText(_("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 don\'t mind it being used by the memory cache."))
        self.opt_cover_grid_disk_cache_size.setSpecialValueText(_("Disable"))
        self.opt_cover_grid_disk_cache_size.setSuffix(_(" MB"))
        self.cover_grid_empty_cache.setText(_("&Empty disk cache"))
        self.cover_grid_open_cache.setText(_("&Open cache folder"))
        self.label_15.setText(_("Number of screenfulls of covers to cache in &memory (keep this small):"))
        self.label_18.setText(_("Maximum amount of &disk space to use for caching thumbnails: "))
        self.opt_cover_grid_cache_size_multiple.setToolTip(_("The maximum number of screenfulls of thumbnails to keep in memory. Increasing this will make rendering faster, at the cost of more memory usage. Note that regardless of this setting, a minimum of one hundred thumbnails are always kept in memory, to ensure flicker free rendering."))
        cover_grid_tab.setTabText(cover_grid_tab.indexOf(self.tab_6), _("&Performance"))
from calibre.gui2.preferences.look_feel_tabs import GridEmblemnRules
