def __init__(self, parent=None): BasicSettings.__init__(self, parent) self.l = l = QFormLayout(self) self.setLayout(l) fc = FontFamilyChooser(self) self('editor_font_family', widget=fc, getter=attrgetter('font_family'), setter=lambda x, val: setattr(x, 'font_family', val)) fc.family_changed.connect(self.emit_changed) l.addRow(_('Editor font &family:'), fc) fs = self('editor_font_size') fs.setMinimum(8), fs.setSuffix(' pt'), fs.setMaximum(50) l.addRow(_('Editor font &size:'), fs) auto_theme = _('Automatic (%s)') % default_theme() choices = {k:k for k in THEMES} choices['auto'] = auto_theme theme = self.choices_widget('editor_theme', choices, 'auto', 'auto') l.addRow(_('&Color scheme:'), theme) tw = self('editor_tab_stop_width') tw.setMinimum(2), tw.setSuffix(_(' characters')), tw.setMaximum(20) l.addRow(_('Width of &tabs:'), tw) lw = self('editor_line_wrap') lw.setText(_('&Wrap long lines in the editor')) l.addRow(lw)
def __init__(self, parent=None): BasicSettings.__init__(self, parent) self.dictionaries_changed = False self.l = l = QFormLayout(self) self.setLayout(l) fc = FontFamilyChooser(self) self('editor_font_family', widget=fc, getter=attrgetter('font_family'), setter=lambda x, val: setattr(x, 'font_family', val)) fc.family_changed.connect(self.emit_changed) l.addRow(_('Editor font &family:'), fc) fs = self('editor_font_size') fs.setMinimum(8), fs.setSuffix(' pt'), fs.setMaximum(50) l.addRow(_('Editor font &size:'), fs) auto_theme = _('Automatic (%s)') % default_theme() choices = {k:k for k in THEMES} choices['auto'] = auto_theme theme = self.choices_widget('editor_theme', choices, 'auto', 'auto') l.addRow(_('&Color scheme:'), theme) tw = self('editor_tab_stop_width') tw.setMinimum(2), tw.setSuffix(_(' characters')), tw.setMaximum(20) l.addRow(_('Width of &tabs:'), tw) lw = self('editor_line_wrap') lw.setText(_('&Wrap long lines in the editor')) l.addRow(lw) lw = self('replace_entities_as_typed') lw.setText(_('&Replace HTML entities as they are typed')) lw.setToolTip('<p>' + _( 'With this option, every time you type in a complete html entity, such as &hellip;' ' it is automatically replaced by its corresponding character. The replacement' ' happens only when the trailing semi-colon is typed.')) l.addRow(lw) lw = self('editor_show_char_under_cursor') lw.setText(_('Show the name of the current character before the cursor along with the line and column number')) l.addRow(lw) lw = self('pretty_print_on_open') lw.setText(_('Beautify individual files automatically when they are opened')) lw.setToolTip('<p>' + _( 'This will cause the beautify current file action to be performed automatically every' ' time you open a HTML/CSS/etc. file for editing.')) l.addRow(lw) self.dictionaries = d = QPushButton(_('Manage &spelling dictionaries'), self) d.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) d.clicked.connect(self.manage_dictionaries) l.addRow(d)
def __init__(self, mi=None, prefs=None, parent=None, for_global_prefs=False): QWidget.__init__(self, parent) self.ignore_changed = False self.for_global_prefs = for_global_prefs self.l = l = QHBoxLayout(self) l.setContentsMargins(0, 0, 0, 0) self.setLayout(l) self.settings_tabs = st = QTabWidget(self) l.addWidget(st) self.preview_label = la = Preview(self) l.addWidget(la) if prefs is None: prefs = cprefs self.original_prefs = prefs self.mi = mi or self.default_mi() self.colors_page = cp = QWidget(st) st.addTab(cp, _('&Colors')) cp.l = l = QGridLayout() cp.setLayout(l) if for_global_prefs: msg = _( 'When generating covers, a color scheme for the cover is chosen at random from the' ' color schemes below. You can prevent an individual scheme from being selected by' ' unchecking it. The preview on the right shows the currently selected color scheme.' ) else: msg = _( 'Choose a color scheme to be used for this generated cover.' ) + '<p>' + _( 'In normal cover generation, the color scheme is chosen at random from the list of color schemes below. You' ' can prevent an individual color scheme from being chosen by unchecking it here.' ) cp.la = la = QLabel('<p>' + msg) la.setWordWrap(True) l.addWidget(la, 0, 0, 1, -1) self.colors_list = cl = QListWidget(cp) l.addWidget(cl, 1, 0, 1, -1) self.colors_map = OrderedDict() self.ncs = ncs = QPushButton(QIcon(I('plus.png')), _('&New color scheme'), cp) ncs.clicked.connect(self.create_color_scheme) l.addWidget(ncs) self.ecs = ecs = QPushButton(QIcon(I('format-fill-color.png')), _('&Edit color scheme'), cp) ecs.clicked.connect(self.edit_color_scheme) l.addWidget(ecs, l.rowCount() - 1, 1) self.rcs = rcs = QPushButton(QIcon(I('minus.png')), _('&Remove color scheme'), cp) rcs.clicked.connect(self.remove_color_scheme) l.addWidget(rcs, l.rowCount() - 1, 2) self.styles_page = sp = QWidget(st) st.addTab(sp, _('&Styles')) sp.l = l = QVBoxLayout() sp.setLayout(l) if for_global_prefs: msg = _( 'When generating covers, a style for the cover is chosen at random from the' ' styles below. You can prevent an individual style from being selected by' ' unchecking it. The preview on the right shows the currently selected style.' ) else: msg = _( 'Choose a style to be used for this generated cover.' ) + '<p>' + _( 'In normal cover generation, the style is chosen at random from the list of styles below. You' ' can prevent an individual style from being chosen by unchecking it here.' ) sp.la = la = QLabel('<p>' + msg) la.setWordWrap(True) l.addWidget(la) self.styles_list = sl = QListWidget(sp) l.addWidget(sl) self.style_map = OrderedDict() self.font_page = fp = QWidget(st) st.addTab(fp, _('&Fonts and sizes')) fp.l = l = QFormLayout() fp.setLayout(l) fp.f = [] def add_hline(): f = QFrame() fp.f.append(f) f.setFrameShape(QFrame.Shape.HLine) l.addRow(f) for x, label, size_label in ( ('title', _('&Title font family:'), _('&Title font size:')), ('subtitle', _('&Subtitle font family'), _('&Subtitle font size:')), ('footer', _('&Footer font family'), _('&Footer font size')), ): attr = '%s_font_family' % x ff = FontFamilyChooser(fp) setattr(self, attr, ff) l.addRow(label, ff) ff.family_changed.connect(self.emit_changed) attr = '%s_font_size' % x fs = QSpinBox(fp) setattr(self, attr, fs) fs.setMinimum(8), fs.setMaximum(200), fs.setSuffix(' px') fs.setValue(prefs[attr]) fs.valueChanged.connect(self.emit_changed) l.addRow(size_label, fs) add_hline() self.changed_timer = t = QTimer(self) t.setSingleShot(True), t.setInterval(500), t.timeout.connect( self.emit_changed) def create_sz(label): ans = QSpinBox(self) ans.setSuffix(' px'), ans.setMinimum(100), ans.setMaximum(10000) l.addRow(label, ans) ans.valueChanged.connect(self.changed_timer.start) return ans self.cover_width = create_sz(_('Cover &width:')) self.cover_height = create_sz(_('Cover &height:')) fp.cla = la = QLabel( _('Note that the preview to the side is of fixed aspect ratio, so changing the cover' ' width above will not have any effect. If you change the height, you should also change the width nevertheless' ' as it will be used in actual cover generation.')) la.setWordWrap(True) l.addRow(la) self.templates_page = tp = QWidget(st) st.addTab(tp, _('&Text')) tp.l = l = QVBoxLayout() tp.setLayout(l) tp.la = la = QLabel( _('The text on the generated cover is taken from the metadata of the book.' ' This is controlled via templates. You can use the <b>, <i> and <br> tags' ' in the templates for bold, italic and line breaks, respectively. The' ' default templates use the title, series and authors. You can change them to use' ' whatever metadata you like.')) la.setWordWrap(True), la.setTextFormat(Qt.TextFormat.PlainText) l.addWidget(la) def create_template_widget(title, which, button): attr = which + '_template' heading = QLabel('<h2>' + title) setattr(tp, attr + '_heading', heading) l.addWidget(heading) la = QLabel() setattr(self, attr, la) l.addWidget(la), la.setTextFormat( Qt.TextFormat.PlainText), la.setStyleSheet( 'QLabel {font-family: monospace}') la.setWordWrap(True) b = QPushButton(button) b.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) connect_lambda(b.clicked, self, lambda self: self.change_template(which)) setattr(self, attr + '_button', b) l.addWidget(b) if which != 'footer': f = QFrame(tp) setattr(tp, attr + '_sep', f), f.setFrameShape(QFrame.Shape.HLine) l.addWidget(f) l.addSpacing(10) create_template_widget(_('The title template'), 'title', _('Change the &title template')) create_template_widget(_('The sub-title template'), 'subtitle', _('Change the &sub-title template')) create_template_widget(_('The footer template'), 'footer', _('Change the &footer template')) l.addStretch(2) self.apply_prefs(prefs) self.changed.connect(self.update_preview) self.styles_list.itemSelectionChanged.connect(self.update_preview) self.colors_list.itemSelectionChanged.connect(self.update_preview) self.update_preview()
def __init__(self, parent=None): BasicSettings.__init__(self, parent) self.dictionaries_changed = self.snippets_changed = False self.l = l = QFormLayout(self) self.setLayout(l) fc = FontFamilyChooser(self) self('editor_font_family', widget=fc, getter=attrgetter('font_family'), setter=lambda x, val: setattr(x, 'font_family', val)) fc.family_changed.connect(self.emit_changed) l.addRow(_('Editor font family:'), fc) fs = self('editor_font_size') fs.setMinimum(8), fs.setSuffix(' pt'), fs.setMaximum(50) l.addRow(_('Editor font &size:'), fs) choices = self.theme_choices() theme = self.choices_widget('editor_theme', choices, 'auto', 'auto') self.custom_theme_button = b = QPushButton(_('Create/edit &custom color schemes')) b.clicked.connect(self.custom_theme) h = QHBoxLayout() h.addWidget(theme), h.addWidget(b) l.addRow(_('&Color scheme:'), h) l.labelForField(h).setBuddy(theme) tw = self('editor_tab_stop_width') tw.setMinimum(2), tw.setSuffix(_(' characters')), tw.setMaximum(20) l.addRow(_('W&idth of tabs:'), tw) self.tb = b = QPushButton(_('Change &templates')) l.addRow(_('Templates for new files:'), b) connect_lambda(b.clicked, self, lambda self: TemplatesDialog(self).exec_()) lw = self('editor_line_wrap') lw.setText(_('&Wrap long lines in the editor')) l.addRow(lw) lw = self('replace_entities_as_typed') lw.setText(_('&Replace HTML entities as they are typed')) lw.setToolTip('<p>' + _( 'With this option, every time you type in a complete html entity, such as &hellip;' ' it is automatically replaced by its corresponding character. The replacement' ' happens only when the trailing semi-colon is typed.')) l.addRow(lw) lw = self('auto_close_tags') lw.setText(_('Auto close t&ags when typing </')) lw.setToolTip('<p>' + prepare_string_for_xml(_( 'With this option, every time you type </ the current HTML closing tag is auto-completed'))) l.addRow(lw) lw = self('editor_show_char_under_cursor') lw.setText(_('Show the &name of the current character before the cursor along with the line and column number')) l.addRow(lw) lw = self('pretty_print_on_open') lw.setText(_('Beautify individual &files automatically when they are opened')) lw.setToolTip('<p>' + _( 'This will cause the beautify current file action to be performed automatically every' ' time you open a HTML/CSS/etc. file for editing.')) l.addRow(lw) lw = self('inline_spell_check') lw.setText(_('Show &misspelled words underlined in the code view')) lw.setToolTip('<p>' + _( 'This will cause spelling errors to be highlighted in the code view' ' for easy correction as you type.')) l.addRow(lw) lw = self('editor_accepts_drops') lw.setText(_('Allow drag and drop &editing of text')) lw.setToolTip('<p>' + _( 'Allow using drag and drop to move text around in the editor.' ' It can be useful to turn this off if you have a misbehaving touchpad.')) l.addRow(lw) self.dictionaries = d = QPushButton(_('Manage &spelling dictionaries'), self) d.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) d.clicked.connect(self.manage_dictionaries) l.addRow(d) self.snippets = s = QPushButton(_('Manage sni&ppets'), self) s.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) s.clicked.connect(self.manage_snippets) l.addRow(s)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(765, 619) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.MainTabs = QtWidgets.QTabWidget(Form) self.MainTabs.setObjectName("MainTabs") self.tab1 = QtWidgets.QWidget() self.tab1.setObjectName("tab1") self.formLayout = QtWidgets.QFormLayout(self.tab1) self.formLayout.setObjectName("formLayout") self.label_18 = QtWidgets.QLabel(self.tab1) self.label_18.setObjectName("label_18") self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_18) self.opt_base_font_size = QtWidgets.QDoubleSpinBox(self.tab1) self.opt_base_font_size.setDecimals(1) self.opt_base_font_size.setMinimum(0.0) self.opt_base_font_size.setMaximum(50.0) self.opt_base_font_size.setSingleStep(1.0) self.opt_base_font_size.setProperty("value", 15.0) self.opt_base_font_size.setObjectName("opt_base_font_size") self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.opt_base_font_size) self.label_2 = QtWidgets.QLabel(self.tab1) self.label_2.setObjectName("label_2") self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.opt_font_size_mapping = QtWidgets.QLineEdit(self.tab1) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.opt_font_size_mapping.sizePolicy().hasHeightForWidth()) self.opt_font_size_mapping.setSizePolicy(sizePolicy) self.opt_font_size_mapping.setObjectName("opt_font_size_mapping") self.horizontalLayout.addWidget(self.opt_font_size_mapping) self.button_font_key = QtWidgets.QToolButton(self.tab1) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(I("wizard.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.button_font_key.setIcon(icon) self.button_font_key.setIconSize(QtCore.QSize(32, 32)) self.button_font_key.setObjectName("button_font_key") self.horizontalLayout.addWidget(self.button_font_key) self.formLayout.setLayout(2, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout) self.label_6 = QtWidgets.QLabel(self.tab1) self.label_6.setObjectName("label_6") self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_6) self.opt_minimum_line_height = QtWidgets.QDoubleSpinBox(self.tab1) self.opt_minimum_line_height.setDecimals(1) self.opt_minimum_line_height.setMaximum(900.0) self.opt_minimum_line_height.setObjectName("opt_minimum_line_height") self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.opt_minimum_line_height) self.label = QtWidgets.QLabel(self.tab1) self.label.setObjectName("label") self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label) self.opt_line_height = QtWidgets.QDoubleSpinBox(self.tab1) self.opt_line_height.setDecimals(1) self.opt_line_height.setObjectName("opt_line_height") self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.opt_line_height) self.label_10 = QtWidgets.QLabel(self.tab1) self.label_10.setObjectName("label_10") self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_10) self.opt_embed_font_family = FontFamilyChooser(self.tab1) self.opt_embed_font_family.setObjectName("opt_embed_font_family") self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.opt_embed_font_family) self.opt_embed_all_fonts = QtWidgets.QCheckBox(self.tab1) self.opt_embed_all_fonts.setObjectName("opt_embed_all_fonts") self.formLayout.setWidget(6, QtWidgets.QFormLayout.SpanningRole, self.opt_embed_all_fonts) self.opt_subset_embedded_fonts = QtWidgets.QCheckBox(self.tab1) self.opt_subset_embedded_fonts.setObjectName( "opt_subset_embedded_fonts") self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.opt_subset_embedded_fonts) self.opt_expand_css = QtWidgets.QCheckBox(self.tab1) self.opt_expand_css.setObjectName("opt_expand_css") self.formLayout.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.opt_expand_css) self.opt_keep_ligatures = QtWidgets.QCheckBox(self.tab1) self.opt_keep_ligatures.setObjectName("opt_keep_ligatures") self.formLayout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.opt_keep_ligatures) self.opt_disable_font_rescaling = QtWidgets.QCheckBox(self.tab1) self.opt_disable_font_rescaling.setObjectName( "opt_disable_font_rescaling") self.formLayout.setWidget(0, QtWidgets.QFormLayout.SpanningRole, self.opt_disable_font_rescaling) self.MainTabs.addTab(self.tab1, "") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.formLayout_2 = QtWidgets.QFormLayout(self.tab) self.formLayout_2.setObjectName("formLayout_2") self.opt_input_encoding = EncodingComboBox(self.tab) self.opt_input_encoding.setEditable(True) self.opt_input_encoding.setObjectName("opt_input_encoding") self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.opt_input_encoding) self.label_5 = QtWidgets.QLabel(self.tab) self.label_5.setObjectName("label_5") self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_5) self.opt_change_justification = QtWidgets.QComboBox(self.tab) self.opt_change_justification.setObjectName("opt_change_justification") self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.opt_change_justification) self.opt_smarten_punctuation = QtWidgets.QCheckBox(self.tab) self.opt_smarten_punctuation.setObjectName("opt_smarten_punctuation") self.formLayout_2.setWidget(4, QtWidgets.QFormLayout.SpanningRole, self.opt_smarten_punctuation) self.opt_unsmarten_punctuation = QtWidgets.QCheckBox(self.tab) self.opt_unsmarten_punctuation.setObjectName( "opt_unsmarten_punctuation") self.formLayout_2.setWidget(5, QtWidgets.QFormLayout.SpanningRole, self.opt_unsmarten_punctuation) self.opt_asciiize = QtWidgets.QCheckBox(self.tab) self.opt_asciiize.setObjectName("opt_asciiize") self.formLayout_2.setWidget(7, QtWidgets.QFormLayout.SpanningRole, self.opt_asciiize) self.label_3 = QtWidgets.QLabel(self.tab) self.label_3.setObjectName("label_3") self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3) self.MainTabs.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.gridLayout = QtWidgets.QGridLayout(self.tab_2) self.gridLayout.setObjectName("gridLayout") self.label_7 = QtWidgets.QLabel(self.tab_2) self.label_7.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.label_7.setObjectName("label_7") self.gridLayout.addWidget(self.label_7, 1, 1, 1, 1) self.opt_remove_paragraph_spacing_indent_size = QtWidgets.QDoubleSpinBox( self.tab_2) self.opt_remove_paragraph_spacing_indent_size.setDecimals(1) self.opt_remove_paragraph_spacing_indent_size.setMinimum(-0.1) self.opt_remove_paragraph_spacing_indent_size.setSingleStep(0.1) self.opt_remove_paragraph_spacing_indent_size.setObjectName( "opt_remove_paragraph_spacing_indent_size") self.gridLayout.addWidget( self.opt_remove_paragraph_spacing_indent_size, 0, 2, 1, 1) self.opt_insert_blank_line = QtWidgets.QCheckBox(self.tab_2) self.opt_insert_blank_line.setObjectName("opt_insert_blank_line") self.gridLayout.addWidget(self.opt_insert_blank_line, 1, 0, 1, 1) self.opt_remove_paragraph_spacing = QtWidgets.QCheckBox(self.tab_2) self.opt_remove_paragraph_spacing.setObjectName( "opt_remove_paragraph_spacing") self.gridLayout.addWidget(self.opt_remove_paragraph_spacing, 0, 0, 1, 1) self.opt_insert_blank_line_size = QtWidgets.QDoubleSpinBox(self.tab_2) self.opt_insert_blank_line_size.setDecimals(1) self.opt_insert_blank_line_size.setObjectName( "opt_insert_blank_line_size") self.gridLayout.addWidget(self.opt_insert_blank_line_size, 1, 2, 1, 1) self.label_4 = QtWidgets.QLabel(self.tab_2) self.label_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 0, 1, 1, 1) self.opt_linearize_tables = QtWidgets.QCheckBox(self.tab_2) self.opt_linearize_tables.setObjectName("opt_linearize_tables") self.gridLayout.addWidget(self.opt_linearize_tables, 2, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 3, 0, 1, 1) self.MainTabs.addTab(self.tab_2, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.verticalLayout = QtWidgets.QVBoxLayout(self.tab_3) self.verticalLayout.setObjectName("verticalLayout") self.groupBox = QtWidgets.QGroupBox(self.tab_3) self.groupBox.setObjectName("groupBox") self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox) self.gridLayout_4.setObjectName("gridLayout_4") self.opt_extra_css = QtWidgets.QPlainTextEdit(self.groupBox) self.opt_extra_css.setObjectName("opt_extra_css") self.gridLayout_4.addWidget(self.opt_extra_css, 0, 0, 1, 1) self.verticalLayout.addWidget(self.groupBox) self.opt_filter_css = QtWidgets.QGroupBox(self.tab_3) self.opt_filter_css.setObjectName("opt_filter_css") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.opt_filter_css) self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_8 = QtWidgets.QLabel(self.opt_filter_css) self.label_8.setWordWrap(True) self.label_8.setObjectName("label_8") self.verticalLayout_3.addWidget(self.label_8) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.filter_css_fonts = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_fonts.setObjectName("filter_css_fonts") self.horizontalLayout_3.addWidget(self.filter_css_fonts) self.filter_css_margins = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_margins.setObjectName("filter_css_margins") self.horizontalLayout_3.addWidget(self.filter_css_margins) self.filter_css_padding = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_padding.setObjectName("filter_css_padding") self.horizontalLayout_3.addWidget(self.filter_css_padding) self.filter_css_floats = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_floats.setObjectName("filter_css_floats") self.horizontalLayout_3.addWidget(self.filter_css_floats) self.filter_css_colors = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_colors.setObjectName("filter_css_colors") self.horizontalLayout_3.addWidget(self.filter_css_colors) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.label_9 = QtWidgets.QLabel(self.opt_filter_css) self.label_9.setObjectName("label_9") self.horizontalLayout_4.addWidget(self.label_9) self.filter_css_others = QtWidgets.QLineEdit(self.opt_filter_css) self.filter_css_others.setObjectName("filter_css_others") self.horizontalLayout_4.addWidget(self.filter_css_others) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.verticalLayout.addWidget(self.opt_filter_css) self.MainTabs.addTab(self.tab_3, "") self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName("tab_4") self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_4) self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.verticalLayout_4.setSpacing(0) self.verticalLayout_4.setObjectName("verticalLayout_4") self.opt_transform_css_rules = RulesWidget(self.tab_4) self.opt_transform_css_rules.setObjectName("opt_transform_css_rules") self.verticalLayout_4.addWidget(self.opt_transform_css_rules) self.MainTabs.addTab(self.tab_4, "") self.verticalLayout_2.addWidget(self.MainTabs) self.label_18.setBuddy(self.opt_base_font_size) self.label_2.setBuddy(self.opt_font_size_mapping) self.label_6.setBuddy(self.opt_minimum_line_height) self.label.setBuddy(self.opt_line_height) self.label_10.setBuddy(self.opt_embed_font_family) self.label_5.setBuddy(self.opt_change_justification) self.label_3.setBuddy(self.opt_input_encoding) self.label_7.setBuddy(self.opt_insert_blank_line_size) self.label_4.setBuddy(self.opt_remove_paragraph_spacing_indent_size) self.label_9.setBuddy(self.filter_css_others) self.retranslateUi(Form) self.MainTabs.setCurrentIndex(0) self.opt_disable_font_rescaling.toggled['bool'].connect( self.opt_base_font_size.setDisabled) self.opt_disable_font_rescaling.toggled['bool'].connect( self.opt_font_size_mapping.setDisabled) self.opt_remove_paragraph_spacing.toggled['bool'].connect( self.label_4.setEnabled) self.opt_remove_paragraph_spacing.toggled['bool'].connect( self.opt_remove_paragraph_spacing_indent_size.setEnabled) QtCore.QMetaObject.connectSlotsByName(Form)
class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(765, 619) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.MainTabs = QtWidgets.QTabWidget(Form) self.MainTabs.setObjectName("MainTabs") self.tab1 = QtWidgets.QWidget() self.tab1.setObjectName("tab1") self.formLayout = QtWidgets.QFormLayout(self.tab1) self.formLayout.setObjectName("formLayout") self.label_18 = QtWidgets.QLabel(self.tab1) self.label_18.setObjectName("label_18") self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_18) self.opt_base_font_size = QtWidgets.QDoubleSpinBox(self.tab1) self.opt_base_font_size.setDecimals(1) self.opt_base_font_size.setMinimum(0.0) self.opt_base_font_size.setMaximum(50.0) self.opt_base_font_size.setSingleStep(1.0) self.opt_base_font_size.setProperty("value", 15.0) self.opt_base_font_size.setObjectName("opt_base_font_size") self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.opt_base_font_size) self.label_2 = QtWidgets.QLabel(self.tab1) self.label_2.setObjectName("label_2") self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.opt_font_size_mapping = QtWidgets.QLineEdit(self.tab1) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.opt_font_size_mapping.sizePolicy().hasHeightForWidth()) self.opt_font_size_mapping.setSizePolicy(sizePolicy) self.opt_font_size_mapping.setObjectName("opt_font_size_mapping") self.horizontalLayout.addWidget(self.opt_font_size_mapping) self.button_font_key = QtWidgets.QToolButton(self.tab1) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(I("wizard.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.button_font_key.setIcon(icon) self.button_font_key.setIconSize(QtCore.QSize(32, 32)) self.button_font_key.setObjectName("button_font_key") self.horizontalLayout.addWidget(self.button_font_key) self.formLayout.setLayout(2, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout) self.label_6 = QtWidgets.QLabel(self.tab1) self.label_6.setObjectName("label_6") self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_6) self.opt_minimum_line_height = QtWidgets.QDoubleSpinBox(self.tab1) self.opt_minimum_line_height.setDecimals(1) self.opt_minimum_line_height.setMaximum(900.0) self.opt_minimum_line_height.setObjectName("opt_minimum_line_height") self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.opt_minimum_line_height) self.label = QtWidgets.QLabel(self.tab1) self.label.setObjectName("label") self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label) self.opt_line_height = QtWidgets.QDoubleSpinBox(self.tab1) self.opt_line_height.setDecimals(1) self.opt_line_height.setObjectName("opt_line_height") self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.opt_line_height) self.label_10 = QtWidgets.QLabel(self.tab1) self.label_10.setObjectName("label_10") self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_10) self.opt_embed_font_family = FontFamilyChooser(self.tab1) self.opt_embed_font_family.setObjectName("opt_embed_font_family") self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.opt_embed_font_family) self.opt_embed_all_fonts = QtWidgets.QCheckBox(self.tab1) self.opt_embed_all_fonts.setObjectName("opt_embed_all_fonts") self.formLayout.setWidget(6, QtWidgets.QFormLayout.SpanningRole, self.opt_embed_all_fonts) self.opt_subset_embedded_fonts = QtWidgets.QCheckBox(self.tab1) self.opt_subset_embedded_fonts.setObjectName( "opt_subset_embedded_fonts") self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.opt_subset_embedded_fonts) self.opt_expand_css = QtWidgets.QCheckBox(self.tab1) self.opt_expand_css.setObjectName("opt_expand_css") self.formLayout.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.opt_expand_css) self.opt_keep_ligatures = QtWidgets.QCheckBox(self.tab1) self.opt_keep_ligatures.setObjectName("opt_keep_ligatures") self.formLayout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.opt_keep_ligatures) self.opt_disable_font_rescaling = QtWidgets.QCheckBox(self.tab1) self.opt_disable_font_rescaling.setObjectName( "opt_disable_font_rescaling") self.formLayout.setWidget(0, QtWidgets.QFormLayout.SpanningRole, self.opt_disable_font_rescaling) self.MainTabs.addTab(self.tab1, "") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.formLayout_2 = QtWidgets.QFormLayout(self.tab) self.formLayout_2.setObjectName("formLayout_2") self.opt_input_encoding = EncodingComboBox(self.tab) self.opt_input_encoding.setEditable(True) self.opt_input_encoding.setObjectName("opt_input_encoding") self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.opt_input_encoding) self.label_5 = QtWidgets.QLabel(self.tab) self.label_5.setObjectName("label_5") self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_5) self.opt_change_justification = QtWidgets.QComboBox(self.tab) self.opt_change_justification.setObjectName("opt_change_justification") self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.opt_change_justification) self.opt_smarten_punctuation = QtWidgets.QCheckBox(self.tab) self.opt_smarten_punctuation.setObjectName("opt_smarten_punctuation") self.formLayout_2.setWidget(4, QtWidgets.QFormLayout.SpanningRole, self.opt_smarten_punctuation) self.opt_unsmarten_punctuation = QtWidgets.QCheckBox(self.tab) self.opt_unsmarten_punctuation.setObjectName( "opt_unsmarten_punctuation") self.formLayout_2.setWidget(5, QtWidgets.QFormLayout.SpanningRole, self.opt_unsmarten_punctuation) self.opt_asciiize = QtWidgets.QCheckBox(self.tab) self.opt_asciiize.setObjectName("opt_asciiize") self.formLayout_2.setWidget(7, QtWidgets.QFormLayout.SpanningRole, self.opt_asciiize) self.label_3 = QtWidgets.QLabel(self.tab) self.label_3.setObjectName("label_3") self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3) self.MainTabs.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.gridLayout = QtWidgets.QGridLayout(self.tab_2) self.gridLayout.setObjectName("gridLayout") self.label_7 = QtWidgets.QLabel(self.tab_2) self.label_7.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.label_7.setObjectName("label_7") self.gridLayout.addWidget(self.label_7, 1, 1, 1, 1) self.opt_remove_paragraph_spacing_indent_size = QtWidgets.QDoubleSpinBox( self.tab_2) self.opt_remove_paragraph_spacing_indent_size.setDecimals(1) self.opt_remove_paragraph_spacing_indent_size.setMinimum(-0.1) self.opt_remove_paragraph_spacing_indent_size.setSingleStep(0.1) self.opt_remove_paragraph_spacing_indent_size.setObjectName( "opt_remove_paragraph_spacing_indent_size") self.gridLayout.addWidget( self.opt_remove_paragraph_spacing_indent_size, 0, 2, 1, 1) self.opt_insert_blank_line = QtWidgets.QCheckBox(self.tab_2) self.opt_insert_blank_line.setObjectName("opt_insert_blank_line") self.gridLayout.addWidget(self.opt_insert_blank_line, 1, 0, 1, 1) self.opt_remove_paragraph_spacing = QtWidgets.QCheckBox(self.tab_2) self.opt_remove_paragraph_spacing.setObjectName( "opt_remove_paragraph_spacing") self.gridLayout.addWidget(self.opt_remove_paragraph_spacing, 0, 0, 1, 1) self.opt_insert_blank_line_size = QtWidgets.QDoubleSpinBox(self.tab_2) self.opt_insert_blank_line_size.setDecimals(1) self.opt_insert_blank_line_size.setObjectName( "opt_insert_blank_line_size") self.gridLayout.addWidget(self.opt_insert_blank_line_size, 1, 2, 1, 1) self.label_4 = QtWidgets.QLabel(self.tab_2) self.label_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 0, 1, 1, 1) self.opt_linearize_tables = QtWidgets.QCheckBox(self.tab_2) self.opt_linearize_tables.setObjectName("opt_linearize_tables") self.gridLayout.addWidget(self.opt_linearize_tables, 2, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 3, 0, 1, 1) self.MainTabs.addTab(self.tab_2, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.verticalLayout = QtWidgets.QVBoxLayout(self.tab_3) self.verticalLayout.setObjectName("verticalLayout") self.groupBox = QtWidgets.QGroupBox(self.tab_3) self.groupBox.setObjectName("groupBox") self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox) self.gridLayout_4.setObjectName("gridLayout_4") self.opt_extra_css = QtWidgets.QPlainTextEdit(self.groupBox) self.opt_extra_css.setObjectName("opt_extra_css") self.gridLayout_4.addWidget(self.opt_extra_css, 0, 0, 1, 1) self.verticalLayout.addWidget(self.groupBox) self.opt_filter_css = QtWidgets.QGroupBox(self.tab_3) self.opt_filter_css.setObjectName("opt_filter_css") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.opt_filter_css) self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_8 = QtWidgets.QLabel(self.opt_filter_css) self.label_8.setWordWrap(True) self.label_8.setObjectName("label_8") self.verticalLayout_3.addWidget(self.label_8) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.filter_css_fonts = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_fonts.setObjectName("filter_css_fonts") self.horizontalLayout_3.addWidget(self.filter_css_fonts) self.filter_css_margins = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_margins.setObjectName("filter_css_margins") self.horizontalLayout_3.addWidget(self.filter_css_margins) self.filter_css_padding = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_padding.setObjectName("filter_css_padding") self.horizontalLayout_3.addWidget(self.filter_css_padding) self.filter_css_floats = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_floats.setObjectName("filter_css_floats") self.horizontalLayout_3.addWidget(self.filter_css_floats) self.filter_css_colors = QtWidgets.QCheckBox(self.opt_filter_css) self.filter_css_colors.setObjectName("filter_css_colors") self.horizontalLayout_3.addWidget(self.filter_css_colors) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.label_9 = QtWidgets.QLabel(self.opt_filter_css) self.label_9.setObjectName("label_9") self.horizontalLayout_4.addWidget(self.label_9) self.filter_css_others = QtWidgets.QLineEdit(self.opt_filter_css) self.filter_css_others.setObjectName("filter_css_others") self.horizontalLayout_4.addWidget(self.filter_css_others) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.verticalLayout.addWidget(self.opt_filter_css) self.MainTabs.addTab(self.tab_3, "") self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName("tab_4") self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_4) self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.verticalLayout_4.setSpacing(0) self.verticalLayout_4.setObjectName("verticalLayout_4") self.opt_transform_css_rules = RulesWidget(self.tab_4) self.opt_transform_css_rules.setObjectName("opt_transform_css_rules") self.verticalLayout_4.addWidget(self.opt_transform_css_rules) self.MainTabs.addTab(self.tab_4, "") self.verticalLayout_2.addWidget(self.MainTabs) self.label_18.setBuddy(self.opt_base_font_size) self.label_2.setBuddy(self.opt_font_size_mapping) self.label_6.setBuddy(self.opt_minimum_line_height) self.label.setBuddy(self.opt_line_height) self.label_10.setBuddy(self.opt_embed_font_family) self.label_5.setBuddy(self.opt_change_justification) self.label_3.setBuddy(self.opt_input_encoding) self.label_7.setBuddy(self.opt_insert_blank_line_size) self.label_4.setBuddy(self.opt_remove_paragraph_spacing_indent_size) self.label_9.setBuddy(self.filter_css_others) self.retranslateUi(Form) self.MainTabs.setCurrentIndex(0) self.opt_disable_font_rescaling.toggled['bool'].connect( self.opt_base_font_size.setDisabled) self.opt_disable_font_rescaling.toggled['bool'].connect( self.opt_font_size_mapping.setDisabled) self.opt_remove_paragraph_spacing.toggled['bool'].connect( self.label_4.setEnabled) self.opt_remove_paragraph_spacing.toggled['bool'].connect( self.opt_remove_paragraph_spacing_indent_size.setEnabled) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): self.label_18.setText(_("Base font si&ze:")) self.opt_base_font_size.setSuffix(_(" pt")) self.label_2.setText(_("Font size &key:")) self.button_font_key.setToolTip( _("Wizard to help you choose an appropriate font size key")) self.button_font_key.setText(_("...")) self.label_6.setText(_("Minim&um line height:")) self.opt_minimum_line_height.setSuffix(_(" %")) self.label.setText(_("L&ine height:")) self.opt_line_height.setSuffix(_(" pt")) self.label_10.setText(_("Embed font fami&ly:")) self.opt_embed_all_fonts.setText(_("&Embed all fonts in document")) self.opt_subset_embedded_fonts.setText(_("&Subset all embedded fonts")) self.opt_expand_css.setText(_("E&xpand CSS")) self.opt_keep_ligatures.setText(_("Keep &ligatures")) self.opt_disable_font_rescaling.setText( _("&Disable font size rescaling")) self.MainTabs.setTabText(self.MainTabs.indexOf(self.tab1), _("&Fonts")) self.label_5.setText(_("Text &justification:")) self.opt_smarten_punctuation.setText(_("Smarten &punctuation")) self.opt_unsmarten_punctuation.setText(_("&Unsmarten punctuation")) self.opt_asciiize.setText( _("&Transliterate Unicode characters to ASCII")) self.label_3.setText(_("I&nput character encoding:")) self.MainTabs.setTabText(self.MainTabs.indexOf(self.tab), _("T&ext")) self.label_7.setText(_("&Line size:")) self.opt_remove_paragraph_spacing_indent_size.setToolTip( _("<p>When calibre removes inter paragraph spacing, it automatically sets a paragraph indent, to ensure that paragraphs can be easily distinguished. This option controls the width of that indent." )) self.opt_remove_paragraph_spacing_indent_size.setSpecialValueText( _("No change")) self.opt_remove_paragraph_spacing_indent_size.setSuffix(_(" em")) self.opt_insert_blank_line.setText( _("Insert &blank line between paragraphs")) self.opt_remove_paragraph_spacing.setText( _("Remove &spacing between paragraphs")) self.opt_insert_blank_line_size.setSuffix(_(" em")) self.label_4.setText(_("I&ndent size:")) self.opt_linearize_tables.setText(_("&Linearize tables")) self.MainTabs.setTabText(self.MainTabs.indexOf(self.tab_2), _("&Layout")) self.groupBox.setTitle(_("E&xtra CSS")) self.opt_filter_css.setTitle(_("Filter style information")) self.label_8.setText( _("Select what style information you want completely removed:")) self.filter_css_fonts.setToolTip( _("Removes the font-family CSS property")) self.filter_css_fonts.setText(_("&Fonts")) self.filter_css_margins.setToolTip( _("Removes the margin CSS properties. Note that page margins are not affected by this setting." )) self.filter_css_margins.setText(_("&Margins")) self.filter_css_padding.setToolTip( _("Removes the padding CSS properties")) self.filter_css_padding.setText(_("&Padding")) self.filter_css_floats.setToolTip( _("Convert floating images/text into static images/text")) self.filter_css_floats.setText(_("F&loats")) self.filter_css_colors.setToolTip( _("Removes foreground and background colors")) self.filter_css_colors.setText(_("&Colors")) self.label_9.setText(_("Other CSS Propert&ies:")) self.filter_css_others.setToolTip( _("Comma separated list of CSS properties to remove. For example: display, color, font-family" )) self.MainTabs.setTabText(self.MainTabs.indexOf(self.tab_3), _("&Styling")) self.MainTabs.setTabText(self.MainTabs.indexOf(self.tab_4), _("&Transform styles"))
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(588, 481) self.verticalLayout = QtWidgets.QVBoxLayout(Form) self.verticalLayout.setObjectName("verticalLayout") self.opt_autorotation = QtWidgets.QCheckBox(Form) self.opt_autorotation.setObjectName("opt_autorotation") self.verticalLayout.addWidget(self.opt_autorotation) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.label = QtWidgets.QLabel(Form) self.label.setObjectName("label") self.horizontalLayout.addWidget(self.label) self.opt_wordspace = QtWidgets.QDoubleSpinBox(Form) self.opt_wordspace.setDecimals(1) self.opt_wordspace.setMinimum(1.0) self.opt_wordspace.setMaximum(20.0) self.opt_wordspace.setProperty("value", 2.5) self.opt_wordspace.setObjectName("opt_wordspace") self.horizontalLayout.addWidget(self.opt_wordspace) self.label_2 = QtWidgets.QLabel(Form) self.label_2.setObjectName("label_2") self.horizontalLayout.addWidget(self.label_2) self.opt_minimum_indent = QtWidgets.QDoubleSpinBox(Form) self.opt_minimum_indent.setDecimals(1) self.opt_minimum_indent.setObjectName("opt_minimum_indent") self.horizontalLayout.addWidget(self.opt_minimum_indent) self.verticalLayout.addLayout(self.horizontalLayout) self.opt_render_tables_as_images = QtWidgets.QCheckBox(Form) self.opt_render_tables_as_images.setObjectName( "opt_render_tables_as_images") self.verticalLayout.addWidget(self.opt_render_tables_as_images) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.label_3 = QtWidgets.QLabel(Form) self.label_3.setObjectName("label_3") self.horizontalLayout_2.addWidget(self.label_3) self.opt_text_size_multiplier_for_rendered_tables = QtWidgets.QDoubleSpinBox( Form) self.opt_text_size_multiplier_for_rendered_tables.setObjectName( "opt_text_size_multiplier_for_rendered_tables") self.horizontalLayout_2.addWidget( self.opt_text_size_multiplier_for_rendered_tables) self.verticalLayout.addLayout(self.horizontalLayout_2) self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.opt_header = QtWidgets.QCheckBox(Form) self.opt_header.setObjectName("opt_header") self.gridLayout.addWidget(self.opt_header, 0, 0, 1, 2) self.label_4 = QtWidgets.QLabel(Form) self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 1, 0, 1, 2) self.opt_header_separation = QtWidgets.QDoubleSpinBox(Form) self.opt_header_separation.setDecimals(1) self.opt_header_separation.setObjectName("opt_header_separation") self.gridLayout.addWidget(self.opt_header_separation, 1, 2, 1, 1) self.label_5 = QtWidgets.QLabel(Form) self.label_5.setObjectName("label_5") self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) self.opt_header_format = QtWidgets.QLineEdit(Form) self.opt_header_format.setObjectName("opt_header_format") self.gridLayout.addWidget(self.opt_header_format, 2, 1, 1, 2) self.verticalLayout.addLayout(self.gridLayout) self.groupBox = QtWidgets.QGroupBox(Form) self.groupBox.setObjectName("groupBox") self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox) self.gridLayout_2.setObjectName("gridLayout_2") self.label_6 = QtWidgets.QLabel(self.groupBox) self.label_6.setObjectName("label_6") self.gridLayout_2.addWidget(self.label_6, 0, 0, 1, 1) self.label_7 = QtWidgets.QLabel(self.groupBox) self.label_7.setObjectName("label_7") self.gridLayout_2.addWidget(self.label_7, 1, 0, 1, 1) self.label_8 = QtWidgets.QLabel(self.groupBox) self.label_8.setObjectName("label_8") self.gridLayout_2.addWidget(self.label_8, 2, 0, 1, 1) self.opt_serif_family = FontFamilyChooser(self.groupBox) self.opt_serif_family.setObjectName("opt_serif_family") self.gridLayout_2.addWidget(self.opt_serif_family, 0, 1, 1, 1) self.opt_sans_family = FontFamilyChooser(self.groupBox) self.opt_sans_family.setObjectName("opt_sans_family") self.gridLayout_2.addWidget(self.opt_sans_family, 1, 1, 1, 1) self.opt_mono_family = FontFamilyChooser(self.groupBox) self.opt_mono_family.setObjectName("opt_mono_family") self.gridLayout_2.addWidget(self.opt_mono_family, 2, 1, 1, 1) self.verticalLayout.addWidget(self.groupBox) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.label.setBuddy(self.opt_wordspace) self.label_2.setBuddy(self.opt_minimum_indent) self.label_4.setBuddy(self.opt_header_separation) self.label_5.setBuddy(self.opt_header_format) self.label_6.setBuddy(self.opt_serif_family) self.label_7.setBuddy(self.opt_sans_family) self.label_8.setBuddy(self.opt_mono_family) self.retranslateUi(Form) self.opt_render_tables_as_images.toggled['bool'].connect( self.opt_text_size_multiplier_for_rendered_tables.setEnabled) self.opt_header.toggled['bool'].connect( self.opt_header_separation.setEnabled) self.opt_header.toggled['bool'].connect( self.opt_header_format.setEnabled) self.opt_render_tables_as_images.toggled['bool'].connect( self.label_3.setEnabled) self.opt_header.toggled['bool'].connect(self.label_4.setEnabled) self.opt_header.toggled['bool'].connect(self.label_5.setEnabled) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(588, 481) Form.setWindowTitle(_("Form")) self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.opt_autorotation = QtGui.QCheckBox(Form) self.opt_autorotation.setText(_("Enable &autorotation of wide images")) self.opt_autorotation.setObjectName(_fromUtf8("opt_autorotation")) self.verticalLayout.addWidget(self.opt_autorotation) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label = QtGui.QLabel(Form) self.label.setText(_("&Wordspace:")) self.label.setObjectName(_fromUtf8("label")) self.horizontalLayout.addWidget(self.label) self.opt_wordspace = QtGui.QDoubleSpinBox(Form) self.opt_wordspace.setSuffix(_(" pt")) self.opt_wordspace.setDecimals(1) self.opt_wordspace.setMinimum(1.0) self.opt_wordspace.setMaximum(20.0) self.opt_wordspace.setProperty("value", 2.5) self.opt_wordspace.setObjectName(_fromUtf8("opt_wordspace")) self.horizontalLayout.addWidget(self.opt_wordspace) self.label_2 = QtGui.QLabel(Form) self.label_2.setText(_("Minimum para. &indent:")) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout.addWidget(self.label_2) self.opt_minimum_indent = QtGui.QDoubleSpinBox(Form) self.opt_minimum_indent.setSuffix(_(" pt")) self.opt_minimum_indent.setDecimals(1) self.opt_minimum_indent.setObjectName(_fromUtf8("opt_minimum_indent")) self.horizontalLayout.addWidget(self.opt_minimum_indent) self.verticalLayout.addLayout(self.horizontalLayout) self.opt_render_tables_as_images = QtGui.QCheckBox(Form) self.opt_render_tables_as_images.setText(_("Render &tables as images")) self.opt_render_tables_as_images.setObjectName(_fromUtf8("opt_render_tables_as_images")) self.verticalLayout.addWidget(self.opt_render_tables_as_images) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.label_3 = QtGui.QLabel(Form) self.label_3.setText(_("Text size multiplier for text in rendered tables:")) self.label_3.setObjectName(_fromUtf8("label_3")) self.horizontalLayout_2.addWidget(self.label_3) self.opt_text_size_multiplier_for_rendered_tables = QtGui.QDoubleSpinBox(Form) self.opt_text_size_multiplier_for_rendered_tables.setObjectName( _fromUtf8("opt_text_size_multiplier_for_rendered_tables") ) self.horizontalLayout_2.addWidget(self.opt_text_size_multiplier_for_rendered_tables) self.verticalLayout.addLayout(self.horizontalLayout_2) self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.opt_header = QtGui.QCheckBox(Form) self.opt_header.setText(_("Add &header")) self.opt_header.setObjectName(_fromUtf8("opt_header")) self.gridLayout.addWidget(self.opt_header, 0, 0, 1, 2) self.label_4 = QtGui.QLabel(Form) self.label_4.setText(_("Header &separation:")) self.label_4.setObjectName(_fromUtf8("label_4")) self.gridLayout.addWidget(self.label_4, 1, 0, 1, 2) self.opt_header_separation = QtGui.QDoubleSpinBox(Form) self.opt_header_separation.setSuffix(_(" pt")) self.opt_header_separation.setDecimals(1) self.opt_header_separation.setObjectName(_fromUtf8("opt_header_separation")) self.gridLayout.addWidget(self.opt_header_separation, 1, 2, 1, 1) self.label_5 = QtGui.QLabel(Form) self.label_5.setText(_("Header &format:")) self.label_5.setObjectName(_fromUtf8("label_5")) self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) self.opt_header_format = QtGui.QLineEdit(Form) self.opt_header_format.setObjectName(_fromUtf8("opt_header_format")) self.gridLayout.addWidget(self.opt_header_format, 2, 1, 1, 2) self.verticalLayout.addLayout(self.gridLayout) self.groupBox = QtGui.QGroupBox(Form) self.groupBox.setTitle(_("&Embed fonts")) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.gridLayout_2 = QtGui.QGridLayout(self.groupBox) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.label_6 = QtGui.QLabel(self.groupBox) self.label_6.setText(_("&Serif font family:")) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout_2.addWidget(self.label_6, 0, 0, 1, 1) self.label_7 = QtGui.QLabel(self.groupBox) self.label_7.setText(_("S&ans-serif font family:")) self.label_7.setObjectName(_fromUtf8("label_7")) self.gridLayout_2.addWidget(self.label_7, 1, 0, 1, 1) self.label_8 = QtGui.QLabel(self.groupBox) self.label_8.setText(_("&Monospaced font family:")) self.label_8.setObjectName(_fromUtf8("label_8")) self.gridLayout_2.addWidget(self.label_8, 2, 0, 1, 1) self.opt_serif_family = FontFamilyChooser(self.groupBox) self.opt_serif_family.setObjectName(_fromUtf8("opt_serif_family")) self.gridLayout_2.addWidget(self.opt_serif_family, 0, 1, 1, 1) self.opt_sans_family = FontFamilyChooser(self.groupBox) self.opt_sans_family.setObjectName(_fromUtf8("opt_sans_family")) self.gridLayout_2.addWidget(self.opt_sans_family, 1, 1, 1, 1) self.opt_mono_family = FontFamilyChooser(self.groupBox) self.opt_mono_family.setObjectName(_fromUtf8("opt_mono_family")) self.gridLayout_2.addWidget(self.opt_mono_family, 2, 1, 1, 1) self.verticalLayout.addWidget(self.groupBox) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.label.setBuddy(self.opt_wordspace) self.label_2.setBuddy(self.opt_minimum_indent) self.label_4.setBuddy(self.opt_header_separation) self.label_5.setBuddy(self.opt_header_format) self.label_6.setBuddy(self.opt_serif_family) self.label_7.setBuddy(self.opt_sans_family) self.label_8.setBuddy(self.opt_mono_family) self.retranslateUi(Form) QtCore.QObject.connect( self.opt_render_tables_as_images, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.opt_text_size_multiplier_for_rendered_tables.setEnabled, ) QtCore.QObject.connect( self.opt_header, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.opt_header_separation.setEnabled ) QtCore.QObject.connect( self.opt_header, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.opt_header_format.setEnabled ) QtCore.QObject.connect( self.opt_render_tables_as_images, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.label_3.setEnabled ) QtCore.QObject.connect(self.opt_header, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.label_4.setEnabled) QtCore.QObject.connect(self.opt_header, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.label_5.setEnabled) QtCore.QMetaObject.connectSlotsByName(Form)