示例#1
0
    def __init__(self, parent):
        ImageView.__init__(self, parent)
        self.show_size = True
        self.dialog = parent
        self._cdata = None
        self.cover_changed.connect(self.set_pixmap_from_data)

        self.select_cover_button = QPushButton(QIcon(I('document_open.png')),
                _('&Browse'), parent)
        self.trim_cover_button = QPushButton(QIcon(I('trim.png')),
                _('T&rim'), parent)
        self.remove_cover_button = QPushButton(QIcon(I('trash.png')),
            _('&Remove'), parent)

        self.select_cover_button.clicked.connect(self.select_cover)
        self.remove_cover_button.clicked.connect(self.remove_cover)
        self.trim_cover_button.clicked.connect(self.trim_cover)

        self.download_cover_button = QPushButton(_('Download co&ver'), parent)
        self.generate_cover_button = QPushButton(_('&Generate cover'), parent)

        self.download_cover_button.clicked.connect(self.download_cover)
        self.generate_cover_button.clicked.connect(self.generate_cover)

        self.buttons = [self.select_cover_button, self.remove_cover_button,
                self.trim_cover_button, self.download_cover_button,
                self.generate_cover_button]

        self.frame_size = (300, 400)
        self.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,
            QSizePolicy.Preferred))
示例#2
0
    def __init__(self, parent):
        ImageView.__init__(self, parent)
        self.dialog = parent
        self._cdata = None
        self.cover_changed.connect(self.set_pixmap_from_data)

        self.select_cover_button = QPushButton(QIcon(I('document_open.png')),
                                               _('&Browse'), parent)
        self.trim_cover_button = QPushButton(QIcon(I('trim.png')), _('T&rim'),
                                             parent)
        self.remove_cover_button = QPushButton(QIcon(I('trash.png')),
                                               _('&Remove'), parent)

        self.select_cover_button.clicked.connect(self.select_cover)
        self.remove_cover_button.clicked.connect(self.remove_cover)
        self.trim_cover_button.clicked.connect(self.trim_cover)

        self.download_cover_button = QPushButton(_('Download co&ver'), parent)
        self.generate_cover_button = QPushButton(_('&Generate cover'), parent)

        self.download_cover_button.clicked.connect(self.download_cover)
        self.generate_cover_button.clicked.connect(self.generate_cover)

        self.buttons = [
            self.select_cover_button, self.remove_cover_button,
            self.trim_cover_button, self.download_cover_button,
            self.generate_cover_button
        ]

        self.frame_size = (300, 400)
        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred))
示例#3
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)
示例#4
0
class Ui_Form(object):
    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 retranslateUi(self, Form):

        Form.setWindowTitle(_("Form"))
        self.groupBox_4.setTitle(_("Book cover"))
        self.label_5.setText(_("Change &cover image:"))
        self.cover_button.setToolTip(
            _("Browse for an image to use as the cover of this book."))
        self.cover_button.setText(_("..."))
        self.opt_prefer_metadata_cover.setText(
            _("Use cover from &source file"))
        self.label.setText(_("&Title:"))
        self.title.setToolTip(_("Change the title of this book"))
        self.label_2.setText(_("&Author(s):"))
        self.label_6.setText(_("Author so&rt:"))
        self.author_sort.setToolTip(
            _("Change the author(s) of this book. Multiple authors should be separated by a comma"
              ))
        self.label_3.setText(_("&Publisher:"))
        self.label_4.setText(_("Ta&gs:"))
        self.tags.setToolTip(
            _("Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas."
              ))
        self.label_7.setText(_("&Series:"))
        self.series.setToolTip(
            _("List of known series. You can add new series."))
        self.series.setWhatsThis(
            _("List of known series. You can add new series."))
        self.series_index.setPrefix(_("Book "))
