示例#1
0
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.setWindowTitle(_('Create ToC from XPath'))
        self.l = l = QVBoxLayout()
        self.setLayout(l)
        self.la = la = QLabel(_(
            'Specify a series of XPath expressions for the different levels of'
            ' the Table of Contents. You can use the wizard buttons to help'
            ' you create XPath expressions.'))
        la.setWordWrap(True)
        l.addWidget(la)
        self.widgets = []
        for i in xrange(5):
            la = _('Level %s ToC:')%('&%d'%(i+1))
            xp = XPathEdit(self)
            xp.set_msg(la)
            self.widgets.append(xp)
            l.addWidget(xp)

        self.bb = bb = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)
        bb.accepted.connect(self.accept)
        bb.rejected.connect(self.reject)
        self.ssb = b = bb.addButton(_('&Save settings'), bb.ActionRole)
        b.clicked.connect(self.save_settings)
        self.load_button = b = bb.addButton(_('&Load settings'), bb.ActionRole)
        self.load_menu = QMenu(b)
        b.setMenu(self.load_menu)
        self.setup_load_button()
        l.addStretch()
        l.addWidget(bb)
        self.resize(self.sizeHint() + QSize(50, 75))
示例#2
0
    def __init__(self, parent, prefs):
        QDialog.__init__(self, parent)
        self.prefs = prefs
        self.setWindowTitle(_('Create ToC from XPath'))
        self.l = l = QVBoxLayout()
        self.setLayout(l)
        self.la = la = QLabel(_(
            'Specify a series of XPath expressions for the different levels of'
            ' the Table of Contents. You can use the wizard buttons to help'
            ' you create XPath expressions.'))
        la.setWordWrap(True)
        l.addWidget(la)
        self.widgets = []
        for i in range(5):
            la = _('Level %s ToC:')%('&%d'%(i+1))
            xp = XPathEdit(self)
            xp.set_msg(la)
            self.widgets.append(xp)
            l.addWidget(xp)

        self.bb = bb = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok|QDialogButtonBox.StandardButton.Cancel)
        bb.accepted.connect(self.accept)
        bb.rejected.connect(self.reject)
        self.ssb = b = bb.addButton(_('&Save settings'), QDialogButtonBox.ButtonRole.ActionRole)
        b.clicked.connect(self.save_settings)
        self.load_button = b = bb.addButton(_('&Load settings'), QDialogButtonBox.ButtonRole.ActionRole)
        self.load_menu = QMenu(b)
        b.setMenu(self.load_menu)
        self.setup_load_button()
        self.remove_duplicates_cb = QCheckBox(_('Do not add duplicate entries at the same level'))
        self.remove_duplicates_cb.setChecked(self.prefs.get('xpath_toc_remove_duplicates', True))
        l.addWidget(self.remove_duplicates_cb)
        l.addStretch()
        l.addWidget(bb)
        self.resize(self.sizeHint() + QSize(50, 75))
