Exemplo n.º 1
0
    def __init__(self, parent, db, author, series=None):
        QDialog.__init__(self, parent)
        self.db = db

        self.setWindowTitle(_('How many empty books?'))

        self._layout = QGridLayout(self)
        self.setLayout(self._layout)

        self.qty_label = QLabel(_('How many empty books should be added?'))
        self._layout.addWidget(self.qty_label, 0, 0, 1, 2)

        self.qty_spinbox = QSpinBox(self)
        self.qty_spinbox.setRange(1, 10000)
        self.qty_spinbox.setValue(1)
        self._layout.addWidget(self.qty_spinbox, 1, 0, 1, 2)

        self.author_label = QLabel(_('Set the author of the new books to:'))
        self._layout.addWidget(self.author_label, 2, 0, 1, 2)

        self.authors_combo = EditWithComplete(self)
        self.authors_combo.setSizeAdjustPolicy(
            self.authors_combo.AdjustToMinimumContentsLengthWithIcon)
        self.authors_combo.setEditable(True)
        self._layout.addWidget(self.authors_combo, 3, 0, 1, 1)
        self.initialize_authors(db, author)

        self.clear_button = QToolButton(self)
        self.clear_button.setIcon(QIcon(I('trash.png')))
        self.clear_button.setToolTip(_('Reset author to Unknown'))
        self.clear_button.clicked.connect(self.reset_author)
        self._layout.addWidget(self.clear_button, 3, 1, 1, 1)

        self.series_label = QLabel(_('Set the series of the new books to:'))
        self._layout.addWidget(self.series_label, 4, 0, 1, 2)

        self.series_combo = EditWithComplete(self)
        self.authors_combo.setSizeAdjustPolicy(
            self.authors_combo.AdjustToMinimumContentsLengthWithIcon)
        self.series_combo.setEditable(True)
        self._layout.addWidget(self.series_combo, 5, 0, 1, 1)
        self.initialize_series(db, series)

        self.sclear_button = QToolButton(self)
        self.sclear_button.setIcon(QIcon(I('trash.png')))
        self.sclear_button.setToolTip(_('Reset series'))
        self.sclear_button.clicked.connect(self.reset_series)
        self._layout.addWidget(self.sclear_button, 5, 1, 1, 1)

        button_box = QDialogButtonBox(QDialogButtonBox.Ok
                                      | QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.accept)
        button_box.rejected.connect(self.reject)
        self._layout.addWidget(button_box)
        self.resize(self.sizeHint())
Exemplo n.º 2
0
 def createEditor(self, parent, option, index):
     if self.auto_complete_function:
         if self.use_title_sort:
             editor = EditWithComplete(parent, sort_func=title_sort)
         else:
             editor = EditWithComplete(parent)
         editor.set_separator(None)
         editor.set_clear_button_enabled(False)
         complete_items = [i[1] for i in self.auto_complete_function()]
         editor.update_items_cache(complete_items)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 3
0
 def createEditor(self, parent, option, index):
     if self.db and hasattr(self.db, self.items_func_name):
         m = index.model()
         col = m.column_map[index.column()]
         # If shifted, bring up the tag editor instead of the line editor.
         if check_key_modifier(Qt.ShiftModifier) and col != 'authors':
             key = col if m.is_custom_column(col) else None
             d = TagEditor(parent, self.db, m.id(index.row()), key=key)
             if d.exec_() == TagEditor.Accepted:
                 m.setData(index, self.sep.join(d.tags), Qt.EditRole)
             return None
         editor = EditWithComplete(parent)
         editor.set_separator(self.sep)
         editor.set_space_before_sep(self.space_before_sep)
         if self.sep == '&':
             editor.set_add_separator(
                 tweaks['authors_completer_append_separator'])
         if not m.is_custom_column(col):
             all_items = getattr(self.db, self.items_func_name)()
         else:
             all_items = list(
                 self.db.all_custom(
                     label=self.db.field_metadata.key_to_label(col)))
         editor.update_items_cache(all_items)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 4
0
 def create_tags_edit(self, value, row):
     tags_edit = EditWithComplete(self)
     tags_edit.set_add_separator(False)
     tags_edit.update_items_cache(self.tags_values)
     tags_edit.setText(value)
     #        tags_edit.editingFinished.connect(partial(self.tags_editing_finished, row, tags_edit))
     return tags_edit
 def createEditor(self, parent, option, index):
     if self.db and hasattr(self.db, self.items_func_name):
         col = self.col
         if col is None:
             # We have not specified an explicit column, so we need
             # to lookup a column name. The calibre one will rely on stuff
             # on the model, we will rely on a callback function instead
             col = self.col_fn(index.column())
         editor = EditWithComplete(parent)
         editor.set_separator(self.sep)
         editor.set_space_before_sep(self.space_before_sep)
         if self.sep == '&':
             editor.set_add_separator(
                 tweaks['authors_completer_append_separator'])
         if col.startswith('#'):
             all_items = list(
                 self.db.all_custom(
                     label=self.db.field_metadata.key_to_label(col)))
         else:
             all_items = getattr(self.db, self.items_func_name)()
         editor.update_items_cache(all_items)
         for item in sorted(all_items, key=sort_key):
             editor.addItem(item)
         ct = index.data(Qt.DisplayRole).toString()
         editor.show_initial_value(ct)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 6
0
 def createEditor(self, parent, option, index):
     if self.completion_data:
         editor = EditWithComplete(parent)
         editor.set_separator(None)
         editor.update_items_cache(self.completion_data)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 7
0
 def createEditor(self, parent, option, index):
     if self.auto_complete_function:
         editor = EditWithComplete(parent)
         editor.set_separator(None)
         complete_items = [i[1] for i in self.auto_complete_function()]
         editor.update_items_cache(complete_items)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 8
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     editor = EditWithComplete(parent)
     editor.set_separator(None)
     complete_items = sorted(list(m.db.all_custom(label=m.db.field_metadata.key_to_label(col))),
                             key=sort_key)
     editor.update_items_cache(complete_items)
     return editor
Exemplo n.º 9
0
 def createEditor(self, parent, option, index):
     if self.auto_complete_function:
         editor = EditWithComplete(parent)
         editor.set_separator(None)
         complete_items = [i[1] for i in self.auto_complete_function()]
         editor.update_items_cache(complete_items)
         ct = index.data(Qt.DisplayRole).toString()
         editor.show_initial_value(ct)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 10
0
 def createEditor(self, parent, option, index):
     if index.column() == 0:
         if self.completion_data:
             from calibre.gui2.complete2 import EditWithComplete
             editor = EditWithComplete(parent)
             editor.set_separator(None)
             editor.update_items_cache(self.completion_data)
         else:
             from calibre.gui2.widgets import EnLineEdit
             editor = EnLineEdit(parent)
         return editor
     return QItemDelegate.createEditor(self, parent, option, index)
Exemplo n.º 11
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     key = m.db.field_metadata.key_to_label(col)
     if m.db.field_metadata[col]['datatype'] != 'comments':
         if self.use_title_sort:
             editor = EditWithComplete(parent, sort_func=title_sort)
         else:
             editor = EditWithComplete(parent)
         editor.set_separator(None)
         editor.set_clear_button_enabled(False)
         complete_items = sorted(list(m.db.all_custom(label=key)),
                                 key=sort_key)
         editor.update_items_cache(complete_items)
     else:
         editor = QLineEdit(parent)
         text = index.data(Qt.ItemDataRole.DisplayRole)
         if text:
             editor.setText(text)
             editor.selectAll()
     return editor
Exemplo n.º 12
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        layout = QHBoxLayout()
        layout.setSpacing(5)
        layout.setContentsMargins(0, 0, 0, 0)

        self.tags_box = EditWithComplete(parent)
        layout.addWidget(self.tags_box, stretch=1000)
        self.editor_button = QToolButton(self)
        self.editor_button.setToolTip(_('Open Item Editor'))
        self.editor_button.setIcon(QIcon(I('chapters.png')))
        layout.addWidget(self.editor_button)
        self.setLayout(layout)
Exemplo n.º 13
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     key = m.db.field_metadata.key_to_label(col)
     if m.db.field_metadata[col]['datatype'] != 'comments':
         editor = EditWithComplete(parent)
         editor.set_separator(None)
         complete_items = sorted(list(m.db.all_custom(label=key)),
                                 key=sort_key)
         editor.update_items_cache(complete_items)
     else:
         editor = QStyledItemDelegate.createEditor(self, parent, option,
                                                   index)
     return editor
Exemplo n.º 14
0
    def __init__(self, parent, values):
        QWidget.__init__(self, parent)
        layout = QHBoxLayout()
        layout.setSpacing(5)
        layout.setContentsMargins(0, 0, 0, 0)

        self.tags_box = EditWithComplete(parent)
        self.tags_box.update_items_cache(values)
        layout.addWidget(self.tags_box, stretch=3)
        self.checkbox = QCheckBox(_('Remove all tags'), parent)
        layout.addWidget(self.checkbox)
        layout.addStretch(1)
        self.setLayout(layout)
        self.checkbox.stateChanged[int].connect(self.box_touched)
Exemplo n.º 15
0
 def createEditor(self, parent, option, index):
     self.editing_started.emit(index.row())
     if index.column() == 0:
         self.item = self.table.itemFromIndex(index)
         if self.item.is_deleted:
             return None
         if self.completion_data:
             editor = EditWithComplete(parent)
             editor.set_separator(None)
             editor.update_items_cache(self.completion_data)
         else:
             editor = EnLineEdit(parent)
         return editor
     return None
Exemplo n.º 16
0
    def setup_ui(self):
        from calibre.ebooks.constants import html5_tags
        self.l = l = QVBoxLayout(self)
        self.setLayout(l)

        self.la = la = QLabel(_('Specify the name of the &tag to insert:'))
        l.addWidget(la)

        self.tag_input = ti = EditWithComplete(self)
        ti.set_separator(None)
        ti.all_items = html5_tags | frozenset(tprefs['insert_tag_mru'])
        la.setBuddy(ti)
        l.addWidget(ti)
        l.addWidget(self.bb)
        ti.setFocus(Qt.OtherFocusReason)
Exemplo n.º 17
0
    def setup_ui(self, parent):
        w = EditWithComplete(parent)
        w.set_separator(None)
        w.setSizeAdjustPolicy(w.AdjustToMinimumContentsLengthWithIcon)
        w.setMinimumContentsLength(25)
        self.name_widget = w
        self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent), w]
        w.editTextChanged.connect(self.series_changed)

        self.widgets.append(QLabel('&'+self.col_metadata['name']+_(' index:'), parent))
        w = QDoubleSpinBox(parent)
        w.setRange(-10000., float(100000000))
        w.setDecimals(2)
        w.setSingleStep(1)
        self.idx_widget=w
        self.widgets.append(w)
Exemplo n.º 18
0
 def createEditor(self, parent, option, index):
     if self.db and hasattr(self.db, self.items_func_name):
         col = index.model().column_map[index.column()]
         editor = EditWithComplete(parent)
         editor.set_separator(self.sep)
         editor.set_space_before_sep(self.space_before_sep)
         if self.sep == '&':
             editor.set_add_separator(tweaks['authors_completer_append_separator'])
         if not index.model().is_custom_column(col):
             all_items = getattr(self.db, self.items_func_name)()
         else:
             all_items = list(self.db.all_custom(
                 label=self.db.field_metadata.key_to_label(col)))
         editor.update_items_cache(all_items)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 19
0
    def __init__(self, parent, values):
        QWidget.__init__(self, parent)
        layout = QHBoxLayout()
        layout.setSpacing(5)
        layout.setContentsMargins(0, 0, 0, 0)

        self.tags_box = EditWithComplete(parent)
        self.tags_box.update_items_cache(values)
        layout.addWidget(self.tags_box, stretch=3)
        self.remove_tags_button = QToolButton(parent)
        self.remove_tags_button.setToolTip(_('Open Item Editor'))
        self.remove_tags_button.setIcon(QIcon(I('chapters.png')))
        layout.addWidget(self.remove_tags_button)
        self.checkbox = QCheckBox(_('Remove all tags'), parent)
        layout.addWidget(self.checkbox)
        layout.addStretch(1)
        self.setLayout(layout)
        self.checkbox.stateChanged[int].connect(self.box_touched)