示例#5
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(600, 500)
        Form.setWindowTitle(_("Form"))
        self.horizontalLayout = QtGui.QHBoxLayout(Form)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setTitle(_("Book Cover"))
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self._2 = QtGui.QGridLayout(self.groupBox_4)
        self._2.setObjectName(_fromUtf8("_2"))
        self._4 = QtGui.QVBoxLayout()
        self._4.setSpacing(6)
        self._4.setMargin(0)
        self._4.setObjectName(_fromUtf8("_4"))
        self.label_5 = QtGui.QLabel(self.groupBox_4)
        self.label_5.setText(_("Change &cover image:"))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self._4.addWidget(self.label_5)
        self._5 = QtGui.QHBoxLayout()
        self._5.setSpacing(6)
        self._5.setMargin(0)
        self._5.setObjectName(_fromUtf8("_5"))
        self.cover_path = QtGui.QLineEdit(self.groupBox_4)
        self.cover_path.setReadOnly(True)
        self.cover_path.setObjectName(_fromUtf8("cover_path"))
        self._5.addWidget(self.cover_path)
        self.cover_button = QtGui.QToolButton(self.groupBox_4)
        self.cover_button.setToolTip(_("Browse for an image to use as the cover of this book."))
        self.cover_button.setText(_("..."))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("document_open.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.cover_button.setIcon(icon)
        self.cover_button.setObjectName(_fromUtf8("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 = QtGui.QCheckBox(self.groupBox_4)
        self.opt_prefer_metadata_cover.setText(_("Use cover from &source file"))
        self.opt_prefer_metadata_cover.setChecked(True)
        self.opt_prefer_metadata_cover.setObjectName(_fromUtf8("opt_prefer_metadata_cover"))
        self._2.addWidget(self.opt_prefer_metadata_cover, 2, 0, 1, 1)
        self._3 = QtGui.QHBoxLayout()
        self._3.setObjectName(_fromUtf8("_3"))
        self.cover = ImageView(self.groupBox_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cover.sizePolicy().hasHeightForWidth())
        self.cover.setSizePolicy(sizePolicy)
        self.cover.setObjectName(_fromUtf8("cover"))
        self._3.addWidget(self.cover)
        self._2.addLayout(self._3, 0, 0, 1, 1)
        self.horizontalLayout.addWidget(self.groupBox_4)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self._7 = QtGui.QGridLayout()
        self._7.setObjectName(_fromUtf8("_7"))
        self.label = QtGui.QLabel(Form)
        self.label.setText(_("&Title: "))
        self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self._7.addWidget(self.label, 0, 0, 1, 1)
        self.title = EnLineEdit(Form)
        self.title.setToolTip(_("Change the title of this book"))
        self.title.setObjectName(_fromUtf8("title"))
        self._7.addWidget(self.title, 0, 1, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setText(_("&Author(s): "))
        self.label_2.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self._7.addWidget(self.label_2, 1, 0, 1, 1)
        self.label_6 = QtGui.QLabel(Form)
        self.label_6.setText(_("Author So&rt:"))
        self.label_6.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self._7.addWidget(self.label_6, 2, 0, 1, 1)
        self.author_sort = EnLineEdit(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.author_sort.sizePolicy().hasHeightForWidth())
        self.author_sort.setSizePolicy(sizePolicy)
        self.author_sort.setToolTip(
            _("Change the author(s) of this book. Multiple authors should be separated by a comma")
        )
        self.author_sort.setObjectName(_fromUtf8("author_sort"))
        self._7.addWidget(self.author_sort, 2, 1, 1, 1)
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setText(_("&Publisher: "))
        self.label_3.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self._7.addWidget(self.label_3, 3, 0, 1, 1)
        self.label_4 = QtGui.QLabel(Form)
        self.label_4.setText(_("Ta&gs: "))
        self.label_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self._7.addWidget(self.label_4, 4, 0, 1, 1)
        self.tags = EditWithComplete(Form)
        self.tags.setToolTip(
            _(
                "Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas."
            )
        )
        self.tags.setObjectName(_fromUtf8("tags"))
        self._7.addWidget(self.tags, 4, 1, 1, 1)
        self.label_7 = QtGui.QLabel(Form)
        self.label_7.setText(_("&Series:"))
        self.label_7.setTextFormat(QtCore.Qt.PlainText)
        self.label_7.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self._7.addWidget(self.label_7, 5, 0, 1, 1)
        self.series = EditWithComplete(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(10)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.series.sizePolicy().hasHeightForWidth())
        self.series.setSizePolicy(sizePolicy)
        self.series.setToolTip(_("List of known series. You can add new series."))
        self.series.setWhatsThis(_("List of known series. You can add new series."))
        self.series.setEditable(True)
        self.series.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically)
        self.series.setObjectName(_fromUtf8("series"))
        self._7.addWidget(self.series, 5, 1, 1, 1)
        self.series_index = QtGui.QDoubleSpinBox(Form)
        self.series_index.setPrefix(_("Book "))
        self.series_index.setMaximum(9999999999.99)
        self.series_index.setProperty("value", 1.0)
        self.series_index.setObjectName(_fromUtf8("series_index"))
        self._7.addWidget(self.series_index, 6, 1, 1, 1)
        self.publisher = EditWithComplete(Form)
        self.publisher.setEditable(True)
        self.publisher.setObjectName(_fromUtf8("publisher"))
        self._7.addWidget(self.publisher, 3, 1, 1, 1)
        self.author = EditWithComplete(Form)
        self.author.setEditable(True)
        self.author.setObjectName(_fromUtf8("author"))
        self._7.addWidget(self.author, 1, 1, 1, 1)
        self.verticalLayout_2.addLayout(self._7)
        self.comment = Editor(Form)
        self.comment.setObjectName(_fromUtf8("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)
示例#6
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(600, 500)
        self.horizontalLayout = QtGui.QHBoxLayout(Form)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self._2 = QtGui.QGridLayout(self.groupBox_4)
        self._2.setObjectName(_fromUtf8("_2"))
        self._4 = QtGui.QVBoxLayout()
        self._4.setSpacing(6)
        self._4.setMargin(0)
        self._4.setObjectName(_fromUtf8("_4"))
        self.label_5 = QtGui.QLabel(self.groupBox_4)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self._4.addWidget(self.label_5)
        self._5 = QtGui.QHBoxLayout()
        self._5.setSpacing(6)
        self._5.setMargin(0)
        self._5.setObjectName(_fromUtf8("_5"))
        self.cover_path = QtGui.QLineEdit(self.groupBox_4)
        self.cover_path.setReadOnly(True)
        self.cover_path.setObjectName(_fromUtf8("cover_path"))
        self._5.addWidget(self.cover_path)
        self.cover_button = QtGui.QToolButton(self.groupBox_4)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("document_open.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.cover_button.setIcon(icon)
        self.cover_button.setObjectName(_fromUtf8("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 = QtGui.QCheckBox(self.groupBox_4)
        self.opt_prefer_metadata_cover.setChecked(True)
        self.opt_prefer_metadata_cover.setObjectName(_fromUtf8("opt_prefer_metadata_cover"))
        self._2.addWidget(self.opt_prefer_metadata_cover, 2, 0, 1, 1)
        self._3 = QtGui.QHBoxLayout()
        self._3.setObjectName(_fromUtf8("_3"))
        self.cover = ImageView(self.groupBox_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cover.sizePolicy().hasHeightForWidth())
        self.cover.setSizePolicy(sizePolicy)
        self.cover.setObjectName(_fromUtf8("cover"))
        self._3.addWidget(self.cover)
        self._2.addLayout(self._3, 0, 0, 1, 1)
        self.horizontalLayout.addWidget(self.groupBox_4)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self._7 = QtGui.QGridLayout()
        self._7.setObjectName(_fromUtf8("_7"))
        self.label = QtGui.QLabel(Form)
        self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self._7.addWidget(self.label, 0, 0, 1, 1)
        self.title = EnLineEdit(Form)
        self.title.setObjectName(_fromUtf8("title"))
        self._7.addWidget(self.title, 0, 1, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self._7.addWidget(self.label_2, 1, 0, 1, 1)
        self.label_6 = QtGui.QLabel(Form)
        self.label_6.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self._7.addWidget(self.label_6, 2, 0, 1, 1)
        self.author_sort = EnLineEdit(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.author_sort.sizePolicy().hasHeightForWidth())
        self.author_sort.setSizePolicy(sizePolicy)
        self.author_sort.setObjectName(_fromUtf8("author_sort"))
        self._7.addWidget(self.author_sort, 2, 1, 1, 1)
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self._7.addWidget(self.label_3, 3, 0, 1, 1)
        self.label_4 = QtGui.QLabel(Form)
        self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self._7.addWidget(self.label_4, 4, 0, 1, 1)
        self.tags = EditWithComplete(Form)
        self.tags.setObjectName(_fromUtf8("tags"))
        self._7.addWidget(self.tags, 4, 1, 1, 1)
        self.label_7 = QtGui.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(_fromUtf8("label_7"))
        self._7.addWidget(self.label_7, 5, 0, 1, 1)
        self.series = EditWithComplete(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.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(QtGui.QComboBox.InsertAlphabetically)
        self.series.setObjectName(_fromUtf8("series"))
        self._7.addWidget(self.series, 5, 1, 1, 1)
        self.series_index = QtGui.QDoubleSpinBox(Form)
        self.series_index.setMaximum(9999999999.99)
        self.series_index.setProperty("value", 1.0)
        self.series_index.setObjectName(_fromUtf8("series_index"))
        self._7.addWidget(self.series_index, 6, 1, 1, 1)
        self.publisher = EditWithComplete(Form)
        self.publisher.setEditable(True)
        self.publisher.setObjectName(_fromUtf8("publisher"))
        self._7.addWidget(self.publisher, 3, 1, 1, 1)
        self.author = EditWithComplete(Form)
        self.author.setEditable(True)
        self.author.setObjectName(_fromUtf8("author"))
        self._7.addWidget(self.author, 1, 1, 1, 1)
        self.verticalLayout_2.addLayout(self._7)
        self.comment = Editor(Form)
        self.comment.setObjectName(_fromUtf8("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)