示例#3
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(436, 382)
        Form.setWindowTitle(_("Form"))
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_no_chapters_in_toc = QtGui.QCheckBox(Form)
        self.opt_no_chapters_in_toc.setText(_("Do not add &detected chapters to the Table of Contents"))
        self.opt_no_chapters_in_toc.setObjectName(_fromUtf8("opt_no_chapters_in_toc"))
        self.gridLayout.addWidget(self.opt_no_chapters_in_toc, 1, 0, 1, 2)
        self.label_10 = QtGui.QLabel(Form)
        self.label_10.setText(_("Number of &links to add to Table of Contents"))
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 3, 0, 1, 1)
        self.opt_max_toc_links = QtGui.QSpinBox(Form)
        self.opt_max_toc_links.setMaximum(10000)
        self.opt_max_toc_links.setObjectName(_fromUtf8("opt_max_toc_links"))
        self.gridLayout.addWidget(self.opt_max_toc_links, 3, 1, 1, 1)
        self.label_16 = QtGui.QLabel(Form)
        self.label_16.setText(_("Chapter &threshold"))
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.gridLayout.addWidget(self.label_16, 4, 0, 1, 1)
        self.opt_toc_threshold = QtGui.QSpinBox(Form)
        self.opt_toc_threshold.setObjectName(_fromUtf8("opt_toc_threshold"))
        self.gridLayout.addWidget(self.opt_toc_threshold, 4, 1, 1, 1)
        self.opt_use_auto_toc = QtGui.QCheckBox(Form)
        self.opt_use_auto_toc.setText(_("&Force use of auto-generated Table of Contents"))
        self.opt_use_auto_toc.setObjectName(_fromUtf8("opt_use_auto_toc"))
        self.gridLayout.addWidget(self.opt_use_auto_toc, 0, 0, 1, 2)
        self.label = QtGui.QLabel(Form)
        self.label.setText(_("TOC &Filter:"))
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 5, 0, 1, 1)
        self.opt_toc_filter = QtGui.QLineEdit(Form)
        self.opt_toc_filter.setObjectName(_fromUtf8("opt_toc_filter"))
        self.gridLayout.addWidget(self.opt_toc_filter, 5, 1, 1, 1)
        self.opt_level1_toc = XPathEdit(Form)
        self.opt_level1_toc.setObjectName(_fromUtf8("opt_level1_toc"))
        self.gridLayout.addWidget(self.opt_level1_toc, 6, 0, 1, 2)
        self.opt_level2_toc = XPathEdit(Form)
        self.opt_level2_toc.setObjectName(_fromUtf8("opt_level2_toc"))
        self.gridLayout.addWidget(self.opt_level2_toc, 7, 0, 1, 2)
        self.opt_level3_toc = XPathEdit(Form)
        self.opt_level3_toc.setObjectName(_fromUtf8("opt_level3_toc"))
        self.gridLayout.addWidget(self.opt_level3_toc, 8, 0, 1, 2)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 9, 0, 1, 1)
        self.opt_duplicate_links_in_toc = QtGui.QCheckBox(Form)
        self.opt_duplicate_links_in_toc.setText(_("Allow &duplicate links when creating the Table of Contents"))
        self.opt_duplicate_links_in_toc.setObjectName(_fromUtf8("opt_duplicate_links_in_toc"))
        self.gridLayout.addWidget(self.opt_duplicate_links_in_toc, 2, 0, 1, 2)
        self.label_10.setBuddy(self.opt_max_toc_links)
        self.label_16.setBuddy(self.opt_toc_threshold)
        self.label.setBuddy(self.opt_toc_filter)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#4
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(657, 479)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_chapter = XPathEdit(Form)
        self.opt_chapter.setObjectName(_fromUtf8("opt_chapter"))
        self.gridLayout.addWidget(self.opt_chapter, 0, 0, 1, 3)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.opt_chapter_mark = QtGui.QComboBox(Form)
        self.opt_chapter_mark.setMinimumContentsLength(20)
        self.opt_chapter_mark.setObjectName(_fromUtf8("opt_chapter_mark"))
        self.gridLayout.addWidget(self.opt_chapter_mark, 1, 1, 1, 1)
        self.opt_remove_first_image = QtGui.QCheckBox(Form)
        self.opt_remove_first_image.setObjectName(
            _fromUtf8("opt_remove_first_image"))
        self.gridLayout.addWidget(self.opt_remove_first_image, 2, 0, 1, 2)
        self.opt_insert_metadata = QtGui.QCheckBox(Form)
        self.opt_insert_metadata.setObjectName(
            _fromUtf8("opt_insert_metadata"))
        self.gridLayout.addWidget(self.opt_insert_metadata, 3, 0, 1, 2)
        self.opt_page_breaks_before = XPathEdit(Form)
        self.opt_page_breaks_before.setObjectName(
            _fromUtf8("opt_page_breaks_before"))
        self.gridLayout.addWidget(self.opt_page_breaks_before, 7, 0, 1, 3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 8, 0, 1, 3)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 5, 0, 1, 3)
        self.opt_remove_fake_margins = QtGui.QCheckBox(Form)
        self.opt_remove_fake_margins.setObjectName(
            _fromUtf8("opt_remove_fake_margins"))
        self.gridLayout.addWidget(self.opt_remove_fake_margins, 2, 2, 1, 1)
        self.label.setBuddy(self.opt_chapter_mark)

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

    def retranslateUi(self, Form):
        Form.setWindowTitle(_("Form"))
        self.label.setText(_("Chapter &mark:"))
        self.opt_remove_first_image.setText(_("Remove first &image"))
        self.opt_insert_metadata.setText(
            _("Insert &metadata as page at start of book"))
        self.label_2.setText(
            _("The header and footer removal options have been replaced by the Search & Replace options. Click the Search & Replace category in the bar to the left to use these options. Leave the replace field blank and enter your header/footer removal regexps into the search field."
              ))
        self.opt_remove_fake_margins.setText(_("Remove &fake margins"))
