예제 #1
0
    def setup_ui(self):
        self.vl = vl = QVBoxLayout(self)
        self.l = l = QFormLayout()
        vl.addLayout(l)
        l.setContentsMargins(0, 0, 0, 0)
        l.addRow(
            QLabel(_('Print %s to a PDF file') % elided_text(self.book_title)))
        self.h = h = QHBoxLayout()
        self.file_name = f = QLineEdit(self)
        val = dynamic.get(self.OUTPUT_NAME, None)
        if not val:
            val = expanduser('~')
        else:
            val = os.path.dirname(val)
        f.setText(os.path.abspath(os.path.join(val, self.default_file_name)))
        self.browse_button = b = QToolButton(self)
        b.setIcon(QIcon(I('document_open.png'))), b.setToolTip(
            _('Choose location for PDF file'))
        b.clicked.connect(self.choose_file)
        h.addWidget(f), h.addWidget(b)
        f.setMinimumWidth(350)
        w = QLabel(_('&File:'))
        l.addRow(w, h), w.setBuddy(f)

        self.paper_size = ps = PaperSizes(self)
        ps.initialize()
        ps.set_value_for_config = vprefs.get('print-to-pdf-page-size', None)
        l.addRow(_('Paper &size:'), ps)
        tmap = {
            'left': _('&Left margin:'),
            'top': _('&Top margin:'),
            'right': _('&Right margin:'),
            'bottom': _('&Bottom margin:'),
        }
        for edge in 'left top right bottom'.split():
            m = QDoubleSpinBox(self)
            m.setSuffix(' ' + _('inches'))
            m.setMinimum(0), m.setMaximum(3), m.setSingleStep(0.1)
            val = vprefs.get('print-to-pdf-%s-margin' % edge, 1)
            m.setValue(val)
            setattr(self, '%s_margin' % edge, m)
            l.addRow(tmap[edge], m)
        self.pnum = pnum = QCheckBox(_('Add page &number to printed pages'),
                                     self)
        pnum.setChecked(vprefs.get('print-to-pdf-page-numbers', True))
        l.addRow(pnum)

        self.show_file = sf = QCheckBox(_('&Open PDF file after printing'),
                                        self)
        sf.setChecked(vprefs.get('print-to-pdf-show-file', True))
        l.addRow(sf)

        vl.addStretch(10)
        vl.addWidget(self.bb)
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(638, 665)
        self.formLayout = QtWidgets.QFormLayout(Form)
        self.formLayout.setObjectName("formLayout")
        self.opt_use_profile_size = QtWidgets.QCheckBox(Form)
        self.opt_use_profile_size.setObjectName("opt_use_profile_size")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_use_profile_size)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.label)
        self.opt_paper_size = PaperSizes(Form)
        self.opt_paper_size.setObjectName("opt_paper_size")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_paper_size)
        self.label_3 = QtWidgets.QLabel(Form)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                  self.label_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.opt_custom_size = QtWidgets.QLineEdit(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.opt_custom_size.sizePolicy().hasHeightForWidth())
        self.opt_custom_size.setSizePolicy(sizePolicy)
        self.opt_custom_size.setObjectName("opt_custom_size")
        self.horizontalLayout.addWidget(self.opt_custom_size)
        self.label_11 = QtWidgets.QLabel(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_11.sizePolicy().hasHeightForWidth())
        self.label_11.setSizePolicy(sizePolicy)
        self.label_11.setObjectName("label_11")
        self.horizontalLayout.addWidget(self.label_11)
        self.opt_unit = QtWidgets.QComboBox(Form)
        self.opt_unit.setObjectName("opt_unit")
        self.horizontalLayout.addWidget(self.opt_unit)
        self.formLayout.setLayout(2, QtWidgets.QFormLayout.FieldRole,
                                  self.horizontalLayout)
        self.opt_preserve_cover_aspect_ratio = QtWidgets.QCheckBox(Form)
        self.opt_preserve_cover_aspect_ratio.setObjectName(
            "opt_preserve_cover_aspect_ratio")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_preserve_cover_aspect_ratio)
        self.opt_pdf_page_numbers = QtWidgets.QCheckBox(Form)
        self.opt_pdf_page_numbers.setObjectName("opt_pdf_page_numbers")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_pdf_page_numbers)
        self.opt_pdf_add_toc = QtWidgets.QCheckBox(Form)
        self.opt_pdf_add_toc.setObjectName("opt_pdf_add_toc")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_pdf_add_toc)
        self.label_14 = QtWidgets.QLabel(Form)
        self.label_14.setObjectName("label_14")
        self.formLayout.setWidget(8, QtWidgets.QFormLayout.LabelRole,
                                  self.label_14)
        self.opt_toc_title = QtWidgets.QLineEdit(Form)
        self.opt_toc_title.setObjectName("opt_toc_title")
        self.formLayout.setWidget(8, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_toc_title)
        self.label_4 = QtWidgets.QLabel(Form)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole,
                                  self.label_4)
        self.opt_pdf_serif_family = QtWidgets.QFontComboBox(Form)
        self.opt_pdf_serif_family.setObjectName("opt_pdf_serif_family")
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_serif_family)
        self.label_5 = QtWidgets.QLabel(Form)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(11, QtWidgets.QFormLayout.LabelRole,
                                  self.label_5)
        self.opt_pdf_sans_family = QtWidgets.QFontComboBox(Form)
        self.opt_pdf_sans_family.setObjectName("opt_pdf_sans_family")
        self.formLayout.setWidget(11, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_sans_family)
        self.label_6 = QtWidgets.QLabel(Form)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(12, QtWidgets.QFormLayout.LabelRole,
                                  self.label_6)
        self.opt_pdf_mono_family = QtWidgets.QFontComboBox(Form)
        self.opt_pdf_mono_family.setObjectName("opt_pdf_mono_family")
        self.formLayout.setWidget(12, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_mono_family)
        self.label_7 = QtWidgets.QLabel(Form)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.LabelRole,
                                  self.label_7)
        self.opt_pdf_standard_font = QtWidgets.QComboBox(Form)
        self.opt_pdf_standard_font.setObjectName("opt_pdf_standard_font")
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_standard_font)
        self.label_8 = QtWidgets.QLabel(Form)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.LabelRole,
                                  self.label_8)
        self.opt_pdf_default_font_size = QtWidgets.QSpinBox(Form)
        self.opt_pdf_default_font_size.setObjectName(
            "opt_pdf_default_font_size")
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_default_font_size)
        self.label_9 = QtWidgets.QLabel(Form)
        self.label_9.setObjectName("label_9")
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.LabelRole,
                                  self.label_9)
        self.opt_pdf_mono_font_size = QtWidgets.QSpinBox(Form)
        self.opt_pdf_mono_font_size.setObjectName("opt_pdf_mono_font_size")
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_mono_font_size)
        self.label_91 = QtWidgets.QLabel(Form)
        self.label_91.setObjectName("label_91")
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.LabelRole,
                                  self.label_91)
        self.opt_pdf_page_number_map = QtWidgets.QLineEdit(Form)
        self.opt_pdf_page_number_map.setObjectName("opt_pdf_page_number_map")
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_page_number_map)
        self.page_margins_box = QtWidgets.QGroupBox(Form)
        self.page_margins_box.setObjectName("page_margins_box")
        self.formLayout.setWidget(18, QtWidgets.QFormLayout.SpanningRole,
                                  self.page_margins_box)
        self.template_box = QtWidgets.QGroupBox(Form)
        self.template_box.setObjectName("template_box")
        self.formLayout_2 = QtWidgets.QFormLayout(self.template_box)
        self.formLayout_2.setObjectName("formLayout_2")
        self.hf_label = QtWidgets.QLabel(self.template_box)
        self.hf_label.setWordWrap(True)
        self.hf_label.setOpenExternalLinks(True)
        self.hf_label.setObjectName("hf_label")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.SpanningRole,
                                    self.hf_label)
        self.label_12 = QtWidgets.QLabel(self.template_box)
        self.label_12.setObjectName("label_12")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.label_12)
        self.opt_pdf_header_template = QtWidgets.QLineEdit(self.template_box)
        self.opt_pdf_header_template.setObjectName("opt_pdf_header_template")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.opt_pdf_header_template)
        self.label_13 = QtWidgets.QLabel(self.template_box)
        self.label_13.setObjectName("label_13")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.label_13)
        self.opt_pdf_footer_template = QtWidgets.QLineEdit(self.template_box)
        self.opt_pdf_footer_template.setObjectName("opt_pdf_footer_template")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.opt_pdf_footer_template)
        self.formLayout.setWidget(19, QtWidgets.QFormLayout.SpanningRole,
                                  self.template_box)
        self.opt_pdf_hyphenate = QtWidgets.QCheckBox(Form)
        self.opt_pdf_hyphenate.setObjectName("opt_pdf_hyphenate")
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_pdf_hyphenate)
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.LabelRole,
                                  self.label_2)
        self.opt_pdf_odd_even_offset = QtWidgets.QDoubleSpinBox(Form)
        self.opt_pdf_odd_even_offset.setDecimals(1)
        self.opt_pdf_odd_even_offset.setMinimum(-100000.0)
        self.opt_pdf_odd_even_offset.setMaximum(100000.0)
        self.opt_pdf_odd_even_offset.setObjectName("opt_pdf_odd_even_offset")
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_odd_even_offset)
        self.label.setBuddy(self.opt_paper_size)
        self.label_3.setBuddy(self.opt_custom_size)
        self.label_11.setBuddy(self.opt_unit)
        self.label_14.setBuddy(self.opt_toc_title)
        self.label_4.setBuddy(self.opt_pdf_serif_family)
        self.label_5.setBuddy(self.opt_pdf_sans_family)
        self.label_6.setBuddy(self.opt_pdf_mono_family)
        self.label_7.setBuddy(self.opt_pdf_standard_font)
        self.label_8.setBuddy(self.opt_pdf_default_font_size)
        self.label_9.setBuddy(self.opt_pdf_mono_font_size)
        self.label_91.setBuddy(self.opt_pdf_page_number_map)
        self.label_12.setBuddy(self.opt_pdf_header_template)
        self.label_13.setBuddy(self.opt_pdf_footer_template)
        self.label_2.setBuddy(self.opt_pdf_odd_even_offset)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(638, 665)
        self.formLayout = QtWidgets.QFormLayout(Form)
        self.formLayout.setObjectName("formLayout")
        self.opt_use_profile_size = QtWidgets.QCheckBox(Form)
        self.opt_use_profile_size.setObjectName("opt_use_profile_size")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_use_profile_size)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.label)
        self.opt_paper_size = PaperSizes(Form)
        self.opt_paper_size.setObjectName("opt_paper_size")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_paper_size)
        self.label_3 = QtWidgets.QLabel(Form)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                  self.label_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.opt_custom_size = QtWidgets.QLineEdit(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.opt_custom_size.sizePolicy().hasHeightForWidth())
        self.opt_custom_size.setSizePolicy(sizePolicy)
        self.opt_custom_size.setObjectName("opt_custom_size")
        self.horizontalLayout.addWidget(self.opt_custom_size)
        self.label_11 = QtWidgets.QLabel(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_11.sizePolicy().hasHeightForWidth())
        self.label_11.setSizePolicy(sizePolicy)
        self.label_11.setObjectName("label_11")
        self.horizontalLayout.addWidget(self.label_11)
        self.opt_unit = QtWidgets.QComboBox(Form)
        self.opt_unit.setObjectName("opt_unit")
        self.horizontalLayout.addWidget(self.opt_unit)
        self.formLayout.setLayout(2, QtWidgets.QFormLayout.FieldRole,
                                  self.horizontalLayout)
        self.opt_preserve_cover_aspect_ratio = QtWidgets.QCheckBox(Form)
        self.opt_preserve_cover_aspect_ratio.setObjectName(
            "opt_preserve_cover_aspect_ratio")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_preserve_cover_aspect_ratio)
        self.opt_pdf_page_numbers = QtWidgets.QCheckBox(Form)
        self.opt_pdf_page_numbers.setObjectName("opt_pdf_page_numbers")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_pdf_page_numbers)
        self.opt_pdf_add_toc = QtWidgets.QCheckBox(Form)
        self.opt_pdf_add_toc.setObjectName("opt_pdf_add_toc")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_pdf_add_toc)
        self.label_14 = QtWidgets.QLabel(Form)
        self.label_14.setObjectName("label_14")
        self.formLayout.setWidget(8, QtWidgets.QFormLayout.LabelRole,
                                  self.label_14)
        self.opt_toc_title = QtWidgets.QLineEdit(Form)
        self.opt_toc_title.setObjectName("opt_toc_title")
        self.formLayout.setWidget(8, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_toc_title)
        self.label_4 = QtWidgets.QLabel(Form)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole,
                                  self.label_4)
        self.opt_pdf_serif_family = QtWidgets.QFontComboBox(Form)
        self.opt_pdf_serif_family.setObjectName("opt_pdf_serif_family")
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_serif_family)
        self.label_5 = QtWidgets.QLabel(Form)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(11, QtWidgets.QFormLayout.LabelRole,
                                  self.label_5)
        self.opt_pdf_sans_family = QtWidgets.QFontComboBox(Form)
        self.opt_pdf_sans_family.setObjectName("opt_pdf_sans_family")
        self.formLayout.setWidget(11, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_sans_family)
        self.label_6 = QtWidgets.QLabel(Form)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(12, QtWidgets.QFormLayout.LabelRole,
                                  self.label_6)
        self.opt_pdf_mono_family = QtWidgets.QFontComboBox(Form)
        self.opt_pdf_mono_family.setObjectName("opt_pdf_mono_family")
        self.formLayout.setWidget(12, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_mono_family)
        self.label_7 = QtWidgets.QLabel(Form)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.LabelRole,
                                  self.label_7)
        self.opt_pdf_standard_font = QtWidgets.QComboBox(Form)
        self.opt_pdf_standard_font.setObjectName("opt_pdf_standard_font")
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_standard_font)
        self.label_8 = QtWidgets.QLabel(Form)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.LabelRole,
                                  self.label_8)
        self.opt_pdf_default_font_size = QtWidgets.QSpinBox(Form)
        self.opt_pdf_default_font_size.setObjectName(
            "opt_pdf_default_font_size")
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_default_font_size)
        self.label_9 = QtWidgets.QLabel(Form)
        self.label_9.setObjectName("label_9")
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.LabelRole,
                                  self.label_9)
        self.opt_pdf_mono_font_size = QtWidgets.QSpinBox(Form)
        self.opt_pdf_mono_font_size.setObjectName("opt_pdf_mono_font_size")
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_mono_font_size)
        self.label_91 = QtWidgets.QLabel(Form)
        self.label_91.setObjectName("label_91")
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.LabelRole,
                                  self.label_91)
        self.opt_pdf_page_number_map = QtWidgets.QLineEdit(Form)
        self.opt_pdf_page_number_map.setObjectName("opt_pdf_page_number_map")
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_page_number_map)
        self.page_margins_box = QtWidgets.QGroupBox(Form)
        self.page_margins_box.setObjectName("page_margins_box")
        self.formLayout.setWidget(18, QtWidgets.QFormLayout.SpanningRole,
                                  self.page_margins_box)
        self.template_box = QtWidgets.QGroupBox(Form)
        self.template_box.setObjectName("template_box")
        self.formLayout_2 = QtWidgets.QFormLayout(self.template_box)
        self.formLayout_2.setObjectName("formLayout_2")
        self.hf_label = QtWidgets.QLabel(self.template_box)
        self.hf_label.setWordWrap(True)
        self.hf_label.setOpenExternalLinks(True)
        self.hf_label.setObjectName("hf_label")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.SpanningRole,
                                    self.hf_label)
        self.label_12 = QtWidgets.QLabel(self.template_box)
        self.label_12.setObjectName("label_12")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.label_12)
        self.opt_pdf_header_template = QtWidgets.QLineEdit(self.template_box)
        self.opt_pdf_header_template.setObjectName("opt_pdf_header_template")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.opt_pdf_header_template)
        self.label_13 = QtWidgets.QLabel(self.template_box)
        self.label_13.setObjectName("label_13")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.label_13)
        self.opt_pdf_footer_template = QtWidgets.QLineEdit(self.template_box)
        self.opt_pdf_footer_template.setObjectName("opt_pdf_footer_template")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.opt_pdf_footer_template)
        self.formLayout.setWidget(19, QtWidgets.QFormLayout.SpanningRole,
                                  self.template_box)
        self.opt_pdf_hyphenate = QtWidgets.QCheckBox(Form)
        self.opt_pdf_hyphenate.setObjectName("opt_pdf_hyphenate")
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.SpanningRole,
                                  self.opt_pdf_hyphenate)
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.LabelRole,
                                  self.label_2)
        self.opt_pdf_odd_even_offset = QtWidgets.QDoubleSpinBox(Form)
        self.opt_pdf_odd_even_offset.setDecimals(1)
        self.opt_pdf_odd_even_offset.setMinimum(-100000.0)
        self.opt_pdf_odd_even_offset.setMaximum(100000.0)
        self.opt_pdf_odd_even_offset.setObjectName("opt_pdf_odd_even_offset")
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.FieldRole,
                                  self.opt_pdf_odd_even_offset)
        self.label.setBuddy(self.opt_paper_size)
        self.label_3.setBuddy(self.opt_custom_size)
        self.label_11.setBuddy(self.opt_unit)
        self.label_14.setBuddy(self.opt_toc_title)
        self.label_4.setBuddy(self.opt_pdf_serif_family)
        self.label_5.setBuddy(self.opt_pdf_sans_family)
        self.label_6.setBuddy(self.opt_pdf_mono_family)
        self.label_7.setBuddy(self.opt_pdf_standard_font)
        self.label_8.setBuddy(self.opt_pdf_default_font_size)
        self.label_9.setBuddy(self.opt_pdf_mono_font_size)
        self.label_91.setBuddy(self.opt_pdf_page_number_map)
        self.label_12.setBuddy(self.opt_pdf_header_template)
        self.label_13.setBuddy(self.opt_pdf_footer_template)
        self.label_2.setBuddy(self.opt_pdf_odd_even_offset)

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

    def retranslateUi(self, Form):

        Form.setWindowTitle(_("Form"))
        self.opt_use_profile_size.setText(
            _("&Use the paper size set in output profile"))
        self.label.setText(_("&Paper size:"))
        self.label_3.setText(_("&Custom size:"))
        self.label_11.setText(_("&Unit:"))
        self.opt_preserve_cover_aspect_ratio.setText(
            _("Preserve &aspect ratio of cover"))
        self.opt_pdf_page_numbers.setText(
            _("Add page &numbers to the bottom of every page"))
        self.opt_pdf_add_toc.setText(
            _("Add a printable &Table of Contents at the end"))
        self.label_14.setText(_("&Title for ToC:"))
        self.label_4.setText(_("Serif famil&y:"))
        self.label_5.setText(_("Sans fami&ly:"))
        self.label_6.setText(_("&Monospace family:"))
        self.label_7.setText(_("S&tandard font:"))
        self.label_8.setText(_("Default font si&ze:"))
        self.opt_pdf_default_font_size.setSuffix(_(" px"))
        self.label_9.setText(_("Monospace &font size:"))
        self.opt_pdf_mono_font_size.setSuffix(_(" px"))
        self.label_91.setText(_("Page &number map:"))
        self.page_margins_box.setTitle(_("Page  margins"))
        self.template_box.setTitle(_("Page headers and footers"))
        self.hf_label.setText(
            _("You can insert headers and footers into every page of the produced PDF file by using header and footer templates. For examples, see the <a href=\"%s\">documentation</a>."
              ))
        self.label_12.setText(_("&Header template:"))
        self.label_13.setText(_("&Footer template:"))
        self.opt_pdf_hyphenate.setText(
            _("&Break long words at the end of lines"))
        self.label_2.setText(_("Odd/even &offset:"))
        self.opt_pdf_odd_even_offset.setSuffix(_(" pt"))