# Form implementation generated from reading ui file '/home/kovid/work/calibre/src/calibre/gui2/preferences/template_functions.ui'
#
# Created by: PyQt6 UI code generator 6.8.0
#
# 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, Form):
        Form.setObjectName("Form")
        Form.resize(788, 663)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.tabWidget = ScrollingTabWidget(parent=Form)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.gridLayout1 = QtWidgets.QGridLayout(self.tab)
        self.gridLayout1.setContentsMargins(0, 0, 0, 0)
        self.gridLayout1.setObjectName("gridLayout1")
        self.st_show_hide_help_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_show_hide_help_button.setObjectName("st_show_hide_help_button")
        self.gridLayout1.addWidget(self.st_show_hide_help_button, 0, 0, 1, 1)
        self.st_textBrowser = QtWidgets.QTextBrowser(parent=self.tab)
        self.st_textBrowser.setObjectName("st_textBrowser")
        self.gridLayout1.addWidget(self.st_textBrowser, 0, 1, 2, 1)
        self.template_editor = EmbeddedTemplateDialog(parent=self.tab)
        self.template_editor.setObjectName("template_editor")
        self.gridLayout1.addWidget(self.template_editor, 2, 1, 1, 1)
        self.st_button_layout = QtWidgets.QVBoxLayout()
        self.st_button_layout.setObjectName("st_button_layout")
        self.st_clear_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_clear_button.setObjectName("st_clear_button")
        self.st_button_layout.addWidget(self.st_clear_button)
        self.st_delete_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_delete_button.setObjectName("st_delete_button")
        self.st_button_layout.addWidget(self.st_delete_button)
        self.st_replace_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_replace_button.setObjectName("st_replace_button")
        self.st_button_layout.addWidget(self.st_replace_button)
        self.st_create_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_create_button.setObjectName("st_create_button")
        self.st_button_layout.addWidget(self.st_create_button)
        self.st_import_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_import_button.setObjectName("st_import_button")
        self.st_button_layout.addWidget(self.st_import_button)
        self.st_export_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_export_button.setObjectName("st_export_button")
        self.st_button_layout.addWidget(self.st_export_button)
        self.st_doc_edit_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_doc_edit_button.setObjectName("st_doc_edit_button")
        self.st_button_layout.addWidget(self.st_doc_edit_button)
        self.st_test_template_button = QtWidgets.QPushButton(parent=self.tab)
        self.st_test_template_button.setObjectName("st_test_template_button")
        self.st_button_layout.addWidget(self.st_test_template_button)
        spacerItem = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
        self.st_button_layout.addItem(spacerItem)
        self.gridLayout1.addLayout(self.st_button_layout, 2, 0, 1, 1)
        self.tabWidget.addTab(self.tab, "")
        self.tab1 = QtWidgets.QWidget()
        self.tab1.setObjectName("tab1")
        self.gridLayout2 = QtWidgets.QGridLayout(self.tab1)
        self.gridLayout2.setContentsMargins(0, 0, 0, 0)
        self.gridLayout2.setObjectName("gridLayout2")
        self.gridLayout_3 = QtWidgets.QGridLayout()
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.show_hide_help_button = QtWidgets.QPushButton(parent=self.tab1)
        self.show_hide_help_button.setObjectName("show_hide_help_button")
        self.gridLayout_3.addWidget(self.show_hide_help_button, 0, 0, 1, 1)
        self.textBrowser = QtWidgets.QTextBrowser(parent=self.tab1)
        self.textBrowser.setObjectName("textBrowser")
        self.gridLayout_3.addWidget(self.textBrowser, 0, 1, 2, 2)
        self.show_only_user_defined = QtWidgets.QCheckBox(parent=self.tab1)
        self.show_only_user_defined.setObjectName("show_only_user_defined")
        self.gridLayout_3.addWidget(self.show_only_user_defined, 3, 1, 1, 1)
        self.label_2 = QtWidgets.QLabel(parent=self.tab1)
        self.label_2.setObjectName("label_2")
        self.gridLayout_3.addWidget(self.label_2, 2, 0, 1, 1)
        self.function_name = QtWidgets.QComboBox(parent=self.tab1)
        self.function_name.setEditable(True)
        self.function_name.setObjectName("function_name")
        self.gridLayout_3.addWidget(self.function_name, 2, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(parent=self.tab1)
        self.label_3.setToolTip("")
        self.label_3.setObjectName("label_3")
        self.gridLayout_3.addWidget(self.label_3, 4, 0, 1, 1)
        self.argument_count = QtWidgets.QSpinBox(parent=self.tab1)
        self.argument_count.setMinimum(-1)
        self.argument_count.setObjectName("argument_count")
        self.gridLayout_3.addWidget(self.argument_count, 4, 1, 1, 1)
        self.documentation = QtWidgets.QTextEdit(parent=self.tab1)
        self.documentation.setObjectName("documentation")
        self.gridLayout_3.addWidget(self.documentation, 5, 1, 1, 1)
        self.vboxlayout = QtWidgets.QVBoxLayout()
        self.vboxlayout.setObjectName("vboxlayout")
        self.label_4 = QtWidgets.QLabel(parent=self.tab1)
        self.label_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop)
        self.label_4.setObjectName("label_4")
        self.vboxlayout.addWidget(self.label_4)
        self.doc_edit_button = QtWidgets.QPushButton(parent=self.tab1)
        self.doc_edit_button.setObjectName("doc_edit_button")
        self.vboxlayout.addWidget(self.doc_edit_button)
        spacerItem1 = QtWidgets.QSpacerItem(20, 0, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
        self.vboxlayout.addItem(spacerItem1)
        self.gridLayout_3.addLayout(self.vboxlayout, 5, 0, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.clear_button = QtWidgets.QPushButton(parent=self.tab1)
        self.clear_button.setObjectName("clear_button")
        self.horizontalLayout_2.addWidget(self.clear_button)
        self.delete_button = QtWidgets.QPushButton(parent=self.tab1)
        self.delete_button.setObjectName("delete_button")
        self.horizontalLayout_2.addWidget(self.delete_button)
        self.replace_button = QtWidgets.QPushButton(parent=self.tab1)
        self.replace_button.setObjectName("replace_button")
        self.horizontalLayout_2.addWidget(self.replace_button)
        self.create_button = QtWidgets.QPushButton(parent=self.tab1)
        self.create_button.setObjectName("create_button")
        self.horizontalLayout_2.addWidget(self.create_button)
        self.gridLayout_3.addLayout(self.horizontalLayout_2, 6, 1, 1, 1)
        self.label_41 = QtWidgets.QLabel(parent=self.tab1)
        self.label_41.setObjectName("label_41")
        self.gridLayout_3.addWidget(self.label_41, 2, 2, 1, 1)
        self.program = QtWidgets.QPlainTextEdit(parent=self.tab1)
        self.program.setMinimumSize(QtCore.QSize(400, 0))
        self.program.setDocumentTitle("")
        self.program.setTabStopDistance(30)
        self.program.setObjectName("program")
        self.gridLayout_3.addWidget(self.program, 3, 2, 3, 1)
        self.gridLayout2.addLayout(self.gridLayout_3, 1, 0, 1, 1)
        self.tabWidget.addTab(self.tab1, "")
        self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
        self.label_2.setBuddy(self.function_name)
        self.label_3.setBuddy(self.argument_count)
        self.label_4.setBuddy(self.documentation)
        self.label_41.setBuddy(self.program)

        self.retranslateUi(Form)
        self.tabWidget.setCurrentIndex(0)

    def retranslateUi(self, Form):

        Form.setWindowTitle(_("Form"))
        self.st_show_hide_help_button.setText(_("Hide help"))
        self.st_clear_button.setText(_("&Clear"))
        self.st_clear_button.setToolTip(_("Clear the name, template, and documentation boxes"))
        self.st_delete_button.setText(_("D&elete"))
        self.st_delete_button.setToolTip(_("<p>Delete the current stored template. The name is cleared. The template\n"
"and documentation are not cleared to make it easier to store the template under a new name</p>"))
        self.st_replace_button.setText(_("&Replace"))
        self.st_replace_button.setToolTip(_("Replace the template and documentation for the template with the given name."))
        self.st_create_button.setText(_("C&reate"))
        self.st_create_button.setToolTip(_("<p>Create a new stored template with the given name. You must enter the template\n"
"text before pushing this button.</p>"))
        self.st_import_button.setText(_("Im&port"))
        self.st_import_button.setToolTip(_("<p>Import a stored template from a file created by the Export\n"
"function. The import includes the name, the template, and the documentation.</p><p>\n"
"If a stored template with the imported name already exists then you are asked if you want to replace its\n"
"program and documentation with what is in the file.</p><p>\n"
"After the import, press the Create or Replace button as appropriate to save the changes.</p>"))
        self.st_export_button.setText(_("E&xport"))
        self.st_export_button.setToolTip(_("<p>Export the current stored template to a file. The file contains\n"
"the name, the template, and the documentation.</p>"))
        self.st_doc_edit_button.setText(_("Edit docs"))
        self.st_doc_edit_button.setToolTip(_("Open an editor for function documentation"))
        self.st_test_template_button.setText(_("Test"))
        self.st_test_template_button.setToolTip(_("Open a template tester dialog to use a template to test stored templates"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _("&Stored Templates"))
        self.show_hide_help_button.setText(_("Hide help"))
        self.show_only_user_defined.setText(_("Show &only user defined template functions"))
        self.show_only_user_defined.setToolTip(_("<p>If checked the \'Function\' box will show only user defined\n"
"template functions. If unchecked the box will show both system and user defined\n"
"functions. Unchecking can be useful for copying source of a system function to create\n"
"a new related user defined function.</p>"))
        self.label_2.setText(_("F&unction:"))
        self.function_name.setToolTip(_("Enter the name of the function to create."))
        self.label_3.setText(_("Argument &count:"))
        self.argument_count.setToolTip(_("Set this to -1 if the function takes a variable number of arguments"))
        self.label_4.setText(_("D&ocumentation:"))
        self.doc_edit_button.setText(_("Edit docs"))
        self.doc_edit_button.setToolTip(_("Open an editor for function documentation"))
        self.clear_button.setText(_("Clear"))
        self.delete_button.setText(_("Delete"))
        self.replace_button.setText(_("Replace"))
        self.create_button.setText(_("C&reate"))
        self.label_41.setText(_("P&rogram code (Follow Python indenting rules):"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab1), _("&Template functions"))
from calibre.gui2.dialogs.template_dialog import EmbeddedTemplateDialog
from calibre.gui2.widgets2 import ScrollingTabWidget