示例#5
0
文件: toc_ui.py 项目: Eksmo/calibre
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(436, 382)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_no_chapters_in_toc = QtGui.QCheckBox(Form)
        self.opt_no_chapters_in_toc.setObjectName(_fromUtf8("opt_no_chapters_in_toc"))
        self.gridLayout.addWidget(self.opt_no_chapters_in_toc, 1, 0, 1, 2)
        self.label_10 = QtGui.QLabel(Form)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 3, 0, 1, 1)
        self.opt_max_toc_links = QtGui.QSpinBox(Form)
        self.opt_max_toc_links.setMaximum(10000)
        self.opt_max_toc_links.setObjectName(_fromUtf8("opt_max_toc_links"))
        self.gridLayout.addWidget(self.opt_max_toc_links, 3, 1, 1, 1)
        self.label_16 = QtGui.QLabel(Form)
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.gridLayout.addWidget(self.label_16, 4, 0, 1, 1)
        self.opt_toc_threshold = QtGui.QSpinBox(Form)
        self.opt_toc_threshold.setObjectName(_fromUtf8("opt_toc_threshold"))
        self.gridLayout.addWidget(self.opt_toc_threshold, 4, 1, 1, 1)
        self.opt_use_auto_toc = QtGui.QCheckBox(Form)
        self.opt_use_auto_toc.setObjectName(_fromUtf8("opt_use_auto_toc"))
        self.gridLayout.addWidget(self.opt_use_auto_toc, 0, 0, 1, 2)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 5, 0, 1, 1)
        self.opt_toc_filter = QtGui.QLineEdit(Form)
        self.opt_toc_filter.setObjectName(_fromUtf8("opt_toc_filter"))
        self.gridLayout.addWidget(self.opt_toc_filter, 5, 1, 1, 1)
        self.opt_level1_toc = XPathEdit(Form)
        self.opt_level1_toc.setObjectName(_fromUtf8("opt_level1_toc"))
        self.gridLayout.addWidget(self.opt_level1_toc, 6, 0, 1, 2)
        self.opt_level2_toc = XPathEdit(Form)
        self.opt_level2_toc.setObjectName(_fromUtf8("opt_level2_toc"))
        self.gridLayout.addWidget(self.opt_level2_toc, 7, 0, 1, 2)
        self.opt_level3_toc = XPathEdit(Form)
        self.opt_level3_toc.setObjectName(_fromUtf8("opt_level3_toc"))
        self.gridLayout.addWidget(self.opt_level3_toc, 8, 0, 1, 2)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 9, 0, 1, 1)
        self.opt_duplicate_links_in_toc = QtGui.QCheckBox(Form)
        self.opt_duplicate_links_in_toc.setObjectName(_fromUtf8("opt_duplicate_links_in_toc"))
        self.gridLayout.addWidget(self.opt_duplicate_links_in_toc, 2, 0, 1, 2)
        self.label_10.setBuddy(self.opt_max_toc_links)
        self.label_16.setBuddy(self.opt_toc_threshold)
        self.label.setBuddy(self.opt_toc_filter)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#6
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(657, 479)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_chapter = XPathEdit(Form)
        self.opt_chapter.setObjectName(_fromUtf8("opt_chapter"))
        self.gridLayout.addWidget(self.opt_chapter, 0, 0, 1, 3)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.opt_chapter_mark = QtGui.QComboBox(Form)
        self.opt_chapter_mark.setMinimumContentsLength(20)
        self.opt_chapter_mark.setObjectName(_fromUtf8("opt_chapter_mark"))
        self.gridLayout.addWidget(self.opt_chapter_mark, 1, 1, 1, 1)
        self.opt_remove_first_image = QtGui.QCheckBox(Form)
        self.opt_remove_first_image.setObjectName(_fromUtf8("opt_remove_first_image"))
        self.gridLayout.addWidget(self.opt_remove_first_image, 2, 0, 1, 2)
        self.opt_insert_metadata = QtGui.QCheckBox(Form)
        self.opt_insert_metadata.setObjectName(_fromUtf8("opt_insert_metadata"))
        self.gridLayout.addWidget(self.opt_insert_metadata, 3, 0, 1, 2)
        self.opt_page_breaks_before = XPathEdit(Form)
        self.opt_page_breaks_before.setObjectName(_fromUtf8("opt_page_breaks_before"))
        self.gridLayout.addWidget(self.opt_page_breaks_before, 7, 0, 1, 3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 8, 0, 1, 3)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 5, 0, 1, 3)
        self.opt_remove_fake_margins = QtGui.QCheckBox(Form)
        self.opt_remove_fake_margins.setObjectName(_fromUtf8("opt_remove_fake_margins"))
        self.gridLayout.addWidget(self.opt_remove_fake_margins, 2, 2, 1, 1)
        self.label.setBuddy(self.opt_chapter_mark)

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

    def retranslateUi(self, Form):
        Form.setWindowTitle(_("Form"))
        self.label.setText(_("Chapter &mark:"))
        self.opt_remove_first_image.setText(_("Remove first &image"))
        self.opt_insert_metadata.setText(_("Insert &metadata as page at start of book"))
        self.label_2.setText(_("The header and footer removal options have been replaced by the Search & Replace options. Click the Search & Replace category in the bar to the left to use these options. Leave the replace field blank and enter your header/footer removal regexps into the search field."))
        self.opt_remove_fake_margins.setText(_("Remove &fake margins"))