Exemplo n.º 20
0
    def setup_ui(self, parent):
        self.sep = self.col_metadata['multiple_seps']
        self.key = self.db.field_metadata.label_to_key(self.col_metadata['label'],
                                                       prefer_custom=True)
        self.parent = parent

        if self.col_metadata['is_multiple']:
            w = MultipleWidget(parent)
            w.set_separator(self.sep['ui_to_list'])
            if self.sep['ui_to_list'] == '&':
                w.set_space_before_sep(True)
                w.set_add_separator(tweaks['authors_completer_append_separator'])
            w.get_editor_button().clicked.connect(self.edit)
            w.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
        else:
            w = EditWithComplete(parent)
            w.set_separator(None)
            w.setSizeAdjustPolicy(w.AdjustToMinimumContentsLengthWithIcon)
            w.setMinimumContentsLength(25)
        self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent), w]
Exemplo n.º 21
0
 def createEditor(self, parent, option, index):
     if self.db and hasattr(self.db, self.items_func_name):
         editor = EditWithComplete(parent)
         editor.set_separator(self.sep)
         editor.set_space_before_sep(self.space_before_sep)
         if self.sep == '&':
             editor.set_add_separator(
                 tweaks['authors_completer_append_separator'])
         if self.col.startswith('#'):
             all_items = list(
                 self.db.all_custom(
                     label=self.db.field_metadata.key_to_label(self.col)))
         else:
             all_items = getattr(self.db, self.items_func_name)()
         editor.update_items_cache(all_items)
         for item in sorted(all_items, key=sort_key):
             editor.addItem(item)
         ct = index.data(Qt.DisplayRole).toString()
         editor.show_initial_value(ct)
     else:
         editor = EnLineEdit(parent)
     return editor
Exemplo n.º 22
0
    def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(731, 411)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("search.png"))),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Dialog.setWindowIcon(icon)
        self.gridLayout_2 = QtGui.QGridLayout(Dialog)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.label_5 = QtGui.QLabel(Dialog)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.gridLayout_2.addWidget(self.label_5, 0, 0, 1, 1)
        self.matchkind = QtGui.QComboBox(Dialog)
        self.matchkind.setObjectName(_fromUtf8("matchkind"))
        self.matchkind.addItem(_fromUtf8(""))
        self.matchkind.addItem(_fromUtf8(""))
        self.matchkind.addItem(_fromUtf8(""))
        self.gridLayout_2.addWidget(self.matchkind, 0, 1, 1, 1)
        self.tabWidget = QtGui.QTabWidget(Dialog)
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.tab = QtGui.QWidget()
        self.tab.setObjectName(_fromUtf8("tab"))
        self.gridLayout_3 = QtGui.QGridLayout(self.tab)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.groupBox = QtGui.QGroupBox(self.tab)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.verticalLayout = QtGui.QVBoxLayout(self.groupBox)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label = QtGui.QLabel(self.groupBox)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.all = QtGui.QLineEdit(self.groupBox)
        self.all.setObjectName(_fromUtf8("all"))
        self.horizontalLayout.addWidget(self.all)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout_2.addWidget(self.label_2)
        self.phrase = QtGui.QLineEdit(self.groupBox)
        self.phrase.setObjectName(_fromUtf8("phrase"))
        self.horizontalLayout_2.addWidget(self.phrase)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.horizontalLayout_3.addWidget(self.label_3)
        self.any = QtGui.QLineEdit(self.groupBox)
        self.any.setObjectName(_fromUtf8("any"))
        self.horizontalLayout_3.addWidget(self.any)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.gridLayout_3.addWidget(self.groupBox, 0, 0, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(self.tab)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_2)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.label_4 = QtGui.QLabel(self.groupBox_2)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.horizontalLayout_4.addWidget(self.label_4)
        self.none = QtGui.QLineEdit(self.groupBox_2)
        self.none.setObjectName(_fromUtf8("none"))
        self.horizontalLayout_4.addWidget(self.none)
        self.verticalLayout_2.addLayout(self.horizontalLayout_4)
        self.label_6 = QtGui.QLabel(self.groupBox_2)
        self.label_6.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_6.setOpenExternalLinks(True)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.verticalLayout_2.addWidget(self.label_6)
        self.gridLayout_3.addWidget(self.groupBox_2, 1, 0, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.gridLayout_3.addItem(spacerItem, 2, 0, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(self.tab)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
                                          | QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.gridLayout_3.addWidget(self.buttonBox, 3, 0, 1, 1)
        self.tabWidget.addTab(self.tab, _fromUtf8(""))
        self.tab_2 = QtGui.QWidget()
        self.tab_2.setObjectName(_fromUtf8("tab_2"))
        self.gridLayout = QtGui.QGridLayout(self.tab_2)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.label_7 = QtGui.QLabel(self.tab_2)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.gridLayout.addWidget(self.label_7, 1, 0, 1, 1)
        self.title_box = EnLineEdit(self.tab_2)
        self.title_box.setObjectName(_fromUtf8("title_box"))
        self.gridLayout.addWidget(self.title_box, 1, 1, 1, 1)
        self.label_8 = QtGui.QLabel(self.tab_2)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.gridLayout.addWidget(self.label_8, 2, 0, 1, 1)
        self.label_9 = QtGui.QLabel(self.tab_2)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.gridLayout.addWidget(self.label_9, 3, 0, 1, 1)
        self.label_10 = QtGui.QLabel(self.tab_2)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 4, 0, 1, 1)
        self.authors_box = EditWithComplete(self.tab_2)
        self.authors_box.setObjectName(_fromUtf8("authors_box"))
        self.gridLayout.addWidget(self.authors_box, 2, 1, 1, 1)
        self.series_box = EditWithComplete(self.tab_2)
        self.series_box.setObjectName(_fromUtf8("series_box"))
        self.gridLayout.addWidget(self.series_box, 3, 1, 1, 1)
        self.tags_box = EditWithComplete(self.tab_2)
        self.tags_box.setObjectName(_fromUtf8("tags_box"))
        self.gridLayout.addWidget(self.tags_box, 4, 1, 1, 1)
        self.general_box = QtGui.QLineEdit(self.tab_2)
        self.general_box.setObjectName(_fromUtf8("general_box"))
        self.gridLayout.addWidget(self.general_box, 6, 1, 1, 1)
        self.general_combo = QtGui.QComboBox(self.tab_2)
        self.general_combo.setObjectName(_fromUtf8("general_combo"))
        self.gridLayout.addWidget(self.general_combo, 6, 0, 1, 1)
        self.horizontalLayout_6 = QtGui.QHBoxLayout()
        self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
        self.clear_button = QtGui.QPushButton(self.tab_2)
        self.clear_button.setObjectName(_fromUtf8("clear_button"))
        self.horizontalLayout_6.addWidget(self.clear_button)
        self.tab_2_button_box = QtGui.QDialogButtonBox(self.tab_2)
        self.tab_2_button_box.setStandardButtons(QtGui.QDialogButtonBox.Cancel
                                                 | QtGui.QDialogButtonBox.Ok)
        self.tab_2_button_box.setObjectName(_fromUtf8("tab_2_button_box"))
        self.horizontalLayout_6.addWidget(self.tab_2_button_box)
        self.gridLayout.addLayout(self.horizontalLayout_6, 8, 0, 1, 2)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem1, 7, 1, 1, 1)
        self.label_11 = QtGui.QLabel(self.tab_2)
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.gridLayout.addWidget(self.label_11, 0, 0, 1, 2)
        self.tabWidget.addTab(self.tab_2, _fromUtf8(""))
        self.gridLayout_2.addWidget(self.tabWidget, 2, 0, 1, 2)
        spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        self.gridLayout_2.addItem(spacerItem2, 1, 1, 1, 1)
        self.label_5.setBuddy(self.matchkind)
        self.label.setBuddy(self.all)
        self.label_2.setBuddy(self.all)
        self.label_3.setBuddy(self.all)
        self.label_4.setBuddy(self.all)
        self.label_7.setBuddy(self.title_box)
        self.label_8.setBuddy(self.authors_box)
        self.label_9.setBuddy(self.series_box)
        self.label_10.setBuddy(self.tags_box)

        self.retranslateUi(Dialog)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("accepted()")),
                               Dialog.accept)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("rejected()")),
                               Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        Dialog.setTabOrder(self.all, self.phrase)
        Dialog.setTabOrder(self.phrase, self.any)
        Dialog.setTabOrder(self.any, self.none)
        Dialog.setTabOrder(self.none, self.buttonBox)
        Dialog.setTabOrder(self.buttonBox, self.title_box)
        Dialog.setTabOrder(self.title_box, self.authors_box)
        Dialog.setTabOrder(self.authors_box, self.series_box)
        Dialog.setTabOrder(self.series_box, self.tags_box)
        Dialog.setTabOrder(self.tags_box, self.general_combo)
        Dialog.setTabOrder(self.general_combo, self.general_box)
        Dialog.setTabOrder(self.general_box, self.clear_button)
        Dialog.setTabOrder(self.clear_button, self.tab_2_button_box)
Exemplo n.º 23
0
    def __init__(self, parent, db, author, series=None, title=None):
        QDialog.__init__(self, parent)
        self.db = db

        self.setWindowTitle(_('How many empty books?'))

        self._layout = QGridLayout(self)
        self.setLayout(self._layout)

        self.qty_label = QLabel(_('How many empty books should be added?'))
        self._layout.addWidget(self.qty_label, 0, 0, 1, 2)

        self.qty_spinbox = QSpinBox(self)
        self.qty_spinbox.setRange(1, 10000)
        self.qty_spinbox.setValue(1)
        self._layout.addWidget(self.qty_spinbox, 1, 0, 1, 2)

        self.author_label = QLabel(_('Set the author of the new books to:'))
        self._layout.addWidget(self.author_label, 2, 0, 1, 2)

        self.authors_combo = EditWithComplete(self)
        self.authors_combo.setSizeAdjustPolicy(
            self.authors_combo.AdjustToMinimumContentsLengthWithIcon)
        self.authors_combo.setEditable(True)
        self._layout.addWidget(self.authors_combo, 3, 0, 1, 1)
        self.initialize_authors(db, author)

        self.clear_button = QToolButton(self)
        self.clear_button.setIcon(QIcon(I('trash.png')))
        self.clear_button.setToolTip(_('Reset author to Unknown'))
        self.clear_button.clicked.connect(self.reset_author)
        self._layout.addWidget(self.clear_button, 3, 1, 1, 1)

        self.series_label = QLabel(_('Set the series of the new books to:'))
        self._layout.addWidget(self.series_label, 4, 0, 1, 2)

        self.series_combo = EditWithComplete(self)
        self.series_combo.setSizeAdjustPolicy(
            self.authors_combo.AdjustToMinimumContentsLengthWithIcon)
        self.series_combo.setEditable(True)
        self._layout.addWidget(self.series_combo, 5, 0, 1, 1)
        self.initialize_series(db, series)

        self.sclear_button = QToolButton(self)
        self.sclear_button.setIcon(QIcon(I('trash.png')))
        self.sclear_button.setToolTip(_('Reset series'))
        self.sclear_button.clicked.connect(self.reset_series)
        self._layout.addWidget(self.sclear_button, 5, 1, 1, 1)

        self.title_label = QLabel(_('Set the title of the new books to:'))
        self._layout.addWidget(self.title_label, 6, 0, 1, 2)

        self.title_edit = QLineEdit(self)
        self.title_edit.setText(title or '')
        self._layout.addWidget(self.title_edit, 7, 0, 1, 1)

        self.tclear_button = QToolButton(self)
        self.tclear_button.setIcon(QIcon(I('trash.png')))
        self.tclear_button.setToolTip(_('Reset title'))
        self.tclear_button.clicked.connect(self.title_edit.clear)
        self._layout.addWidget(self.tclear_button, 7, 1, 1, 1)

        self.create_epub = c = QCheckBox(
            _('Create an empty EPUB file as well'))
        c.setChecked(gprefs.get('create_empty_epub_file', False))
        c.setToolTip(
            _('Also create an empty EPUB file that you can subsequently edit'))
        self._layout.addWidget(c, 8, 0, 1, -1)

        button_box = self.bb = QDialogButtonBox(QDialogButtonBox.Ok
                                                | QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.accept)
        button_box.rejected.connect(self.reject)
        self._layout.addWidget(button_box, 9, 0, 1, -1)
        self.resize(self.sizeHint())
