from gettext import gettext as _

from PyQt6 import QtCore, QtGui, QtWidgets


class Ui_PagePerformance(object):
    def setupUi(self, PagePerformance):
        PagePerformance.setObjectName("PagePerformance")
        PagePerformance.resize(693, 720)
        PagePerformance.setWindowTitle("")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(PagePerformance)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.frame = QtWidgets.QFrame(parent=PagePerformance)
        self.frame.setMinimumSize(QtCore.QSize(550, 0))
        self.frame.setFrameShape(QtWidgets.QFrame.Shape.NoFrame)
        self.frame.setObjectName("frame")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout_2.setSpacing(15)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label_title = QtWidgets.QLabel(parent=self.frame)
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        self.label_title.setFont(font)
        self.label_title.setObjectName("label_title")
        self.verticalLayout_2.addWidget(self.label_title)
        self.group_cache = QtWidgets.QGroupBox(parent=self.frame)
        self.group_cache.setObjectName("group_cache")
        self.grid_cache = QtWidgets.QGridLayout(self.group_cache)
        self.grid_cache.setObjectName("grid_cache")
        self.label = QtWidgets.QLabel(parent=self.group_cache)
        self.label.setObjectName("label")
        self.grid_cache.addWidget(self.label, 0, 0, 1, 1)
        self.cache_type = QtWidgets.QComboBox(parent=self.group_cache)
        self.cache_type.setObjectName("cache_type")
        self.grid_cache.addWidget(self.cache_type, 0, 1, 1, 1)
        self.label1 = QtWidgets.QLabel(parent=self.group_cache)
        self.label1.setObjectName("label1")
        self.grid_cache.addWidget(self.label1, 1, 0, 1, 1)
        self.cache_size_max = QtWidgets.QComboBox(parent=self.group_cache)
        self.cache_size_max.setObjectName("cache_size_max")
        self.cache_size_max.addItem("")
        self.cache_size_max.addItem("")
        self.cache_size_max.addItem("")
        self.cache_size_max.addItem("")
        self.grid_cache.addWidget(self.cache_size_max, 1, 1, 1, 1)
        self.persistent_cookies = QtWidgets.QCheckBox(parent=self.group_cache)
        self.persistent_cookies.setObjectName("persistent_cookies")
        self.grid_cache.addWidget(self.persistent_cookies, 2, 0, 1, 2)
        self.verticalLayout_2.addWidget(self.group_cache)
        self.group_gpu = QtWidgets.QGroupBox(parent=self.frame)
        self.group_gpu.setObjectName("group_gpu")
        self.vboxlayout = QtWidgets.QVBoxLayout(self.group_gpu)
        self.vboxlayout.setObjectName("vboxlayout")
        self.in_process_gpu = QtWidgets.QCheckBox(parent=self.group_gpu)
        self.in_process_gpu.setObjectName("in_process_gpu")
        self.vboxlayout.addWidget(self.in_process_gpu)
        self.disable_gpu = QtWidgets.QCheckBox(parent=self.group_gpu)
        self.disable_gpu.setObjectName("disable_gpu")
        self.vboxlayout.addWidget(self.disable_gpu)
        self.disable_gpu_vsync = QtWidgets.QCheckBox(parent=self.group_gpu)
        self.disable_gpu_vsync.setObjectName("disable_gpu_vsync")
        self.vboxlayout.addWidget(self.disable_gpu_vsync)
        self.software_rendering = QtWidgets.QCheckBox(parent=self.group_gpu)
        self.software_rendering.setObjectName("software_rendering")
        self.vboxlayout.addWidget(self.software_rendering)
        self.verticalLayout_2.addWidget(self.group_gpu)
        self.group_process = QtWidgets.QGroupBox(parent=self.frame)
        self.group_process.setObjectName("group_process")
        self.gridlayout = QtWidgets.QGridLayout(self.group_process)
        self.gridlayout.setObjectName("gridlayout")
        self.single_process = QtWidgets.QCheckBox(parent=self.group_process)
        self.single_process.setObjectName("single_process")
        self.gridlayout.addWidget(self.single_process, 0, 0, 1, 2)
        self.process_per_site = QtWidgets.QCheckBox(parent=self.group_process)
        self.process_per_site.setObjectName("process_per_site")
        self.gridlayout.addWidget(self.process_per_site, 1, 0, 1, 2)
        self.label2 = QtWidgets.QLabel(parent=self.group_process)
        self.label2.setObjectName("label2")
        self.gridlayout.addWidget(self.label2, 2, 0, 1, 1)
        self.js_memory_limit = QtWidgets.QComboBox(parent=self.group_process)
        self.js_memory_limit.setObjectName("js_memory_limit")
        self.js_memory_limit.addItem("")
        self.js_memory_limit.addItem("")
        self.js_memory_limit.addItem("")
        self.js_memory_limit.addItem("")
        self.gridlayout.addWidget(self.js_memory_limit, 2, 1, 1, 1)
        self.verticalLayout_2.addWidget(self.group_process)
        self.group_web = QtWidgets.QGroupBox(parent=self.frame)
        self.group_web.setObjectName("group_web")
        self.vboxlayout1 = QtWidgets.QVBoxLayout(self.group_web)
        self.vboxlayout1.setObjectName("vboxlayout1")
        self.scroll_animator = QtWidgets.QCheckBox(parent=self.group_web)
        self.scroll_animator.setObjectName("scroll_animator")
        self.vboxlayout1.addWidget(self.scroll_animator)
        self.background_throttling = QtWidgets.QCheckBox(parent=self.group_web)
        self.background_throttling.setObjectName("background_throttling")
        self.vboxlayout1.addWidget(self.background_throttling)
        self.disable_animations = QtWidgets.QCheckBox(parent=self.group_web)
        self.disable_animations.setObjectName("disable_animations")
        self.vboxlayout1.addWidget(self.disable_animations)
        self.disable_pinch = QtWidgets.QCheckBox(parent=self.group_web)
        self.disable_pinch.setObjectName("disable_pinch")
        self.vboxlayout1.addWidget(self.disable_pinch)
        self.verticalLayout_2.addWidget(self.group_web)
        self.hboxlayout = QtWidgets.QHBoxLayout()
        self.hboxlayout.setObjectName("hboxlayout")
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.hboxlayout.addItem(spacerItem1)
        self.btn_restore = QtWidgets.QPushButton(parent=self.frame)
        self.btn_restore.setObjectName("btn_restore")
        self.hboxlayout.addWidget(self.btn_restore)
        self.verticalLayout_2.addLayout(self.hboxlayout)
        self.label3 = QtWidgets.QLabel(parent=self.frame)
        font = QtGui.QFont()
        font.setItalic(True)
        self.label3.setFont(font)
        self.label3.setObjectName("label3")
        self.verticalLayout_2.addWidget(self.label3)
        self.horizontalLayout.addWidget(self.frame)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.horizontalLayout.addItem(spacerItem2)
        self.verticalLayout_3.addLayout(self.horizontalLayout)
        spacerItem3 = QtWidgets.QSpacerItem(20, 200, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
        self.verticalLayout_3.addItem(spacerItem3)

        self.retranslateUi(PagePerformance)
        QtCore.QMetaObject.connectSlotsByName(PagePerformance)

    def retranslateUi(self, PagePerformance):
        
        self.label_title.setText(_("Performance (Experimental)"))
        self.group_cache.setTitle(_("Cache and Storage"))
        self.label.setText(_("Cache type"))
        self.label1.setText(_("Maximum cache size"))
        self.cache_size_max.setItemText(0, _("0 MB"))
        self.cache_size_max.setItemText(1, _("50 MB"))
        self.cache_size_max.setItemText(2, _("100 MB"))
        self.cache_size_max.setItemText(3, _("200 MB"))
        self.persistent_cookies.setText(_("Use persistent cookies"))
        self.group_gpu.setTitle(_("GPU and Rendering"))
        self.in_process_gpu.setText(_("Use GPU in the same process"))
        self.disable_gpu.setText(_("Disable GPU hardware acceleration"))
        self.disable_gpu_vsync.setText(_("Disable GPU VSync"))
        self.software_rendering.setText(_("Force software rendering (experimental)"))
        self.group_process.setTitle(_("Processes and Memory"))
        self.single_process.setText(_("Run everything in a single process"))
        self.process_per_site.setText(_("Use one process per site"))
        self.label2.setText(_("JavaScript memory limit"))
        self.js_memory_limit.setItemText(0, _("Automatic"))
        self.js_memory_limit.setItemText(1, _("Minimum (256 MB)"))
        self.js_memory_limit.setItemText(2, _("Default (1024 MB)"))
        self.js_memory_limit.setItemText(3, _("Maximum (4096 MB)"))
        self.group_web.setTitle(_("Web Behavior"))
        self.scroll_animator.setText(_("Animated scrolling"))
        self.background_throttling.setText(_("Allow background optimizations"))
        self.disable_animations.setText(_("Disable page animations"))
        self.disable_pinch.setText(_("Disable pinch to zoom"))
        self.btn_restore.setText(_("Restore defaults"))
        self.label3.setText(_("Note: Restart required to apply changes."))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    PagePerformance = QtWidgets.QWidget()
    ui = Ui_PagePerformance()
    ui.setupUi(PagePerformance)
    PagePerformance.show()
    sys.exit(app.exec())