示例#7
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(657, 479)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_chapter = XPathEdit(Form)
        self.opt_chapter.setObjectName(_fromUtf8("opt_chapter"))
        self.gridLayout.addWidget(self.opt_chapter, 0, 0, 1, 3)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.opt_chapter_mark = QtGui.QComboBox(Form)
        self.opt_chapter_mark.setMinimumContentsLength(20)
        self.opt_chapter_mark.setObjectName(_fromUtf8("opt_chapter_mark"))
        self.gridLayout.addWidget(self.opt_chapter_mark, 1, 1, 1, 1)
        self.opt_remove_first_image = QtGui.QCheckBox(Form)
        self.opt_remove_first_image.setObjectName(
            _fromUtf8("opt_remove_first_image"))
        self.gridLayout.addWidget(self.opt_remove_first_image, 2, 0, 1, 2)
        self.opt_insert_metadata = QtGui.QCheckBox(Form)
        self.opt_insert_metadata.setObjectName(
            _fromUtf8("opt_insert_metadata"))
        self.gridLayout.addWidget(self.opt_insert_metadata, 3, 0, 1, 2)
        self.opt_page_breaks_before = XPathEdit(Form)
        self.opt_page_breaks_before.setObjectName(
            _fromUtf8("opt_page_breaks_before"))
        self.gridLayout.addWidget(self.opt_page_breaks_before, 7, 0, 1, 3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 8, 0, 1, 3)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 5, 0, 1, 3)
        self.opt_remove_fake_margins = QtGui.QCheckBox(Form)
        self.opt_remove_fake_margins.setObjectName(
            _fromUtf8("opt_remove_fake_margins"))
        self.gridLayout.addWidget(self.opt_remove_fake_margins, 2, 2, 1, 1)
        self.label.setBuddy(self.opt_chapter_mark)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#8
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(596, 493)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.opt_toc_threshold = QtWidgets.QSpinBox(Form)
        self.opt_toc_threshold.setMaximum(10000)
        self.opt_toc_threshold.setObjectName("opt_toc_threshold")
        self.gridLayout.addWidget(self.opt_toc_threshold, 7, 1, 1, 1)
        self.opt_use_auto_toc = QtWidgets.QCheckBox(Form)
        self.opt_use_auto_toc.setObjectName("opt_use_auto_toc")
        self.gridLayout.addWidget(self.opt_use_auto_toc, 1, 0, 1, 2)
        self.opt_no_chapters_in_toc = QtWidgets.QCheckBox(Form)
        self.opt_no_chapters_in_toc.setObjectName("opt_no_chapters_in_toc")
        self.gridLayout.addWidget(self.opt_no_chapters_in_toc, 2, 0, 1, 2)
        self.label_10 = QtWidgets.QLabel(Form)
        self.label_10.setObjectName("label_10")
        self.gridLayout.addWidget(self.label_10, 6, 0, 1, 1)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 8, 0, 1, 1)
        self.opt_level3_toc = XPathEdit(Form)
        self.opt_level3_toc.setObjectName("opt_level3_toc")
        self.gridLayout.addWidget(self.opt_level3_toc, 11, 0, 1, 2)
        self.opt_max_toc_links = QtWidgets.QSpinBox(Form)
        self.opt_max_toc_links.setMaximum(10000)
        self.opt_max_toc_links.setObjectName("opt_max_toc_links")
        self.gridLayout.addWidget(self.opt_max_toc_links, 6, 1, 1, 1)
        self.label_16 = QtWidgets.QLabel(Form)
        self.label_16.setObjectName("label_16")
        self.gridLayout.addWidget(self.label_16, 7, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 13, 0, 1, 1)
        self.opt_duplicate_links_in_toc = QtWidgets.QCheckBox(Form)
        self.opt_duplicate_links_in_toc.setObjectName("opt_duplicate_links_in_toc")
        self.gridLayout.addWidget(self.opt_duplicate_links_in_toc, 3, 0, 1, 2)
        self.opt_level2_toc = XPathEdit(Form)
        self.opt_level2_toc.setObjectName("opt_level2_toc")
        self.gridLayout.addWidget(self.opt_level2_toc, 10, 0, 1, 2)
        self.opt_toc_filter = QtWidgets.QLineEdit(Form)
        self.opt_toc_filter.setObjectName("opt_toc_filter")
        self.gridLayout.addWidget(self.opt_toc_filter, 8, 1, 1, 1)
        self.opt_level1_toc = XPathEdit(Form)
        self.opt_level1_toc.setObjectName("opt_level1_toc")
        self.gridLayout.addWidget(self.opt_level1_toc, 9, 0, 1, 2)
        self.help_label = QtWidgets.QLabel(Form)
        self.help_label.setWordWrap(True)
        self.help_label.setOpenExternalLinks(True)
        self.help_label.setObjectName("help_label")
        self.gridLayout.addWidget(self.help_label, 0, 0, 1, 2)
        self.manually_fine_tune_toc = QtWidgets.QCheckBox(Form)
        self.manually_fine_tune_toc.setObjectName("manually_fine_tune_toc")
        self.gridLayout.addWidget(self.manually_fine_tune_toc, 12, 0, 1, 2)
        self.label_10.setBuddy(self.opt_max_toc_links)
        self.label.setBuddy(self.opt_toc_filter)
        self.label_16.setBuddy(self.opt_toc_threshold)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#9
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(657, 479)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_chapter = XPathEdit(Form)
        self.opt_chapter.setObjectName(_fromUtf8("opt_chapter"))
        self.gridLayout.addWidget(self.opt_chapter, 0, 0, 1, 3)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.opt_chapter_mark = QtGui.QComboBox(Form)
        self.opt_chapter_mark.setMinimumContentsLength(20)
        self.opt_chapter_mark.setObjectName(_fromUtf8("opt_chapter_mark"))
        self.gridLayout.addWidget(self.opt_chapter_mark, 1, 1, 1, 1)
        self.opt_remove_first_image = QtGui.QCheckBox(Form)
        self.opt_remove_first_image.setObjectName(_fromUtf8("opt_remove_first_image"))
        self.gridLayout.addWidget(self.opt_remove_first_image, 2, 0, 1, 2)
        self.opt_insert_metadata = QtGui.QCheckBox(Form)
        self.opt_insert_metadata.setObjectName(_fromUtf8("opt_insert_metadata"))
        self.gridLayout.addWidget(self.opt_insert_metadata, 3, 0, 1, 2)
        self.opt_page_breaks_before = XPathEdit(Form)
        self.opt_page_breaks_before.setObjectName(_fromUtf8("opt_page_breaks_before"))
        self.gridLayout.addWidget(self.opt_page_breaks_before, 7, 0, 1, 3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 8, 0, 1, 3)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 5, 0, 1, 3)
        self.opt_remove_fake_margins = QtGui.QCheckBox(Form)
        self.opt_remove_fake_margins.setObjectName(_fromUtf8("opt_remove_fake_margins"))
        self.gridLayout.addWidget(self.opt_remove_fake_margins, 2, 2, 1, 1)
        self.label.setBuddy(self.opt_chapter_mark)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#10