Exemplo n.º 24
0
    def setupUi(self, MetadataBulkDialog):
        MetadataBulkDialog.setObjectName("MetadataBulkDialog")
        MetadataBulkDialog.resize(955, 740)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(I("edit_input.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MetadataBulkDialog.setWindowIcon(icon)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(MetadataBulkDialog)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.central_widget = QtWidgets.QTabWidget(MetadataBulkDialog)
        self.central_widget.setObjectName("central_widget")
        self.scrollArea1 = QtWidgets.QScrollArea()
        self.scrollArea1.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.scrollArea1.setWidgetResizable(True)
        self.scrollArea1.setObjectName("scrollArea1")
        self.btab = QtWidgets.QWidget()
        self.btab.setGeometry(QtCore.QRect(0, 0, 933, 660))
        self.btab.setObjectName("btab")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.btab)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label_2 = QtWidgets.QLabel(self.btab)
        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
        self.authors = EditWithComplete(self.btab)
        self.authors.setEditable(True)
        self.authors.setObjectName("authors")
        self.gridLayout.addWidget(self.authors, 0, 1, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.auto_author_sort = QtWidgets.QCheckBox(self.btab)
        self.auto_author_sort.setObjectName("auto_author_sort")
        self.horizontalLayout_2.addWidget(self.auto_author_sort)
        self.swap_title_and_author = QtWidgets.QCheckBox(self.btab)
        self.swap_title_and_author.setObjectName("swap_title_and_author")
        self.horizontalLayout_2.addWidget(self.swap_title_and_author)
        self.gridLayout.addLayout(self.horizontalLayout_2, 1, 1, 1, 1)
        self.label_8 = QtWidgets.QLabel(self.btab)
        self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_8.setObjectName("label_8")
        self.gridLayout.addWidget(self.label_8, 2, 0, 1, 1)
        self.author_sort = EnLineEdit(self.btab)
        self.author_sort.setObjectName("author_sort")
        self.gridLayout.addWidget(self.author_sort, 2, 1, 1, 1)
        self.label_6 = QtWidgets.QLabel(self.btab)
        self.label_6.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_6.setObjectName("label_6")
        self.gridLayout.addWidget(self.label_6, 3, 0, 1, 1)
        self.rating = RatingEditor(self.btab)
        self.rating.setObjectName("rating")
        self.gridLayout.addWidget(self.rating, 3, 1, 1, 1)
        self.apply_rating = QtWidgets.QCheckBox(self.btab)
        self.apply_rating.setObjectName("apply_rating")
        self.gridLayout.addWidget(self.apply_rating, 3, 2, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.btab)
        self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1)
        self.publisher = EditWithComplete(self.btab)
        self.publisher.setEditable(True)
        self.publisher.setObjectName("publisher")
        self.gridLayout.addWidget(self.publisher, 4, 1, 1, 1)
        self.clear_pub = QtWidgets.QCheckBox(self.btab)
        self.clear_pub.setObjectName("clear_pub")
        self.gridLayout.addWidget(self.clear_pub, 4, 2, 1, 1)
        self.label_4 = QtWidgets.QLabel(self.btab)
        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, 5, 0, 1, 1)
        self.tags = EditWithComplete(self.btab)
        self.tags.setObjectName("tags")
        self.gridLayout.addWidget(self.tags, 5, 1, 1, 1)
        self.tag_editor_button = QtWidgets.QToolButton(self.btab)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(I("chapters.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tag_editor_button.setIcon(icon1)
        self.tag_editor_button.setObjectName("tag_editor_button")
        self.gridLayout.addWidget(self.tag_editor_button, 5, 2, 1, 1)
        self.label = QtWidgets.QLabel(self.btab)
        self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 6, 0, 1, 1)
        self.remove_tags = EditWithComplete(self.btab)
        self.remove_tags.setObjectName("remove_tags")
        self.gridLayout.addWidget(self.remove_tags, 6, 1, 1, 1)
        self.remove_all_tags = QtWidgets.QCheckBox(self.btab)
        self.remove_all_tags.setObjectName("remove_all_tags")
        self.gridLayout.addWidget(self.remove_all_tags, 6, 2, 1, 1)
        self.label_7 = QtWidgets.QLabel(self.btab)
        self.label_7.setTextFormat(QtCore.Qt.PlainText)
        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, 7, 0, 1, 1)
        self.series = EditWithComplete(self.btab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.series.sizePolicy().hasHeightForWidth())
        self.series.setSizePolicy(sizePolicy)
        self.series.setEditable(True)
        self.series.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically)
        self.series.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self.series.setMinimumContentsLength(40)
        self.series.setObjectName("series")
        self.gridLayout.addWidget(self.series, 7, 1, 1, 1)
        self.clear_series = QtWidgets.QCheckBox(self.btab)
        self.clear_series.setObjectName("clear_series")
        self.gridLayout.addWidget(self.clear_series, 7, 2, 1, 1)
        self.HLayout_3 = QtWidgets.QHBoxLayout()
        self.HLayout_3.setObjectName("HLayout_3")
        self.autonumber_series = QtWidgets.QCheckBox(self.btab)
        self.autonumber_series.setEnabled(False)
        self.autonumber_series.setObjectName("autonumber_series")
        self.HLayout_3.addWidget(self.autonumber_series)
        self.series_numbering_restarts = QtWidgets.QCheckBox(self.btab)
        self.series_numbering_restarts.setEnabled(False)
        self.series_numbering_restarts.setObjectName("series_numbering_restarts")
        self.HLayout_3.addWidget(self.series_numbering_restarts)
        self.series_start_number = QtWidgets.QDoubleSpinBox(self.btab)
        self.series_start_number.setEnabled(False)
        self.series_start_number.setMinimum(0.0)
        self.series_start_number.setMaximum(99000000.0)
        self.series_start_number.setProperty("value", 1.0)
        self.series_start_number.setObjectName("series_start_number")
        self.HLayout_3.addWidget(self.series_start_number)
        self.series_increment = QtWidgets.QDoubleSpinBox(self.btab)
        self.series_increment.setEnabled(False)
        self.series_increment.setMinimum(0.0)
        self.series_increment.setMaximum(99999.0)
        self.series_increment.setProperty("value", 1.0)
        self.series_increment.setObjectName("series_increment")
        self.HLayout_3.addWidget(self.series_increment)
        self.gridLayout.addLayout(self.HLayout_3, 8, 1, 1, 1)
        self.label_10 = QtWidgets.QLabel(self.btab)
        self.label_10.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_10.setObjectName("label_10")
        self.gridLayout.addWidget(self.label_10, 9, 0, 1, 1)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.adddate = DateTimeEdit(self.btab)
        self.adddate.setCalendarPopup(True)
        self.adddate.setObjectName("adddate")
        self.horizontalLayout_5.addWidget(self.adddate)
        self.clear_adddate_button = QtWidgets.QToolButton(self.btab)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(I("trash.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.clear_adddate_button.setIcon(icon2)
        self.clear_adddate_button.setObjectName("clear_adddate_button")
        self.horizontalLayout_5.addWidget(self.clear_adddate_button)
        self.gridLayout.addLayout(self.horizontalLayout_5, 9, 1, 1, 1)
        self.apply_adddate = QtWidgets.QCheckBox(self.btab)
        self.apply_adddate.setObjectName("apply_adddate")
        self.gridLayout.addWidget(self.apply_adddate, 9, 2, 1, 1)
        self.label_9 = QtWidgets.QLabel(self.btab)
        self.label_9.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_9.setObjectName("label_9")
        self.gridLayout.addWidget(self.label_9, 10, 0, 1, 1)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.pubdate = DateTimeEdit(self.btab)
        self.pubdate.setCalendarPopup(True)
        self.pubdate.setObjectName("pubdate")
        self.horizontalLayout_4.addWidget(self.pubdate)
        self.clear_pubdate_button = QtWidgets.QToolButton(self.btab)
        self.clear_pubdate_button.setIcon(icon2)
        self.clear_pubdate_button.setObjectName("clear_pubdate_button")
        self.horizontalLayout_4.addWidget(self.clear_pubdate_button)
        self.gridLayout.addLayout(self.horizontalLayout_4, 10, 1, 1, 1)
        self.apply_pubdate = QtWidgets.QCheckBox(self.btab)
        self.apply_pubdate.setObjectName("apply_pubdate")
        self.gridLayout.addWidget(self.apply_pubdate, 10, 2, 1, 1)
        self.label_11 = QtWidgets.QLabel(self.btab)
        self.label_11.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_11.setObjectName("label_11")
        self.gridLayout.addWidget(self.label_11, 11, 0, 1, 1)
        self.languages = LanguagesEdit(self.btab)
        self.languages.setObjectName("languages")
        self.gridLayout.addWidget(self.languages, 11, 1, 1, 1)
        self.clear_languages = QtWidgets.QCheckBox(self.btab)
        self.clear_languages.setObjectName("clear_languages")
        self.gridLayout.addWidget(self.clear_languages, 11, 2, 1, 1)
        self.verticalLayout_4.addLayout(self.gridLayout)
        spacerItem = QtWidgets.QSpacerItem(17, 13, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        self.verticalLayout_4.addItem(spacerItem)
        self.gridLayout_2 = QtWidgets.QGridLayout()
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.remove_conversion_settings = QtWidgets.QCheckBox(self.btab)
        self.remove_conversion_settings.setObjectName("remove_conversion_settings")
        self.gridLayout_2.addWidget(self.remove_conversion_settings, 0, 0, 1, 2)
        self.restore_original = QtWidgets.QCheckBox(self.btab)
        self.restore_original.setObjectName("restore_original")
        self.gridLayout_2.addWidget(self.restore_original, 0, 2, 1, 1)
        self.change_title_to_title_case = QtWidgets.QCheckBox(self.btab)
        self.change_title_to_title_case.setObjectName("change_title_to_title_case")
        self.gridLayout_2.addWidget(self.change_title_to_title_case, 1, 0, 1, 1)
        self.casing_algorithm = QtWidgets.QComboBox(self.btab)
        self.casing_algorithm.setMinimumSize(QtCore.QSize(150, 0))
        self.casing_algorithm.setObjectName("casing_algorithm")
        self.gridLayout_2.addWidget(self.casing_algorithm, 1, 1, 1, 1)
        self.update_title_sort = QtWidgets.QCheckBox(self.btab)
        self.update_title_sort.setObjectName("update_title_sort")
        self.gridLayout_2.addWidget(self.update_title_sort, 1, 2, 1, 1)
        self.verticalLayout_4.addLayout(self.gridLayout_2)
        self.read_file_metadata = QtWidgets.QCheckBox(self.btab)
        self.read_file_metadata.setObjectName("read_file_metadata")
        self.verticalLayout_4.addWidget(self.read_file_metadata)
        self.groupBox = QtWidgets.QGroupBox(self.btab)
        self.groupBox.setObjectName("groupBox")
        self.horizontalLayout_9 = QtWidgets.QHBoxLayout(self.groupBox)
        self.horizontalLayout_9.setObjectName("horizontalLayout_9")
        self.cover_generate = QtWidgets.QRadioButton(self.groupBox)
        self.cover_generate.setObjectName("cover_generate")
        self.horizontalLayout_9.addWidget(self.cover_generate)
        self.cover_remove = QtWidgets.QRadioButton(self.groupBox)
        self.cover_remove.setObjectName("cover_remove")
        self.horizontalLayout_9.addWidget(self.cover_remove)
        self.cover_trim = QtWidgets.QRadioButton(self.groupBox)
        self.cover_trim.setObjectName("cover_trim")
        self.horizontalLayout_9.addWidget(self.cover_trim)
        self.cover_from_fmt = QtWidgets.QRadioButton(self.groupBox)
        self.cover_from_fmt.setObjectName("cover_from_fmt")
        self.horizontalLayout_9.addWidget(self.cover_from_fmt)
        self.cover_clone = QtWidgets.QRadioButton(self.groupBox)
        self.cover_clone.setObjectName("cover_clone")
        self.horizontalLayout_9.addWidget(self.cover_clone)
        self.verticalLayout_4.addWidget(self.groupBox)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.compress_cover_images = QtWidgets.QCheckBox(self.btab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.compress_cover_images.sizePolicy().hasHeightForWidth())
        self.compress_cover_images.setSizePolicy(sizePolicy)
        self.compress_cover_images.setObjectName("compress_cover_images")
        self.horizontalLayout_3.addWidget(self.compress_cover_images)
        self.compress_quality = QtWidgets.QSpinBox(self.btab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.compress_quality.sizePolicy().hasHeightForWidth())
        self.compress_quality.setSizePolicy(sizePolicy)
        self.compress_quality.setMinimum(10)
        self.compress_quality.setMaximum(100)
        self.compress_quality.setProperty("value", 100)
        self.compress_quality.setObjectName("compress_quality")
        self.horizontalLayout_3.addWidget(self.compress_quality)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem1)
        self.verticalLayout_4.addLayout(self.horizontalLayout_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.button_config_cover_gen = QtWidgets.QPushButton(self.btab)
        self.button_config_cover_gen.setObjectName("button_config_cover_gen")
        self.horizontalLayout.addWidget(self.button_config_cover_gen)
        self.comments_button = QtWidgets.QPushButton(self.btab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.comments_button.sizePolicy().hasHeightForWidth())
        self.comments_button.setSizePolicy(sizePolicy)
        self.comments_button.setObjectName("comments_button")
        self.horizontalLayout.addWidget(self.comments_button)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem2)
        self.verticalLayout_4.addLayout(self.horizontalLayout)
        spacerItem3 = QtWidgets.QSpacerItem(17, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_4.addItem(spacerItem3)
        self.scrollArea1.setWidget(self.btab)
        self.central_widget.addTab(self.scrollArea1, "")
        self.scrollArea2 = QtWidgets.QScrollArea()
        self.scrollArea2.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.scrollArea2.setWidgetResizable(True)
        self.scrollArea2.setObjectName("scrollArea2")
        self.tab = QtWidgets.QWidget()
        self.tab.setGeometry(QtCore.QRect(0, 0, 100, 30))
        self.tab.setObjectName("tab")
        self.scrollArea2.setWidget(self.tab)
        self.central_widget.addTab(self.scrollArea2, "")
        self.scrollArea3 = QtWidgets.QScrollArea()
        self.scrollArea3.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.scrollArea3.setWidgetResizable(True)
        self.scrollArea3.setObjectName("scrollArea3")
        self.tabWidgetPage3 = QtWidgets.QWidget()
        self.tabWidgetPage3.setGeometry(QtCore.QRect(0, 0, 777, 388))
        self.tabWidgetPage3.setObjectName("tabWidgetPage3")
        self.vargrid = QtWidgets.QGridLayout(self.tabWidgetPage3)
        self.vargrid.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
        self.vargrid.setObjectName("vargrid")
        self.s_r_heading = QtWidgets.QLabel(self.tabWidgetPage3)
        self.s_r_heading.setWordWrap(True)
        self.s_r_heading.setOpenExternalLinks(True)
        self.s_r_heading.setObjectName("s_r_heading")
        self.vargrid.addWidget(self.s_r_heading, 0, 0, 1, 4)
        self.filler = QtWidgets.QLabel(self.tabWidgetPage3)
        self.filler.setText("")
        self.filler.setObjectName("filler")
        self.vargrid.addWidget(self.filler, 1, 0, 1, 1)
        self.line = QtWidgets.QFrame(self.tabWidgetPage3)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.vargrid.addWidget(self.line, 2, 0, 1, 3)
        self.xlabel_22 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_22.setObjectName("xlabel_22")
        self.vargrid.addWidget(self.xlabel_22, 3, 0, 1, 1)
        self.query_field = QtWidgets.QComboBox(self.tabWidgetPage3)
        self.query_field.setObjectName("query_field")
        self.vargrid.addWidget(self.query_field, 3, 1, 1, 1)
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
        spacerItem4 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_6.addItem(spacerItem4)
        self.save_button = QtWidgets.QPushButton(self.tabWidgetPage3)
        self.save_button.setObjectName("save_button")
        self.horizontalLayout_6.addWidget(self.save_button)
        self.remove_button = QtWidgets.QPushButton(self.tabWidgetPage3)
        self.remove_button.setObjectName("remove_button")
        self.horizontalLayout_6.addWidget(self.remove_button)
        spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_6.addItem(spacerItem5)
        self.vargrid.addLayout(self.horizontalLayout_6, 3, 2, 1, 1)
        self.xlabel_21 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_21.setObjectName("xlabel_21")
        self.vargrid.addWidget(self.xlabel_21, 4, 0, 1, 1)
        self.search_field = QtWidgets.QComboBox(self.tabWidgetPage3)
        self.search_field.setObjectName("search_field")
        self.vargrid.addWidget(self.search_field, 4, 1, 1, 1)
        self.HLayout_4 = QtWidgets.QHBoxLayout()
        self.HLayout_4.setObjectName("HLayout_4")
        self.xlabel_24 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_24.setObjectName("xlabel_24")
        self.HLayout_4.addWidget(self.xlabel_24)
        self.search_mode = QtWidgets.QComboBox(self.tabWidgetPage3)
        self.search_mode.setObjectName("search_mode")
        self.HLayout_4.addWidget(self.search_mode)
        spacerItem6 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.HLayout_4.addItem(spacerItem6)
        self.vargrid.addLayout(self.HLayout_4, 4, 2, 1, 1)
        self.s_r_src_ident_label = QtWidgets.QLabel(self.tabWidgetPage3)
        self.s_r_src_ident_label.setObjectName("s_r_src_ident_label")
        self.vargrid.addWidget(self.s_r_src_ident_label, 5, 0, 1, 1)
        self.s_r_src_ident = QtWidgets.QComboBox(self.tabWidgetPage3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(100)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.s_r_src_ident.sizePolicy().hasHeightForWidth())
        self.s_r_src_ident.setSizePolicy(sizePolicy)
        self.s_r_src_ident.setObjectName("s_r_src_ident")
        self.vargrid.addWidget(self.s_r_src_ident, 5, 1, 1, 1)
        self.template_label = QtWidgets.QLabel(self.tabWidgetPage3)
        self.template_label.setObjectName("template_label")
        self.vargrid.addWidget(self.template_label, 5, 0, 1, 1)
        self.s_r_template = HistoryLineEdit(self.tabWidgetPage3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(100)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.s_r_template.sizePolicy().hasHeightForWidth())
        self.s_r_template.setSizePolicy(sizePolicy)
        self.s_r_template.setObjectName("s_r_template")
        self.vargrid.addWidget(self.s_r_template, 5, 1, 1, 1)
        self.xlabel_2 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_2.setObjectName("xlabel_2")
        self.vargrid.addWidget(self.xlabel_2, 6, 0, 1, 1)
        self.search_for = HistoryLineEdit(self.tabWidgetPage3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(100)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.search_for.sizePolicy().hasHeightForWidth())
        self.search_for.setSizePolicy(sizePolicy)
        self.search_for.setObjectName("search_for")
        self.vargrid.addWidget(self.search_for, 6, 1, 1, 1)
        self.case_sensitive = QtWidgets.QCheckBox(self.tabWidgetPage3)
        self.case_sensitive.setChecked(True)
        self.case_sensitive.setObjectName("case_sensitive")
        self.vargrid.addWidget(self.case_sensitive, 6, 2, 1, 1)
        self.xlabel_4 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_4.setObjectName("xlabel_4")
        self.vargrid.addWidget(self.xlabel_4, 7, 0, 1, 1)
        self.replace_with = HistoryLineEdit(self.tabWidgetPage3)
        self.replace_with.setObjectName("replace_with")
        self.vargrid.addWidget(self.replace_with, 7, 1, 1, 1)
        self.verticalLayout = QtWidgets.QHBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label_41 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.label_41.setObjectName("label_41")
        self.verticalLayout.addWidget(self.label_41)
        self.replace_func = QtWidgets.QComboBox(self.tabWidgetPage3)
        self.replace_func.setObjectName("replace_func")
        self.verticalLayout.addWidget(self.replace_func)
        spacerItem7 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.verticalLayout.addItem(spacerItem7)
        self.vargrid.addLayout(self.verticalLayout, 7, 2, 1, 1)
        self.destination_field_label = QtWidgets.QLabel(self.tabWidgetPage3)
        self.destination_field_label.setObjectName("destination_field_label")
        self.vargrid.addWidget(self.destination_field_label, 8, 0, 1, 1)
        self.destination_field = QtWidgets.QComboBox(self.tabWidgetPage3)
        self.destination_field.setObjectName("destination_field")
        self.vargrid.addWidget(self.destination_field, 8, 1, 1, 1)
        self.verticalLayout_2 = QtWidgets.QHBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.replace_mode_label = QtWidgets.QLabel(self.tabWidgetPage3)
        self.replace_mode_label.setObjectName("replace_mode_label")
        self.verticalLayout_2.addWidget(self.replace_mode_label)
        self.replace_mode = QtWidgets.QComboBox(self.tabWidgetPage3)
        self.replace_mode.setObjectName("replace_mode")
        self.verticalLayout_2.addWidget(self.replace_mode)
        self.comma_separated = QtWidgets.QCheckBox(self.tabWidgetPage3)
        self.comma_separated.setChecked(True)
        self.comma_separated.setObjectName("comma_separated")
        self.verticalLayout_2.addWidget(self.comma_separated)
        spacerItem8 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.verticalLayout_2.addItem(spacerItem8)
        self.vargrid.addLayout(self.verticalLayout_2, 8, 2, 1, 1)
        self.s_r_dst_ident_label = QtWidgets.QLabel(self.tabWidgetPage3)
        self.s_r_dst_ident_label.setObjectName("s_r_dst_ident_label")
        self.vargrid.addWidget(self.s_r_dst_ident_label, 9, 0, 1, 1)
        self.s_r_dst_ident = QtWidgets.QLineEdit(self.tabWidgetPage3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(100)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.s_r_dst_ident.sizePolicy().hasHeightForWidth())
        self.s_r_dst_ident.setSizePolicy(sizePolicy)
        self.s_r_dst_ident.setObjectName("s_r_dst_ident")
        self.vargrid.addWidget(self.s_r_dst_ident, 9, 1, 1, 1)
        self.horizontalLayout_21 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_21.setObjectName("horizontalLayout_21")
        spacerItem9 = QtWidgets.QSpacerItem(20, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_21.addItem(spacerItem9)
        self.xlabel_412 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_412.setObjectName("xlabel_412")
        self.horizontalLayout_21.addWidget(self.xlabel_412)
        self.results_count = QtWidgets.QSpinBox(self.tabWidgetPage3)
        self.results_count.setEnabled(True)
        self.results_count.setMinimum(1)
        self.results_count.setMaximum(999)
        self.results_count.setProperty("value", 999)
        self.results_count.setObjectName("results_count")
        self.horizontalLayout_21.addWidget(self.results_count)
        self.xlabel_413 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_413.setObjectName("xlabel_413")
        self.horizontalLayout_21.addWidget(self.xlabel_413)
        self.starting_from = QtWidgets.QSpinBox(self.tabWidgetPage3)
        self.starting_from.setEnabled(True)
        self.starting_from.setMinimum(1)
        self.starting_from.setMaximum(999)
        self.starting_from.setProperty("value", 1)
        self.starting_from.setObjectName("starting_from")
        self.horizontalLayout_21.addWidget(self.starting_from)
        self.xlabel_41 = QtWidgets.QLabel(self.tabWidgetPage3)
        self.xlabel_41.setObjectName("xlabel_41")
        self.horizontalLayout_21.addWidget(self.xlabel_41)
        self.multiple_separator = QtWidgets.QLineEdit(self.tabWidgetPage3)
        self.multiple_separator.setObjectName("multiple_separator")
        self.horizontalLayout_21.addWidget(self.multiple_separator)
        self.vargrid.addLayout(self.horizontalLayout_21, 10, 1, 1, 2)
        self.scrollArea11 = QtWidgets.QScrollArea(self.tabWidgetPage3)
        self.scrollArea11.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.scrollArea11.setWidgetResizable(True)
        self.scrollArea11.setObjectName("scrollArea11")
        self.gridLayoutWidget_2 = QtWidgets.QWidget()
        self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 745, 70))
        self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
        self.testgrid = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
        self.testgrid.setObjectName("testgrid")
        self.xlabel_3 = QtWidgets.QLabel(self.gridLayoutWidget_2)
        self.xlabel_3.setObjectName("xlabel_3")
        self.testgrid.addWidget(self.xlabel_3, 7, 1, 1, 1)
        self.xlabel_5 = QtWidgets.QLabel(self.gridLayoutWidget_2)
        self.xlabel_5.setObjectName("xlabel_5")
        self.testgrid.addWidget(self.xlabel_5, 7, 2, 1, 1)
        self.label_31 = QtWidgets.QLabel(self.gridLayoutWidget_2)
        self.label_31.setObjectName("label_31")
        self.testgrid.addWidget(self.label_31, 8, 0, 1, 1)
        self.test_text = HistoryLineEdit(self.gridLayoutWidget_2)
        self.test_text.setObjectName("test_text")
        self.testgrid.addWidget(self.test_text, 8, 1, 1, 1)
        self.test_result = QtWidgets.QLineEdit(self.gridLayoutWidget_2)
        self.test_result.setObjectName("test_result")
        self.testgrid.addWidget(self.test_result, 8, 2, 1, 1)
        spacerItem10 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.testgrid.addItem(spacerItem10, 25, 0, 1, 2)
        self.scrollArea11.setWidget(self.gridLayoutWidget_2)
        self.vargrid.addWidget(self.scrollArea11, 11, 0, 1, 4)
        self.scrollArea3.setWidget(self.tabWidgetPage3)
        self.central_widget.addTab(self.scrollArea3, "")
        self.verticalLayout_3.addWidget(self.central_widget)
        self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_10.setObjectName("horizontalLayout_10")
        self.refresh_book_list = QtWidgets.QCheckBox(MetadataBulkDialog)
        self.refresh_book_list.setObjectName("refresh_book_list")
        self.horizontalLayout_10.addWidget(self.refresh_book_list)
        spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_10.addItem(spacerItem11)
        self.button_box = QtWidgets.QDialogButtonBox(MetadataBulkDialog)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.button_box.setObjectName("button_box")
        self.horizontalLayout_10.addWidget(self.button_box)
        self.verticalLayout_3.addLayout(self.horizontalLayout_10)
        self.label_2.setBuddy(self.authors)
        self.label_8.setBuddy(self.author_sort)
        self.label_6.setBuddy(self.rating)
        self.label_3.setBuddy(self.publisher)
        self.label_4.setBuddy(self.tags)
        self.label.setBuddy(self.remove_tags)
        self.label_7.setBuddy(self.series)
        self.label_10.setBuddy(self.adddate)
        self.label_9.setBuddy(self.pubdate)
        self.label_11.setBuddy(self.languages)
        self.xlabel_22.setBuddy(self.query_field)
        self.xlabel_21.setBuddy(self.search_field)
        self.xlabel_24.setBuddy(self.search_mode)
        self.s_r_src_ident_label.setBuddy(self.s_r_src_ident)
        self.template_label.setBuddy(self.s_r_template)
        self.xlabel_2.setBuddy(self.search_for)
        self.xlabel_4.setBuddy(self.replace_with)
        self.label_41.setBuddy(self.replace_func)
        self.destination_field_label.setBuddy(self.destination_field)
        self.replace_mode_label.setBuddy(self.replace_mode)
        self.s_r_dst_ident_label.setBuddy(self.s_r_dst_ident)
        self.xlabel_412.setBuddy(self.results_count)
        self.xlabel_413.setBuddy(self.starting_from)
        self.xlabel_41.setBuddy(self.multiple_separator)
        self.label_31.setBuddy(self.test_text)

        self.retranslateUi(MetadataBulkDialog)
        self.central_widget.setCurrentIndex(0)
        self.button_box.accepted.connect(MetadataBulkDialog.accept)
        self.button_box.rejected.connect(MetadataBulkDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(MetadataBulkDialog)
        MetadataBulkDialog.setTabOrder(self.central_widget, self.authors)
        MetadataBulkDialog.setTabOrder(self.authors, self.auto_author_sort)
        MetadataBulkDialog.setTabOrder(self.auto_author_sort, self.swap_title_and_author)
        MetadataBulkDialog.setTabOrder(self.swap_title_and_author, self.author_sort)
        MetadataBulkDialog.setTabOrder(self.author_sort, self.rating)
        MetadataBulkDialog.setTabOrder(self.rating, self.apply_rating)
        MetadataBulkDialog.setTabOrder(self.apply_rating, self.publisher)
        MetadataBulkDialog.setTabOrder(self.publisher, self.clear_pub)
        MetadataBulkDialog.setTabOrder(self.clear_pub, self.tags)
        MetadataBulkDialog.setTabOrder(self.tags, self.tag_editor_button)
        MetadataBulkDialog.setTabOrder(self.tag_editor_button, self.remove_tags)
        MetadataBulkDialog.setTabOrder(self.remove_tags, self.remove_all_tags)
        MetadataBulkDialog.setTabOrder(self.remove_all_tags, self.series)
        MetadataBulkDialog.setTabOrder(self.series, self.clear_series)
        MetadataBulkDialog.setTabOrder(self.clear_series, self.autonumber_series)
        MetadataBulkDialog.setTabOrder(self.autonumber_series, self.series_numbering_restarts)
        MetadataBulkDialog.setTabOrder(self.series_numbering_restarts, self.series_start_number)
        MetadataBulkDialog.setTabOrder(self.series_start_number, self.series_increment)
        MetadataBulkDialog.setTabOrder(self.series_increment, self.adddate)
        MetadataBulkDialog.setTabOrder(self.adddate, self.clear_adddate_button)
        MetadataBulkDialog.setTabOrder(self.clear_adddate_button, self.apply_adddate)
        MetadataBulkDialog.setTabOrder(self.apply_adddate, self.pubdate)
        MetadataBulkDialog.setTabOrder(self.pubdate, self.clear_pubdate_button)
        MetadataBulkDialog.setTabOrder(self.clear_pubdate_button, self.apply_pubdate)
        MetadataBulkDialog.setTabOrder(self.apply_pubdate, self.languages)
        MetadataBulkDialog.setTabOrder(self.languages, self.clear_languages)
        MetadataBulkDialog.setTabOrder(self.clear_languages, self.remove_conversion_settings)
        MetadataBulkDialog.setTabOrder(self.remove_conversion_settings, self.restore_original)
        MetadataBulkDialog.setTabOrder(self.restore_original, self.change_title_to_title_case)
        MetadataBulkDialog.setTabOrder(self.change_title_to_title_case, self.casing_algorithm)
        MetadataBulkDialog.setTabOrder(self.casing_algorithm, self.cover_generate)
        MetadataBulkDialog.setTabOrder(self.cover_generate, self.cover_remove)
        MetadataBulkDialog.setTabOrder(self.cover_remove, self.cover_trim)
        MetadataBulkDialog.setTabOrder(self.cover_trim, self.cover_from_fmt)
        MetadataBulkDialog.setTabOrder(self.cover_from_fmt, self.cover_clone)
        MetadataBulkDialog.setTabOrder(self.cover_clone, self.button_config_cover_gen)
        MetadataBulkDialog.setTabOrder(self.button_config_cover_gen, self.comments_button)
        MetadataBulkDialog.setTabOrder(self.comments_button, self.query_field)
        MetadataBulkDialog.setTabOrder(self.query_field, self.save_button)
        MetadataBulkDialog.setTabOrder(self.save_button, self.remove_button)
        MetadataBulkDialog.setTabOrder(self.remove_button, self.search_field)
        MetadataBulkDialog.setTabOrder(self.search_field, self.search_mode)
        MetadataBulkDialog.setTabOrder(self.search_mode, self.s_r_src_ident)
        MetadataBulkDialog.setTabOrder(self.s_r_src_ident, self.s_r_template)
        MetadataBulkDialog.setTabOrder(self.s_r_template, self.search_for)
        MetadataBulkDialog.setTabOrder(self.search_for, self.case_sensitive)
        MetadataBulkDialog.setTabOrder(self.case_sensitive, self.replace_with)
        MetadataBulkDialog.setTabOrder(self.replace_with, self.replace_func)
        MetadataBulkDialog.setTabOrder(self.replace_func, self.destination_field)
        MetadataBulkDialog.setTabOrder(self.destination_field, self.replace_mode)
        MetadataBulkDialog.setTabOrder(self.replace_mode, self.comma_separated)
        MetadataBulkDialog.setTabOrder(self.comma_separated, self.s_r_dst_ident)
        MetadataBulkDialog.setTabOrder(self.s_r_dst_ident, self.results_count)
        MetadataBulkDialog.setTabOrder(self.results_count, self.starting_from)
        MetadataBulkDialog.setTabOrder(self.starting_from, self.multiple_separator)
        MetadataBulkDialog.setTabOrder(self.multiple_separator, self.scrollArea11)
        MetadataBulkDialog.setTabOrder(self.scrollArea11, self.test_text)
        MetadataBulkDialog.setTabOrder(self.test_text, self.test_result)
        MetadataBulkDialog.setTabOrder(self.test_result, self.refresh_book_list)
Exemplo n.º 25
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(820, 519)
        self.gridLayout_2 = QtGui.QGridLayout(Form)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.tabWidget = QtGui.QTabWidget(Form)
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.tab = QtGui.QWidget()
        self.tab.setObjectName(_fromUtf8("tab"))
        self.gridLayout_9 = QtGui.QGridLayout(self.tab)
        self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9"))
        self.label_7 = QtGui.QLabel(self.tab)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.gridLayout_9.addWidget(self.label_7, 2, 0, 1, 1)
        self.opt_language = QtGui.QComboBox(self.tab)
        self.opt_language.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self.opt_language.setMinimumContentsLength(20)
        self.opt_language.setObjectName(_fromUtf8("opt_language"))
        self.gridLayout_9.addWidget(self.opt_language, 2, 1, 1, 1)
        self.opt_systray_icon = QtGui.QCheckBox(self.tab)
        self.opt_systray_icon.setObjectName(_fromUtf8("opt_systray_icon"))
        self.gridLayout_9.addWidget(self.opt_systray_icon, 3, 0, 1, 1)
        self.label_17 = QtGui.QLabel(self.tab)
        self.label_17.setObjectName(_fromUtf8("label_17"))
        self.gridLayout_9.addWidget(self.label_17, 1, 0, 1, 1)
        self.opt_gui_layout = QtGui.QComboBox(self.tab)
        self.opt_gui_layout.setMaximumSize(QtCore.QSize(250, 16777215))
        self.opt_gui_layout.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self.opt_gui_layout.setMinimumContentsLength(20)
        self.opt_gui_layout.setObjectName(_fromUtf8("opt_gui_layout"))
        self.gridLayout_9.addWidget(self.opt_gui_layout, 1, 1, 1, 1)
        self.opt_disable_animations = QtGui.QCheckBox(self.tab)
        self.opt_disable_animations.setObjectName(_fromUtf8("opt_disable_animations"))
        self.gridLayout_9.addWidget(self.opt_disable_animations, 3, 1, 1, 1)
        self.opt_disable_tray_notification = QtGui.QCheckBox(self.tab)
        self.opt_disable_tray_notification.setObjectName(_fromUtf8("opt_disable_tray_notification"))
        self.gridLayout_9.addWidget(self.opt_disable_tray_notification, 4, 0, 1, 1)
        self.opt_show_splash_screen = QtGui.QCheckBox(self.tab)
        self.opt_show_splash_screen.setObjectName(_fromUtf8("opt_show_splash_screen"))
        self.gridLayout_9.addWidget(self.opt_show_splash_screen, 4, 1, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(self.tab)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_8 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8"))
        self.opt_toolbar_icon_size = QtGui.QComboBox(self.groupBox_2)
        self.opt_toolbar_icon_size.setObjectName(_fromUtf8("opt_toolbar_icon_size"))
        self.gridLayout_8.addWidget(self.opt_toolbar_icon_size, 0, 1, 1, 1)
        self.label_5 = QtGui.QLabel(self.groupBox_2)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.gridLayout_8.addWidget(self.label_5, 0, 0, 1, 1)
        self.opt_toolbar_text = QtGui.QComboBox(self.groupBox_2)
        self.opt_toolbar_text.setObjectName(_fromUtf8("opt_toolbar_text"))
        self.gridLayout_8.addWidget(self.opt_toolbar_text, 1, 1, 1, 1)
        self.label_8 = QtGui.QLabel(self.groupBox_2)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.gridLayout_8.addWidget(self.label_8, 1, 0, 1, 1)
        self.gridLayout_9.addWidget(self.groupBox_2, 7, 0, 1, 2)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout_9.addItem(spacerItem, 8, 0, 1, 1)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label_2 = QtGui.QLabel(self.tab)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout.addWidget(self.label_2)
        self.font_display = QtGui.QLineEdit(self.tab)
        self.font_display.setReadOnly(True)
        self.font_display.setObjectName(_fromUtf8("font_display"))
        self.horizontalLayout.addWidget(self.font_display)
        self.gridLayout_9.addLayout(self.horizontalLayout, 6, 0, 1, 1)
        self.change_font_button = QtGui.QPushButton(self.tab)
        self.change_font_button.setObjectName(_fromUtf8("change_font_button"))
        self.gridLayout_9.addWidget(self.change_font_button, 6, 1, 1, 1)
        self.label_widget_style = QtGui.QLabel(self.tab)
        self.label_widget_style.setObjectName(_fromUtf8("label_widget_style"))
        self.gridLayout_9.addWidget(self.label_widget_style, 0, 0, 1, 1)
        self.opt_ui_style = QtGui.QComboBox(self.tab)
        self.opt_ui_style.setObjectName(_fromUtf8("opt_ui_style"))
        self.gridLayout_9.addWidget(self.opt_ui_style, 0, 1, 1, 1)
        self.opt_book_list_tooltips = QtGui.QCheckBox(self.tab)
        self.opt_book_list_tooltips.setObjectName(_fromUtf8("opt_book_list_tooltips"))
        self.gridLayout_9.addWidget(self.opt_book_list_tooltips, 5, 0, 1, 1)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("lt.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.tab, icon, _fromUtf8(""))
        self.tab_4 = QtGui.QWidget()
        self.tab_4.setObjectName(_fromUtf8("tab_4"))
        self.gridLayout_12 = QtGui.QGridLayout(self.tab_4)
        self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12"))
        self.groupBox = QtGui.QGroupBox(self.tab_4)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.field_display_order = QtGui.QListView(self.groupBox)
        self.field_display_order.setAlternatingRowColors(True)
        self.field_display_order.setObjectName(_fromUtf8("field_display_order"))
        self.gridLayout_3.addWidget(self.field_display_order, 0, 0, 3, 1)
        self.df_up_button = QtGui.QToolButton(self.groupBox)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("arrow-up.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.df_up_button.setIcon(icon1)
        self.df_up_button.setObjectName(_fromUtf8("df_up_button"))
        self.gridLayout_3.addWidget(self.df_up_button, 0, 1, 1, 1)
        self.df_down_button = QtGui.QToolButton(self.groupBox)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(_fromUtf8(I("arrow-down.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.df_down_button.setIcon(icon2)
        self.df_down_button.setObjectName(_fromUtf8("df_down_button"))
        self.gridLayout_3.addWidget(self.df_down_button, 2, 1, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout_3.addItem(spacerItem1, 1, 1, 1, 1)
        self.gridLayout_12.addWidget(self.groupBox, 1, 0, 2, 1)
        self.hboxlayout = QtGui.QHBoxLayout()
        self.hboxlayout.setObjectName(_fromUtf8("hboxlayout"))
        self.label = QtGui.QLabel(self.tab_4)
        self.label.setObjectName(_fromUtf8("label"))
        self.hboxlayout.addWidget(self.label)
        self.opt_default_author_link = QtGui.QLineEdit(self.tab_4)
        self.opt_default_author_link.setObjectName(_fromUtf8("opt_default_author_link"))
        self.hboxlayout.addWidget(self.opt_default_author_link)
        self.gridLayout_12.addLayout(self.hboxlayout, 0, 0, 1, 1)
        self.opt_use_roman_numerals_for_series_number = QtGui.QCheckBox(self.tab_4)
        self.opt_use_roman_numerals_for_series_number.setChecked(True)
        self.opt_use_roman_numerals_for_series_number.setObjectName(_fromUtf8("opt_use_roman_numerals_for_series_number"))
        self.gridLayout_12.addWidget(self.opt_use_roman_numerals_for_series_number, 0, 1, 1, 1)
        self.label_3 = QtGui.QLabel(self.tab_4)
        self.label_3.setWordWrap(True)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_12.addWidget(self.label_3, 1, 1, 1, 1)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap(_fromUtf8(I("book.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.tab_4, icon3, _fromUtf8(""))
        self.tab_2 = QtGui.QWidget()
        self.tab_2.setObjectName(_fromUtf8("tab_2"))
        self.gridLayout_10 = QtGui.QGridLayout(self.tab_2)
        self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10"))
        self.opt_categories_using_hierarchy = EditWithComplete(self.tab_2)
        self.opt_categories_using_hierarchy.setObjectName(_fromUtf8("opt_categories_using_hierarchy"))
        self.gridLayout_10.addWidget(self.opt_categories_using_hierarchy, 3, 2, 1, 3)
        self.label_9 = QtGui.QLabel(self.tab_2)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.gridLayout_10.addWidget(self.label_9, 0, 0, 1, 2)
        self.opt_tags_browser_partition_method = QtGui.QComboBox(self.tab_2)
        self.opt_tags_browser_partition_method.setObjectName(_fromUtf8("opt_tags_browser_partition_method"))
        self.gridLayout_10.addWidget(self.opt_tags_browser_partition_method, 0, 2, 1, 1)
        self.label_10 = QtGui.QLabel(self.tab_2)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout_10.addWidget(self.label_10, 0, 3, 1, 1)
        self.opt_tags_browser_collapse_at = QtGui.QSpinBox(self.tab_2)
        self.opt_tags_browser_collapse_at.setMaximum(10000)
        self.opt_tags_browser_collapse_at.setObjectName(_fromUtf8("opt_tags_browser_collapse_at"))
        self.gridLayout_10.addWidget(self.opt_tags_browser_collapse_at, 0, 4, 1, 1)
        spacerItem2 = QtGui.QSpacerItem(690, 252, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout_10.addItem(spacerItem2, 5, 0, 1, 5)
        self.label_8111 = QtGui.QLabel(self.tab_2)
        self.label_8111.setObjectName(_fromUtf8("label_8111"))
        self.gridLayout_10.addWidget(self.label_8111, 1, 2, 1, 1)
        self.opt_tag_browser_dont_collapse = EditWithComplete(self.tab_2)
        self.opt_tag_browser_dont_collapse.setObjectName(_fromUtf8("opt_tag_browser_dont_collapse"))
        self.gridLayout_10.addWidget(self.opt_tag_browser_dont_collapse, 1, 3, 1, 2)
        self.opt_show_avg_rating = QtGui.QCheckBox(self.tab_2)
        self.opt_show_avg_rating.setChecked(True)
        self.opt_show_avg_rating.setObjectName(_fromUtf8("opt_show_avg_rating"))
        self.gridLayout_10.addWidget(self.opt_show_avg_rating, 2, 0, 1, 5)
        self.label_81 = QtGui.QLabel(self.tab_2)
        self.label_81.setObjectName(_fromUtf8("label_81"))
        self.gridLayout_10.addWidget(self.label_81, 3, 0, 1, 1)
        self.opt_tag_browser_old_look = QtGui.QCheckBox(self.tab_2)
        self.opt_tag_browser_old_look.setObjectName(_fromUtf8("opt_tag_browser_old_look"))
        self.gridLayout_10.addWidget(self.opt_tag_browser_old_look, 4, 0, 1, 5)
        icon4 = QtGui.QIcon()
        icon4.addPixmap(QtGui.QPixmap(_fromUtf8(I("tags.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.tab_2, icon4, _fromUtf8(""))
        self.tab_3 = QtGui.QWidget()
        self.tab_3.setObjectName(_fromUtf8("tab_3"))
        self.gridLayout_11 = QtGui.QGridLayout(self.tab_3)
        self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11"))
        self.opt_separate_cover_flow = QtGui.QCheckBox(self.tab_3)
        self.opt_separate_cover_flow.setObjectName(_fromUtf8("opt_separate_cover_flow"))
        self.gridLayout_11.addWidget(self.opt_separate_cover_flow, 0, 0, 1, 2)
        self.label_6 = QtGui.QLabel(self.tab_3)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.gridLayout_11.addWidget(self.label_6, 1, 0, 1, 1)
        self.opt_cover_flow_queue_length = QtGui.QSpinBox(self.tab_3)
        self.opt_cover_flow_queue_length.setObjectName(_fromUtf8("opt_cover_flow_queue_length"))
        self.gridLayout_11.addWidget(self.opt_cover_flow_queue_length, 1, 1, 1, 1)
        spacerItem3 = QtGui.QSpacerItem(690, 283, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout_11.addItem(spacerItem3, 4, 0, 1, 2)
        self.opt_cb_fullscreen = QtGui.QCheckBox(self.tab_3)
        self.opt_cb_fullscreen.setObjectName(_fromUtf8("opt_cb_fullscreen"))
        self.gridLayout_11.addWidget(self.opt_cb_fullscreen, 2, 0, 1, 2)
        self.fs_help_msg = QtGui.QLabel(self.tab_3)
        self.fs_help_msg.setStyleSheet(_fromUtf8("margin-left: 1.5em"))
        self.fs_help_msg.setWordWrap(True)
        self.fs_help_msg.setObjectName(_fromUtf8("fs_help_msg"))
        self.gridLayout_11.addWidget(self.fs_help_msg, 3, 0, 1, 2)
        icon5 = QtGui.QIcon()
        icon5.addPixmap(QtGui.QPixmap(_fromUtf8(I("cover_flow.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.tab_3, icon5, _fromUtf8(""))
        self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1)
        self.label_7.setBuddy(self.opt_language)
        self.label_17.setBuddy(self.opt_gui_layout)
        self.label_5.setBuddy(self.opt_toolbar_icon_size)
        self.label_8.setBuddy(self.opt_toolbar_text)
        self.label_2.setBuddy(self.font_display)
        self.label_widget_style.setBuddy(self.opt_ui_style)
        self.label.setBuddy(self.opt_default_author_link)
        self.label_9.setBuddy(self.opt_tags_browser_partition_method)
        self.label_10.setBuddy(self.opt_tags_browser_collapse_at)
        self.label_8111.setBuddy(self.opt_tag_browser_dont_collapse)
        self.label_81.setBuddy(self.opt_categories_using_hierarchy)
        self.label_6.setBuddy(self.opt_cover_flow_queue_length)

        self.retranslateUi(Form)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(Form)
Exemplo n.º 26
0
    def __init__(self, parent, db, author, series=None, title=None, dup_title=None):
        QDialog.__init__(self, parent)
        self.db = db

        self.setWindowTitle(_('How many empty books?'))

        self._layout = QGridLayout(self)
        self.setLayout(self._layout)

        self.qty_label = QLabel(_('How many empty books should be added?'))
        self._layout.addWidget(self.qty_label, 0, 0, 1, 2)

        self.qty_spinbox = QSpinBox(self)
        self.qty_spinbox.setRange(1, 10000)
        self.qty_spinbox.setValue(1)
        self._layout.addWidget(self.qty_spinbox, 1, 0, 1, 2)

        self.author_label = QLabel(_('Set the author of the new books to:'))
        self._layout.addWidget(self.author_label, 2, 0, 1, 2)

        self.authors_combo = EditWithComplete(self)
        self.authors_combo.setSizeAdjustPolicy(
                self.authors_combo.AdjustToMinimumContentsLengthWithIcon)
        self.authors_combo.setEditable(True)
        self._layout.addWidget(self.authors_combo, 3, 0, 1, 1)
        self.initialize_authors(db, author)

        self.clear_button = QToolButton(self)
        self.clear_button.setIcon(QIcon(I('trash.png')))
        self.clear_button.setToolTip(_('Reset author to Unknown'))
        self.clear_button.clicked.connect(self.reset_author)
        self._layout.addWidget(self.clear_button, 3, 1, 1, 1)

        self.series_label = QLabel(_('Set the series of the new books to:'))
        self._layout.addWidget(self.series_label, 4, 0, 1, 2)

        self.series_combo = EditWithComplete(self)
        self.series_combo.setSizeAdjustPolicy(
                self.authors_combo.AdjustToMinimumContentsLengthWithIcon)
        self.series_combo.setEditable(True)
        self._layout.addWidget(self.series_combo, 5, 0, 1, 1)
        self.initialize_series(db, series)

        self.sclear_button = QToolButton(self)
        self.sclear_button.setIcon(QIcon(I('trash.png')))
        self.sclear_button.setToolTip(_('Reset series'))
        self.sclear_button.clicked.connect(self.reset_series)
        self._layout.addWidget(self.sclear_button, 5, 1, 1, 1)

        self.title_label = QLabel(_('Set the title of the new books to:'))
        self._layout.addWidget(self.title_label, 6, 0, 1, 2)

        self.title_edit = QLineEdit(self)
        self.title_edit.setText(title or '')
        self._layout.addWidget(self.title_edit, 7, 0, 1, 1)

        self.tclear_button = QToolButton(self)
        self.tclear_button.setIcon(QIcon(I('trash.png')))
        self.tclear_button.setToolTip(_('Reset title'))
        self.tclear_button.clicked.connect(self.title_edit.clear)
        self._layout.addWidget(self.tclear_button, 7, 1, 1, 1)

        self.format_label = QLabel(_('Also create an empty e-book in format:'))
        self._layout.addWidget(self.format_label, 8, 0, 1, 2)
        c = self.format_value = QComboBox(self)
        from calibre.ebooks.oeb.polish.create import valid_empty_formats
        possible_formats = [''] + sorted(x.upper() for x in valid_empty_formats)
        c.addItems(possible_formats)
        c.setToolTip(_('Also create an empty book format file that you can subsequently edit'))
        if gprefs.get('create_empty_epub_file', False):
            # Migration of the check box
            gprefs.set('create_empty_format_file', 'epub')
            del gprefs['create_empty_epub_file']
        use_format = gprefs.get('create_empty_format_file', '').upper()
        try:
            c.setCurrentIndex(possible_formats.index(use_format))
        except Exception:
            pass
        self._layout.addWidget(c, 9, 0, 1, 1)

        self.copy_formats = cf = QCheckBox(_('Also copy book &formats when duplicating a book'), self)
        cf.setToolTip(_(
            'Also copy all e-book files into the newly created duplicate'
            ' books.'))
        cf.setChecked(gprefs.get('create_empty_copy_dup_formats', False))
        self._layout.addWidget(cf, 10, 0, 1, -1)

        button_box = self.bb = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
        button_box.accepted.connect(self.accept)
        button_box.rejected.connect(self.reject)
        self._layout.addWidget(button_box, 11, 0, 1, -1)
        if dup_title:
            self.dup_button = b = button_box.addButton(_('&Duplicate current book'), button_box.ActionRole)
            b.clicked.connect(self.do_duplicate_book)
            b.setIcon(QIcon(I('edit-copy.png')))
            b.setToolTip(_(
                'Make the new empty book records exact duplicates\n'
                'of the current book "%s", with all metadata identical'
            ) % dup_title)
        self.resize(self.sizeHint())
        self.duplicate_current_book = False
Exemplo n.º 27
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(600, 500)
        self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.groupBox_4 = QtWidgets.QGroupBox(Form)
        self.groupBox_4.setObjectName("groupBox_4")
        self._2 = QtWidgets.QGridLayout(self.groupBox_4)
        self._2.setObjectName("_2")
        self._4 = QtWidgets.QVBoxLayout()
        self._4.setContentsMargins(0, 0, 0, 0)
        self._4.setSpacing(6)
        self._4.setObjectName("_4")
        self.label_5 = QtWidgets.QLabel(self.groupBox_4)
        self.label_5.setObjectName("label_5")
        self._4.addWidget(self.label_5)
        self._5 = QtWidgets.QHBoxLayout()
        self._5.setContentsMargins(0, 0, 0, 0)
        self._5.setSpacing(6)
        self._5.setObjectName("_5")
        self.cover_path = QtWidgets.QLineEdit(self.groupBox_4)
        self.cover_path.setClearButtonEnabled(True)
        self.cover_path.setObjectName("cover_path")
        self._5.addWidget(self.cover_path)
        self.cover_button = QtWidgets.QToolButton(self.groupBox_4)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(I("document_open.png")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.cover_button.setIcon(icon)
        self.cover_button.setObjectName("cover_button")
        self._5.addWidget(self.cover_button)
        self._4.addLayout(self._5)
        self._2.addLayout(self._4, 1, 0, 1, 1)
        self.opt_prefer_metadata_cover = QtWidgets.QCheckBox(self.groupBox_4)
        self.opt_prefer_metadata_cover.setChecked(True)
        self.opt_prefer_metadata_cover.setObjectName(
            "opt_prefer_metadata_cover")
        self._2.addWidget(self.opt_prefer_metadata_cover, 2, 0, 1, 1)
        self._3 = QtWidgets.QHBoxLayout()
        self._3.setObjectName("_3")
        self.cover = ImageView(self.groupBox_4)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.cover.sizePolicy().hasHeightForWidth())
        self.cover.setSizePolicy(sizePolicy)
        self.cover.setObjectName("cover")
        self._3.addWidget(self.cover)
        self._2.addLayout(self._3, 0, 0, 1, 1)
        self.horizontalLayout.addWidget(self.groupBox_4)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self._7 = QtWidgets.QGridLayout()
        self._7.setObjectName("_7")
        self.label = QtWidgets.QLabel(Form)
        self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing
                                | QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self._7.addWidget(self.label, 0, 0, 1, 1)
        self.title = EnLineEdit(Form)
        self.title.setObjectName("title")
        self._7.addWidget(self.title, 0, 1, 1, 1)
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self._7.addWidget(self.label_2, 1, 0, 1, 1)
        self.label_6 = QtWidgets.QLabel(Form)
        self.label_6.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_6.setObjectName("label_6")
        self._7.addWidget(self.label_6, 2, 0, 1, 1)
        self.author_sort = EnLineEdit(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.author_sort.sizePolicy().hasHeightForWidth())
        self.author_sort.setSizePolicy(sizePolicy)
        self.author_sort.setObjectName("author_sort")
        self._7.addWidget(self.author_sort, 2, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(Form)
        self.label_3.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName("label_3")
        self._7.addWidget(self.label_3, 3, 0, 1, 1)
        self.label_4 = QtWidgets.QLabel(Form)
        self.label_4.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_4.setObjectName("label_4")
        self._7.addWidget(self.label_4, 4, 0, 1, 1)
        self.tags = EditWithComplete(Form)
        self.tags.setObjectName("tags")
        self._7.addWidget(self.tags, 4, 1, 1, 1)
        self.label_7 = QtWidgets.QLabel(Form)
        self.label_7.setTextFormat(QtCore.Qt.PlainText)
        self.label_7.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_7.setObjectName("label_7")
        self._7.addWidget(self.label_7, 5, 0, 1, 1)
        self.series = EditWithComplete(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(10)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.series.sizePolicy().hasHeightForWidth())
        self.series.setSizePolicy(sizePolicy)
        self.series.setEditable(True)
        self.series.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically)
        self.series.setObjectName("series")
        self._7.addWidget(self.series, 5, 1, 1, 1)
        self.series_index = QtWidgets.QDoubleSpinBox(Form)
        self.series_index.setMaximum(9999999999.99)
        self.series_index.setProperty("value", 1.0)
        self.series_index.setObjectName("series_index")
        self._7.addWidget(self.series_index, 6, 1, 1, 1)
        self.publisher = EditWithComplete(Form)
        self.publisher.setEditable(True)
        self.publisher.setObjectName("publisher")
        self._7.addWidget(self.publisher, 3, 1, 1, 1)
        self.author = EditWithComplete(Form)
        self.author.setEditable(True)
        self.author.setObjectName("author")
        self._7.addWidget(self.author, 1, 1, 1, 1)
        self.verticalLayout_2.addLayout(self._7)
        self.comment = Editor(Form)
        self.comment.setObjectName("comment")
        self.verticalLayout_2.addWidget(self.comment)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.label_5.setBuddy(self.cover_path)
        self.label.setBuddy(self.title)
        self.label_2.setBuddy(self.author)
        self.label_6.setBuddy(self.author_sort)
        self.label_3.setBuddy(self.publisher)
        self.label_4.setBuddy(self.tags)
        self.label_7.setBuddy(self.series)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
        Form.setTabOrder(self.title, self.author)
        Form.setTabOrder(self.author, self.author_sort)
        Form.setTabOrder(self.author_sort, self.publisher)
        Form.setTabOrder(self.publisher, self.tags)
        Form.setTabOrder(self.tags, self.series)
        Form.setTabOrder(self.series, self.series_index)
        Form.setTabOrder(self.series_index, self.cover_path)
        Form.setTabOrder(self.cover_path, self.cover_button)
        Form.setTabOrder(self.cover_button, self.opt_prefer_metadata_cover)
    def initialize_controls(self):
        self.setWindowTitle('Manage Series')
        layout = QVBoxLayout(self)
        self.setLayout(layout)
        title_layout = ImageTitleLayout(self, 'images/manage_series.png',
                                        'Create or Modify Series')
        layout.addLayout(title_layout)

        # Series name and start index layout
        series_name_layout = QHBoxLayout()
        layout.addLayout(series_name_layout)

        series_column_label = QLabel('Series &Column:', self)
        series_name_layout.addWidget(series_column_label)
        self.series_column_combo = SeriesColumnComboBox(
            self, self.series_columns)
        self.series_column_combo.currentIndexChanged[int].connect(
            self.series_column_changed)
        series_name_layout.addWidget(self.series_column_combo)
        series_column_label.setBuddy(self.series_column_combo)
        series_name_layout.addSpacing(20)

        series_label = QLabel('Series &Name:', self)
        series_name_layout.addWidget(series_label)
        self.series_combo = EditWithComplete(self)
        self.series_combo.setEditable(True)
        self.series_combo.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically)
        self.series_combo.setSizeAdjustPolicy(
            QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self.series_combo.setMinimumContentsLength(25)
        self.series_combo.currentIndexChanged[int].connect(self.series_changed)
        self.series_combo.editTextChanged.connect(self.series_changed)
        self.series_combo.set_separator(None)
        series_label.setBuddy(self.series_combo)
        series_name_layout.addWidget(self.series_combo)
        series_name_layout.addSpacing(20)
        series_start_label = QLabel('&Start At:', self)
        series_name_layout.addWidget(series_start_label)
        self.series_start_number = QtGui.QSpinBox(self)
        self.series_start_number.setRange(0, 99000000)
        self.series_start_number.valueChanged[int].connect(
            self.series_start_changed)
        series_name_layout.addWidget(self.series_start_number)
        series_start_label.setBuddy(self.series_start_number)
        series_name_layout.insertStretch(-1)

        # Main series table layout
        table_layout = QHBoxLayout()
        layout.addLayout(table_layout)

        self.series_table = SeriesTableWidget(self)
        self.series_table.itemSelectionChanged.connect(
            self.item_selection_changed)
        self.series_table.cellChanged[int, int].connect(self.cell_changed)

        table_layout.addWidget(self.series_table)
        table_button_layout = QVBoxLayout()
        table_layout.addLayout(table_button_layout)
        move_up_button = QtGui.QToolButton(self)
        move_up_button.setToolTip('Move book up in series (Alt+Up)')
        move_up_button.setIcon(get_icon('arrow-up.png'))
        move_up_button.setShortcut(_('Alt+Up'))
        move_up_button.clicked.connect(self.move_rows_up)
        table_button_layout.addWidget(move_up_button)
        move_down_button = QtGui.QToolButton(self)
        move_down_button.setToolTip('Move book down in series (Alt+Down)')
        move_down_button.setIcon(get_icon('arrow-down.png'))
        move_down_button.setShortcut(_('Alt+Down'))
        move_down_button.clicked.connect(self.move_rows_down)
        table_button_layout.addWidget(move_down_button)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        table_button_layout.addItem(spacerItem1)
        assign_index_button = QtGui.QToolButton(self)
        assign_index_button.setToolTip('Lock to index value...')
        assign_index_button.setIcon(get_icon('images/lock.png'))
        assign_index_button.clicked.connect(self.assign_index)
        table_button_layout.addWidget(assign_index_button)
        clear_index_button = QtGui.QToolButton(self)
        clear_index_button.setToolTip('Unlock series index')
        clear_index_button.setIcon(get_icon('images/lock_delete.png'))
        clear_index_button.clicked.connect(self.clear_index)
        table_button_layout.addWidget(clear_index_button)
        spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        table_button_layout.addItem(spacerItem2)
        add_empty_button = QtGui.QToolButton(self)
        add_empty_button.setToolTip('Add empty book to the series list')
        add_empty_button.setIcon(get_icon('add_book.png'))
        add_empty_button.setShortcut(_('Ctrl+Shift+E'))
        add_empty_button.clicked.connect(self.add_empty_book)
        table_button_layout.addWidget(add_empty_button)
        delete_button = QtGui.QToolButton(self)
        delete_button.setToolTip('Remove book from the series list')
        delete_button.setIcon(get_icon('trash.png'))
        delete_button.clicked.connect(self.remove_book)
        table_button_layout.addWidget(delete_button)
        spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        table_button_layout.addItem(spacerItem3)
        move_left_button = QtGui.QToolButton(self)
        move_left_button.setToolTip(
            'Move series index to left of decimal point (Alt+Left)')
        move_left_button.setIcon(get_icon('back.png'))
        move_left_button.setShortcut(_('Alt+Left'))
        move_left_button.clicked.connect(partial(self.series_indent_change,
                                                 -1))
        table_button_layout.addWidget(move_left_button)
        move_right_button = QtGui.QToolButton(self)
        move_right_button.setToolTip(
            'Move series index to right of decimal point (Alt+Right)')
        move_right_button.setIcon(get_icon('forward.png'))
        move_right_button.setShortcut(_('Alt+Right'))
        move_right_button.clicked.connect(partial(self.series_indent_change,
                                                  1))
        table_button_layout.addWidget(move_right_button)

        # Dialog buttons
        button_box = QDialogButtonBox(QDialogButtonBox.Ok
                                      | QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.accept)
        button_box.rejected.connect(self.reject)
        layout.addWidget(button_box)
        keep_button = button_box.addButton(' &Restore Original Series ',
                                           QDialogButtonBox.ResetRole)
        keep_button.clicked.connect(self.restore_original_series)
Exemplo n.º 29
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(788, 663)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.tabWidget = QtWidgets.QTabWidget(Form)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.tab)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.clear_history_button = QtWidgets.QPushButton(self.tab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.clear_history_button.sizePolicy().hasHeightForWidth())
        self.clear_history_button.setSizePolicy(sizePolicy)
        self.clear_history_button.setObjectName("clear_history_button")
        self.gridLayout_6.addWidget(self.clear_history_button, 6, 0, 1, 1)
        self.groupBox = QtWidgets.QGroupBox(self.tab)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setWordWrap(True)
        self.label.setObjectName("label")
        self.gridLayout_2.addWidget(self.label, 0, 0, 1, 2)
        self.opt_limit_search_columns = QtWidgets.QCheckBox(self.groupBox)
        self.opt_limit_search_columns.setObjectName("opt_limit_search_columns")
        self.gridLayout_2.addWidget(self.opt_limit_search_columns, 1, 0, 1, 2)
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.gridLayout_2.addWidget(self.label_2, 2, 0, 1, 1)
        self.opt_limit_search_columns_to = EditWithComplete(self.groupBox)
        self.opt_limit_search_columns_to.setObjectName(
            "opt_limit_search_columns_to")
        self.gridLayout_2.addWidget(self.opt_limit_search_columns_to, 2, 1, 1,
                                    1)
        self.label_3 = QtWidgets.QLabel(self.groupBox)
        self.label_3.setWordWrap(True)
        self.label_3.setObjectName("label_3")
        self.gridLayout_2.addWidget(self.label_3, 5, 0, 1, 2)
        self.gridLayout_6.addWidget(self.groupBox, 5, 0, 1, 2)
        self.opt_search_as_you_type = QtWidgets.QCheckBox(self.tab)
        self.opt_search_as_you_type.setObjectName("opt_search_as_you_type")
        self.gridLayout_6.addWidget(self.opt_search_as_you_type, 0, 0, 1, 2)
        self.opt_case_sensitive = QtWidgets.QCheckBox(self.tab)
        self.opt_case_sensitive.setObjectName("opt_case_sensitive")
        self.gridLayout_6.addWidget(self.opt_case_sensitive, 3, 0, 1, 1)
        self.opt_highlight_search_matches = QtWidgets.QCheckBox(self.tab)
        self.opt_highlight_search_matches.setObjectName(
            "opt_highlight_search_matches")
        self.gridLayout_6.addWidget(self.opt_highlight_search_matches, 1, 0, 1,
                                    2)
        self.opt_show_highlight_toggle_button = QtWidgets.QCheckBox(self.tab)
        self.opt_show_highlight_toggle_button.setObjectName(
            "opt_show_highlight_toggle_button")
        self.gridLayout_6.addWidget(self.opt_show_highlight_toggle_button, 2,
                                    0, 1, 2)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_6.addItem(spacerItem, 7, 0, 1, 1)
        self.opt_use_primary_find_in_search = QtWidgets.QCheckBox(self.tab)
        self.opt_use_primary_find_in_search.setObjectName(
            "opt_use_primary_find_in_search")
        self.gridLayout_6.addWidget(self.opt_use_primary_find_in_search, 4, 0,
                                    1, 1)
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_2)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.groupBox_2 = QtWidgets.QGroupBox(self.tab_2)
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.l12 = QtWidgets.QGridLayout()
        self.l12.setObjectName("l12")
        self.la10 = QtWidgets.QLabel(self.groupBox_2)
        self.la10.setObjectName("la10")
        self.l12.addWidget(self.la10, 0, 0, 1, 1)
        self.gst_names = QtWidgets.QComboBox(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.gst_names.sizePolicy().hasHeightForWidth())
        self.gst_names.setSizePolicy(sizePolicy)
        self.gst_names.setEditable(True)
        self.gst_names.setMinimumContentsLength(10)
        self.gst_names.setObjectName("gst_names")
        self.l12.addWidget(self.gst_names, 0, 1, 1, 1)
        self.gst_delete_button = QtWidgets.QToolButton(self.groupBox_2)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(I("trash.png")), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.gst_delete_button.setIcon(icon)
        self.gst_delete_button.setObjectName("gst_delete_button")
        self.l12.addWidget(self.gst_delete_button, 0, 2, 1, 1)
        self.la112 = QtWidgets.QLabel(self.groupBox_2)
        self.la112.setObjectName("la112")
        self.l12.addWidget(self.la112, 1, 0, 1, 1)
        self.gst_value = EditWithComplete(self.groupBox_2)
        self.gst_value.setObjectName("gst_value")
        self.l12.addWidget(self.gst_value, 1, 1, 1, 1)
        self.hboxlayout = QtWidgets.QHBoxLayout()
        self.hboxlayout.setObjectName("hboxlayout")
        self.gst_save_button = QtWidgets.QToolButton(self.groupBox_2)
        self.gst_save_button.setObjectName("gst_save_button")
        self.hboxlayout.addWidget(self.gst_save_button)
        self.l12.addLayout(self.hboxlayout, 2, 0, 1, 3)
        self.gridLayout_3.addLayout(self.l12, 0, 0, 1, 1)
        self.gst_explanation = QtWidgets.QTextBrowser(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(100)
        sizePolicy.setHeightForWidth(
            self.gst_explanation.sizePolicy().hasHeightForWidth())
        self.gst_explanation.setSizePolicy(sizePolicy)
        self.gst_explanation.setObjectName("gst_explanation")
        self.gridLayout_3.addWidget(self.gst_explanation, 0, 1, 3, 1)
        self.user_category_layout = QtWidgets.QHBoxLayout()
        self.user_category_layout.setObjectName("user_category_layout")
        self.l11 = QtWidgets.QLabel(self.groupBox_2)
        self.l11.setObjectName("l11")
        self.user_category_layout.addWidget(self.l11)
        self.opt_grouped_search_make_user_categories = EditWithComplete(
            self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.opt_grouped_search_make_user_categories.sizePolicy(
            ).hasHeightForWidth())
        self.opt_grouped_search_make_user_categories.setSizePolicy(sizePolicy)
        self.opt_grouped_search_make_user_categories.setObjectName(
            "opt_grouped_search_make_user_categories")
        self.user_category_layout.addWidget(
            self.opt_grouped_search_make_user_categories)
        self.gridLayout_3.addLayout(self.user_category_layout, 1, 0, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_3.addItem(spacerItem1, 2, 0, 1, 1)
        self.gridLayout_4.addWidget(self.groupBox_2, 0, 0, 1, 1)
        self.tabWidget.addTab(self.tab_2, "")
        self.tab_3 = QtWidgets.QWidget()
        self.tab_3.setObjectName("tab_3")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_3)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.groupBox22 = QtWidgets.QGroupBox(self.tab_3)
        self.groupBox22.setObjectName("groupBox22")
        self.gridLayout_22 = QtWidgets.QGridLayout(self.groupBox22)
        self.gridLayout_22.setObjectName("gridLayout_22")
        self.label1 = QtWidgets.QLabel(self.groupBox22)
        self.label1.setWordWrap(True)
        self.label1.setObjectName("label1")
        self.gridLayout_22.addWidget(self.label1, 0, 0, 1, 6)
        self.label_221 = QtWidgets.QLabel(self.groupBox22)
        self.label_221.setObjectName("label_221")
        self.gridLayout_22.addWidget(self.label_221, 1, 0, 1, 1)
        self.similar_authors_search_key = QtWidgets.QComboBox(self.groupBox22)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(10)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.similar_authors_search_key.sizePolicy().hasHeightForWidth())
        self.similar_authors_search_key.setSizePolicy(sizePolicy)
        self.similar_authors_search_key.setObjectName(
            "similar_authors_search_key")
        self.gridLayout_22.addWidget(self.similar_authors_search_key, 1, 1, 1,
                                     1)
        self.opt_similar_authors_match_kind = QtWidgets.QComboBox(
            self.groupBox22)
        self.opt_similar_authors_match_kind.setObjectName(
            "opt_similar_authors_match_kind")
        self.gridLayout_22.addWidget(self.opt_similar_authors_match_kind, 1, 2,
                                     1, 1)
        self.label_222 = QtWidgets.QLabel(self.groupBox22)
        self.label_222.setObjectName("label_222")
        self.gridLayout_22.addWidget(self.label_222, 1, 3, 1, 1)
        self.similar_series_search_key = QtWidgets.QComboBox(self.groupBox22)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(10)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.similar_series_search_key.sizePolicy().hasHeightForWidth())
        self.similar_series_search_key.setSizePolicy(sizePolicy)
        self.similar_series_search_key.setObjectName(
            "similar_series_search_key")
        self.gridLayout_22.addWidget(self.similar_series_search_key, 1, 4, 1,
                                     1)
        self.opt_similar_series_match_kind = QtWidgets.QComboBox(
            self.groupBox22)
        self.opt_similar_series_match_kind.setObjectName(
            "opt_similar_series_match_kind")
        self.gridLayout_22.addWidget(self.opt_similar_series_match_kind, 1, 5,
                                     1, 1)
        self.label_223 = QtWidgets.QLabel(self.groupBox22)
        self.label_223.setObjectName("label_223")
        self.gridLayout_22.addWidget(self.label_223, 2, 0, 1, 1)
        self.similar_tags_search_key = QtWidgets.QComboBox(self.groupBox22)
        self.similar_tags_search_key.setObjectName("similar_tags_search_key")
        self.gridLayout_22.addWidget(self.similar_tags_search_key, 2, 1, 1, 1)
        self.opt_similar_tags_match_kind = QtWidgets.QComboBox(self.groupBox22)
        self.opt_similar_tags_match_kind.setObjectName(
            "opt_similar_tags_match_kind")
        self.gridLayout_22.addWidget(self.opt_similar_tags_match_kind, 2, 2, 1,
                                     1)
        self.label_224 = QtWidgets.QLabel(self.groupBox22)
        self.label_224.setObjectName("label_224")
        self.gridLayout_22.addWidget(self.label_224, 2, 3, 1, 1)
        self.similar_publisher_search_key = QtWidgets.QComboBox(
            self.groupBox22)
        self.similar_publisher_search_key.setObjectName(
            "similar_publisher_search_key")
        self.gridLayout_22.addWidget(self.similar_publisher_search_key, 2, 4,
                                     1, 1)
        self.opt_similar_publisher_match_kind = QtWidgets.QComboBox(
            self.groupBox22)
        self.opt_similar_publisher_match_kind.setObjectName(
            "opt_similar_publisher_match_kind")
        self.gridLayout_22.addWidget(self.opt_similar_publisher_match_kind, 2,
                                     5, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_22.addItem(spacerItem2, 3, 1, 1, 1)
        self.gridLayout_5.addWidget(self.groupBox22, 0, 0, 1, 1)
        self.tabWidget.addTab(self.tab_3, "")
        self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
        self.label_2.setBuddy(self.opt_limit_search_columns_to)
        self.la10.setBuddy(self.gst_names)
        self.la112.setBuddy(self.gst_value)
        self.l11.setBuddy(self.opt_grouped_search_make_user_categories)
        self.label_221.setBuddy(self.similar_authors_search_key)
        self.label_222.setBuddy(self.similar_series_search_key)
        self.label_223.setBuddy(self.similar_tags_search_key)
        self.label_224.setBuddy(self.similar_publisher_search_key)

        self.retranslateUi(Form)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(Form)
Exemplo n.º 30
0
 def createEditor(self, parent, option, index):
     self.ed = EditWithComplete(parent)
     self.ed.setFocusPolicy(Qt.StrongFocus)
     init_line_edit(self.ed, self.all_authors)
     return self.ed