0
    def setup_ui(self):
        from calibre.gui2.convert.xpath_wizard import XPathEdit
        self.l = l = QVBoxLayout(self)
        self.setLayout(l)

        self.la = la = QLabel(_(
            'Specify the locations to split at, using an XPath expression (click'
            ' the wizard button for help with generating XPath expressions).'))
        la.setWordWrap(True)
        l.addWidget(la)

        self._xpath = xp = XPathEdit(self)
        xp.set_msg(_('&XPath expression:'))
        xp.setObjectName('editor-multisplit-xpath-edit')
        l.addWidget(xp)
        l.addWidget(self.bb)
示例#11
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(436, 382)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_no_chapters_in_toc = QtGui.QCheckBox(Form)
        self.opt_no_chapters_in_toc.setObjectName(
            _fromUtf8("opt_no_chapters_in_toc"))
        self.gridLayout.addWidget(self.opt_no_chapters_in_toc, 1, 0, 1, 2)
        self.label_10 = QtGui.QLabel(Form)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 3, 0, 1, 1)
        self.opt_max_toc_links = QtGui.QSpinBox(Form)
        self.opt_max_toc_links.setMaximum(10000)
        self.opt_max_toc_links.setObjectName(_fromUtf8("opt_max_toc_links"))
        self.gridLayout.addWidget(self.opt_max_toc_links, 3, 1, 1, 1)
        self.label_16 = QtGui.QLabel(Form)
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.gridLayout.addWidget(self.label_16, 4, 0, 1, 1)
        self.opt_toc_threshold = QtGui.QSpinBox(Form)
        self.opt_toc_threshold.setObjectName(_fromUtf8("opt_toc_threshold"))
        self.gridLayout.addWidget(self.opt_toc_threshold, 4, 1, 1, 1)
        self.opt_use_auto_toc = QtGui.QCheckBox(Form)
        self.opt_use_auto_toc.setObjectName(_fromUtf8("opt_use_auto_toc"))
        self.gridLayout.addWidget(self.opt_use_auto_toc, 0, 0, 1, 2)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 5, 0, 1, 1)
        self.opt_toc_filter = QtGui.QLineEdit(Form)
        self.opt_toc_filter.setObjectName(_fromUtf8("opt_toc_filter"))
        self.gridLayout.addWidget(self.opt_toc_filter, 5, 1, 1, 1)
        self.opt_level1_toc = XPathEdit(Form)
        self.opt_level1_toc.setObjectName(_fromUtf8("opt_level1_toc"))
        self.gridLayout.addWidget(self.opt_level1_toc, 6, 0, 1, 2)
        self.opt_level2_toc = XPathEdit(Form)
        self.opt_level2_toc.setObjectName(_fromUtf8("opt_level2_toc"))
        self.gridLayout.addWidget(self.opt_level2_toc, 7, 0, 1, 2)
        self.opt_level3_toc = XPathEdit(Form)
        self.opt_level3_toc.setObjectName(_fromUtf8("opt_level3_toc"))
        self.gridLayout.addWidget(self.opt_level3_toc, 8, 0, 1, 2)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 9, 0, 1, 1)
        self.opt_duplicate_links_in_toc = QtGui.QCheckBox(Form)
        self.opt_duplicate_links_in_toc.setObjectName(
            _fromUtf8("opt_duplicate_links_in_toc"))
        self.gridLayout.addWidget(self.opt_duplicate_links_in_toc, 2, 0, 1, 2)
        self.label_10.setBuddy(self.opt_max_toc_links)
        self.label_16.setBuddy(self.opt_toc_threshold)
        self.label.setBuddy(self.opt_toc_filter)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#12
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.l = l = QVBoxLayout(self)
        self.h = h = QHBoxLayout()

        self.la = la = QLabel(self.MSG)
        la.setWordWrap(True)
        l.addWidget(la)
        l.addLayout(h)
        english_sentence = '{preamble} {match_type}'
        sentence = _('{preamble} {match_type}')
        if set(sentence.split()) != set(english_sentence.split()):
            sentence = english_sentence
        parts = sentence.split()
        for clause in parts:
            if clause == '{preamble}':
                self.preamble = w = QLabel(_('If the tag'))
            elif clause == '{match_type}':
                self.match_type = w = QComboBox(self)
                for action, m in MATCH_TYPE_MAP.items():
                    w.addItem(m.text, action)
                w.currentIndexChanged.connect(self.update_state)
            h.addWidget(w)
            if clause is not parts[-1]:
                h.addWidget(QLabel('\xa0'))
        h.addStretch(1)
        self.generic_query = gq = GenericEdit(self)
        self.css_query = cq = CSSEdit(self)
        self.xpath_query = xq = XPathEdit(
            self, object_name='html_transform_rules_xpath', show_msg=False)
        l.addWidget(gq), l.addWidget(cq), l.addWidget(xq)

        self.thenl = QLabel(_('Then:'))
        l.addWidget(self.thenl)
        self.actions = a = ActionsContainer(self)
        l.addWidget(a)
        self.add_button = b = QPushButton(QIcon(I('plus.png')),
                                          _('Add another action'))
        b.clicked.connect(self.actions.new_action)
        l.addWidget(b)
        self.update_state()
示例#13
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(596, 493)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.opt_toc_threshold = QtWidgets.QSpinBox(Form)
        self.opt_toc_threshold.setMaximum(10000)
        self.opt_toc_threshold.setObjectName("opt_toc_threshold")
        self.gridLayout.addWidget(self.opt_toc_threshold, 7, 1, 1, 1)
        self.opt_use_auto_toc = QtWidgets.QCheckBox(Form)
        self.opt_use_auto_toc.setObjectName("opt_use_auto_toc")
        self.gridLayout.addWidget(self.opt_use_auto_toc, 1, 0, 1, 2)
        self.opt_no_chapters_in_toc = QtWidgets.QCheckBox(Form)
        self.opt_no_chapters_in_toc.setObjectName("opt_no_chapters_in_toc")
        self.gridLayout.addWidget(self.opt_no_chapters_in_toc, 2, 0, 1, 2)
        self.label_10 = QtWidgets.QLabel(Form)
        self.label_10.setObjectName("label_10")
        self.gridLayout.addWidget(self.label_10, 6, 0, 1, 1)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 8, 0, 1, 1)
        self.opt_level3_toc = XPathEdit(Form)
        self.opt_level3_toc.setObjectName("opt_level3_toc")
        self.gridLayout.addWidget(self.opt_level3_toc, 11, 0, 1, 2)
        self.opt_max_toc_links = QtWidgets.QSpinBox(Form)
        self.opt_max_toc_links.setMaximum(10000)
        self.opt_max_toc_links.setObjectName("opt_max_toc_links")
        self.gridLayout.addWidget(self.opt_max_toc_links, 6, 1, 1, 1)
        self.label_16 = QtWidgets.QLabel(Form)
        self.label_16.setObjectName("label_16")
        self.gridLayout.addWidget(self.label_16, 7, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 13, 0, 1, 1)
        self.opt_duplicate_links_in_toc = QtWidgets.QCheckBox(Form)
        self.opt_duplicate_links_in_toc.setObjectName(
            "opt_duplicate_links_in_toc")
        self.gridLayout.addWidget(self.opt_duplicate_links_in_toc, 3, 0, 1, 2)
        self.opt_level2_toc = XPathEdit(Form)
        self.opt_level2_toc.setObjectName("opt_level2_toc")
        self.gridLayout.addWidget(self.opt_level2_toc, 10, 0, 1, 2)
        self.opt_toc_filter = QtWidgets.QLineEdit(Form)
        self.opt_toc_filter.setObjectName("opt_toc_filter")
        self.gridLayout.addWidget(self.opt_toc_filter, 8, 1, 1, 1)
        self.opt_level1_toc = XPathEdit(Form)
        self.opt_level1_toc.setObjectName("opt_level1_toc")
        self.gridLayout.addWidget(self.opt_level1_toc, 9, 0, 1, 2)
        self.help_label = QtWidgets.QLabel(Form)
        self.help_label.setWordWrap(True)
        self.help_label.setOpenExternalLinks(True)
        self.help_label.setObjectName("help_label")
        self.gridLayout.addWidget(self.help_label, 0, 0, 1, 2)
        self.manually_fine_tune_toc = QtWidgets.QCheckBox(Form)
        self.manually_fine_tune_toc.setObjectName("manually_fine_tune_toc")
        self.gridLayout.addWidget(self.manually_fine_tune_toc, 12, 0, 1, 2)
        self.label_10.setBuddy(self.opt_max_toc_links)
        self.label.setBuddy(self.opt_toc_filter)
        self.label_16.setBuddy(self.opt_toc_threshold)

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

    def retranslateUi(self, Form):

        Form.setWindowTitle(_("Form"))
        self.opt_use_auto_toc.setText(
            _("&Force use of auto-generated Table of Contents"))
        self.opt_no_chapters_in_toc.setText(
            _("Do not add &detected chapters to the Table of Contents"))
        self.label_10.setText(
            _("Number of &links to add to Table of Contents:"))
        self.label.setText(_("TOC &filter:"))
        self.label_16.setText(_("Chapter &threshold:"))
        self.opt_duplicate_links_in_toc.setText(
            _("Allow &duplicate links when creating the Table of Contents"))
        self.help_label.setText(
            _("<a href=\"%s\">Help with using these options to generate a Table of Contents</a>"
              ))
        self.manually_fine_tune_toc.setToolTip(
            _("This option will cause calibre to popup the Table of Contents Editor tool,\n"
              " which will allow you to manually edit the Table of Contents, to fix any errors\n"
              " caused by automatic generation."))
        self.manually_fine_tune_toc.setText(
            _("&Manually fine-tune the ToC after conversion is completed"))
示例#14
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(436, 382)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.opt_no_chapters_in_toc = QtGui.QCheckBox(Form)
        self.opt_no_chapters_in_toc.setObjectName(
            _fromUtf8("opt_no_chapters_in_toc"))
        self.gridLayout.addWidget(self.opt_no_chapters_in_toc, 1, 0, 1, 2)
        self.label_10 = QtGui.QLabel(Form)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 3, 0, 1, 1)
        self.opt_max_toc_links = QtGui.QSpinBox(Form)
        self.opt_max_toc_links.setMaximum(10000)
        self.opt_max_toc_links.setObjectName(_fromUtf8("opt_max_toc_links"))
        self.gridLayout.addWidget(self.opt_max_toc_links, 3, 1, 1, 1)
        self.label_16 = QtGui.QLabel(Form)
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.gridLayout.addWidget(self.label_16, 4, 0, 1, 1)
        self.opt_toc_threshold = QtGui.QSpinBox(Form)
        self.opt_toc_threshold.setObjectName(_fromUtf8("opt_toc_threshold"))
        self.gridLayout.addWidget(self.opt_toc_threshold, 4, 1, 1, 1)
        self.opt_use_auto_toc = QtGui.QCheckBox(Form)
        self.opt_use_auto_toc.setObjectName(_fromUtf8("opt_use_auto_toc"))
        self.gridLayout.addWidget(self.opt_use_auto_toc, 0, 0, 1, 2)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 5, 0, 1, 1)
        self.opt_toc_filter = QtGui.QLineEdit(Form)
        self.opt_toc_filter.setObjectName(_fromUtf8("opt_toc_filter"))
        self.gridLayout.addWidget(self.opt_toc_filter, 5, 1, 1, 1)
        self.opt_level1_toc = XPathEdit(Form)
        self.opt_level1_toc.setObjectName(_fromUtf8("opt_level1_toc"))
        self.gridLayout.addWidget(self.opt_level1_toc, 6, 0, 1, 2)
        self.opt_level2_toc = XPathEdit(Form)
        self.opt_level2_toc.setObjectName(_fromUtf8("opt_level2_toc"))
        self.gridLayout.addWidget(self.opt_level2_toc, 7, 0, 1, 2)
        self.opt_level3_toc = XPathEdit(Form)
        self.opt_level3_toc.setObjectName(_fromUtf8("opt_level3_toc"))
        self.gridLayout.addWidget(self.opt_level3_toc, 8, 0, 1, 2)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 9, 0, 1, 1)
        self.opt_duplicate_links_in_toc = QtGui.QCheckBox(Form)
        self.opt_duplicate_links_in_toc.setObjectName(
            _fromUtf8("opt_duplicate_links_in_toc"))
        self.gridLayout.addWidget(self.opt_duplicate_links_in_toc, 2, 0, 1, 2)
        self.label_10.setBuddy(self.opt_max_toc_links)
        self.label_16.setBuddy(self.opt_toc_threshold)
        self.label.setBuddy(self.opt_toc_filter)

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

    def retranslateUi(self, Form):
        Form.setWindowTitle(_("Form"))
        self.opt_no_chapters_in_toc.setText(
            _("Do not add &detected chapters to the Table of Contents"))
        self.label_10.setText(
            _("Number of &links to add to Table of Contents"))
        self.label_16.setText(_("Chapter &threshold"))
        self.opt_use_auto_toc.setText(
            _("&Force use of auto-generated Table of Contents"))
        self.label.setText(_("TOC &Filter:"))
        self.opt_duplicate_links_in_toc.setText(
            _("Allow &duplicate links when creating the Table of Contents"))