本文整理汇总了Python中calibre.gui2.widgets.HistoryLineEdit类的典型用法代码示例。如果您正苦于以下问题:Python HistoryLineEdit类的具体用法?Python HistoryLineEdit怎么用?Python HistoryLineEdit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HistoryLineEdit类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keyPressEvent
def keyPressEvent(self, event):
k = event.key()
if k not in (Qt.Key_Up, Qt.Key_Down):
return HistoryLineEdit.keyPressEvent(self, event)
self.blockSignals(True)
if k == Qt.Key_Down and self.currentIndex() == 0 and not self.lineEdit().text():
self.setCurrentIndex(1), self.setCurrentIndex(0)
event.accept()
else:
HistoryLineEdit.keyPressEvent(self, event)
self.blockSignals(False)
示例2: setupUi
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(691, 614)
Dialog.setWindowTitle(_("Dialog"))
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label = QtGui.QLabel(Dialog)
self.label.setText(_("&Query:"))
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout_2.addWidget(self.label)
self.adv_search_button = QtGui.QToolButton(Dialog)
self.adv_search_button.setText(_("..."))
self.adv_search_button.setObjectName(_fromUtf8("adv_search_button"))
self.horizontalLayout_2.addWidget(self.adv_search_button)
self.search_query = HistoryLineEdit(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_query.sizePolicy().hasHeightForWidth())
self.search_query.setSizePolicy(sizePolicy)
self.search_query.setObjectName(_fromUtf8("search_query"))
self.horizontalLayout_2.addWidget(self.search_query)
self.search_button = QtGui.QPushButton(Dialog)
self.search_button.setText(_("Search"))
self.search_button.setObjectName(_fromUtf8("search_button"))
self.horizontalLayout_2.addWidget(self.search_button)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.results_view = QtGui.QTreeView(Dialog)
self.results_view.setAlternatingRowColors(True)
self.results_view.setRootIsDecorated(False)
self.results_view.setItemsExpandable(False)
self.results_view.setSortingEnabled(True)
self.results_view.setExpandsOnDoubleClick(False)
self.results_view.setObjectName(_fromUtf8("results_view"))
self.results_view.header().setCascadingSectionResizes(False)
self.verticalLayout.addWidget(self.results_view)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setText(_("Books:"))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout.addWidget(self.label_2)
self.total = QtGui.QLabel(Dialog)
self.total.setText(_("0"))
self.total.setObjectName(_fromUtf8("total"))
self.horizontalLayout.addWidget(self.total)
spacerItem = QtGui.QSpacerItem(308, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.close_button = QtGui.QPushButton(Dialog)
self.close_button.setText(_("Close"))
self.close_button.setObjectName(_fromUtf8("close_button"))
self.horizontalLayout.addWidget(self.close_button)
self.verticalLayout.addLayout(self.horizontalLayout)
self.label.setBuddy(self.search_query)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.close_button, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.accept)
QtCore.QMetaObject.connectSlotsByName(Dialog)
示例3: setupUi
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(430, 74)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.msg = QtGui.QLabel(Form)
self.msg.setWordWrap(True)
self.msg.setObjectName(_fromUtf8("msg"))
self.verticalLayout.addWidget(self.msg)
self.edit = HistoryLineEdit(Form)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(100)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.edit.sizePolicy().hasHeightForWidth())
self.edit.setSizePolicy(sizePolicy)
self.edit.setMinimumSize(QtCore.QSize(350, 0))
self.edit.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon)
self.edit.setMinimumContentsLength(30)
self.edit.setObjectName(_fromUtf8("edit"))
self.verticalLayout.addWidget(self.edit)
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
self.button = QtGui.QToolButton(Form)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("wizard.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.button.setIcon(icon)
self.button.setIconSize(QtCore.QSize(40, 40))
self.button.setObjectName(_fromUtf8("button"))
self.gridLayout.addWidget(self.button, 0, 1, 1, 1)
self.msg.setBuddy(self.edit)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例4: setupUi
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(602, 245)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("lt.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Dialog.setWindowIcon(icon)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.old_location = QtGui.QLabel(Dialog)
self.old_location.setWordWrap(True)
self.old_location.setObjectName(_fromUtf8("old_location"))
self.gridLayout.addWidget(self.old_location, 0, 0, 1, 4)
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.existing_library = QtGui.QRadioButton(Dialog)
self.existing_library.setChecked(True)
self.existing_library.setObjectName(_fromUtf8("existing_library"))
self.gridLayout.addWidget(self.existing_library, 4, 0, 1, 4)
self.hbox1 = QtGui.QHBoxLayout()
self.hbox1.setObjectName(_fromUtf8("hbox1"))
self.empty_library = QtGui.QRadioButton(Dialog)
self.empty_library.setObjectName(_fromUtf8("empty_library"))
self.hbox1.addWidget(self.empty_library)
self.copy_structure = QtGui.QCheckBox(Dialog)
self.copy_structure.setObjectName(_fromUtf8("copy_structure"))
self.hbox1.addWidget(self.copy_structure)
self.gridLayout.addLayout(self.hbox1, 5, 0, 1, 3)
self.move_library = QtGui.QRadioButton(Dialog)
self.move_library.setObjectName(_fromUtf8("move_library"))
self.gridLayout.addWidget(self.move_library, 6, 0, 1, 3)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridLayout.addWidget(self.buttonBox, 8, 2, 1, 1)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem, 7, 2, 1, 1)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem1, 3, 0, 1, 1)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem2, 1, 0, 1, 1)
self.browse_button = QtGui.QToolButton(Dialog)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("document_open.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.browse_button.setIcon(icon1)
self.browse_button.setObjectName(_fromUtf8("browse_button"))
self.gridLayout.addWidget(self.browse_button, 2, 3, 1, 1)
self.location = HistoryLineEdit(Dialog)
self.location.setObjectName(_fromUtf8("location"))
self.gridLayout.addWidget(self.location, 2, 1, 1, 2)
self.label_2.setBuddy(self.location)
self.retranslateUi(Dialog)
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)
示例5: setupUi
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(610, 553)
self.verticalLayout = QtGui.QVBoxLayout(Form)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout.addWidget(self.label)
self.adv_search_builder = QtGui.QToolButton(Form)
self.adv_search_builder.setObjectName(_fromUtf8("adv_search_builder"))
self.horizontalLayout.addWidget(self.adv_search_builder)
self.query = HistoryLineEdit(Form)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.query.sizePolicy().hasHeightForWidth())
self.query.setSizePolicy(sizePolicy)
self.query.setObjectName(_fromUtf8("query"))
self.horizontalLayout.addWidget(self.query)
self.search = QtGui.QPushButton(Form)
self.search.setObjectName(_fromUtf8("search"))
self.horizontalLayout.addWidget(self.search)
self.verticalLayout.addLayout(self.horizontalLayout)
self.results_view = ResultsView(Form)
self.results_view.setAlternatingRowColors(True)
self.results_view.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.results_view.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.results_view.setRootIsDecorated(False)
self.results_view.setUniformRowHeights(True)
self.results_view.setItemsExpandable(False)
self.results_view.setSortingEnabled(True)
self.results_view.setExpandsOnDoubleClick(False)
self.results_view.setObjectName(_fromUtf8("results_view"))
self.results_view.header().setStretchLastSection(False)
self.verticalLayout.addWidget(self.results_view)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label_2 = QtGui.QLabel(Form)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout_2.addWidget(self.label_2)
self.enable_all = QtGui.QPushButton(Form)
self.enable_all.setObjectName(_fromUtf8("enable_all"))
self.horizontalLayout_2.addWidget(self.enable_all)
self.enable_none = QtGui.QPushButton(Form)
self.enable_none.setObjectName(_fromUtf8("enable_none"))
self.horizontalLayout_2.addWidget(self.enable_none)
self.enable_invert = QtGui.QPushButton(Form)
self.enable_invert.setObjectName(_fromUtf8("enable_invert"))
self.horizontalLayout_2.addWidget(self.enable_invert)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例6: setupUi
def setupUi(self, TagListEditor):
TagListEditor.setObjectName(_fromUtf8("TagListEditor"))
TagListEditor.resize(397, 335)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("chapters.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
TagListEditor.setWindowIcon(icon)
self.gridlayout = QtGui.QGridLayout(TagListEditor)
self.gridlayout.setObjectName(_fromUtf8("gridlayout"))
self.horizontalLayout_11 = QtGui.QHBoxLayout()
self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11"))
self.search_box = HistoryLineEdit(TagListEditor)
self.search_box.setObjectName(_fromUtf8("search_box"))
self.horizontalLayout_11.addWidget(self.search_box)
self.search_button = QtGui.QToolButton(TagListEditor)
self.search_button.setObjectName(_fromUtf8("search_button"))
self.horizontalLayout_11.addWidget(self.search_button)
self.gridlayout.addLayout(self.horizontalLayout_11, 0, 1, 1, 1)
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.delete_button = QtGui.QToolButton(TagListEditor)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("trash.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.delete_button.setIcon(icon1)
self.delete_button.setIconSize(QtCore.QSize(32, 32))
self.delete_button.setObjectName(_fromUtf8("delete_button"))
self.verticalLayout_2.addWidget(self.delete_button)
self.rename_button = QtGui.QToolButton(TagListEditor)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(_fromUtf8(I("edit_input.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.rename_button.setIcon(icon2)
self.rename_button.setIconSize(QtCore.QSize(32, 32))
self.rename_button.setObjectName(_fromUtf8("rename_button"))
self.verticalLayout_2.addWidget(self.rename_button)
self.gridlayout.addLayout(self.verticalLayout_2, 1, 0, 1, 1)
self.table = QtGui.QTableWidget(TagListEditor)
self.table.setAlternatingRowColors(True)
self.table.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.table.setObjectName(_fromUtf8("table"))
self.table.setColumnCount(0)
self.table.setRowCount(0)
self.gridlayout.addWidget(self.table, 1, 1, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(TagListEditor)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(True)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridlayout.addWidget(self.buttonBox, 3, 0, 1, 2)
self.retranslateUi(TagListEditor)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), TagListEditor.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), TagListEditor.reject)
QtCore.QMetaObject.connectSlotsByName(TagListEditor)
示例7: setupUi
def setupUi(self, EditAuthorsDialog):
EditAuthorsDialog.setObjectName(_fromUtf8("EditAuthorsDialog"))
EditAuthorsDialog.resize(768, 342)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(EditAuthorsDialog.sizePolicy().hasHeightForWidth())
EditAuthorsDialog.setSizePolicy(sizePolicy)
EditAuthorsDialog.setWindowTitle(_("Manage authors"))
self.verticalLayout = QtGui.QVBoxLayout(EditAuthorsDialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName(_fromUtf8("hboxlayout"))
self.label = QtGui.QLabel(EditAuthorsDialog)
self.label.setText(_("&Search for:"))
self.label.setObjectName(_fromUtf8("label"))
self.hboxlayout.addWidget(self.label)
self.find_box = HistoryLineEdit(EditAuthorsDialog)
self.find_box.setMinimumSize(QtCore.QSize(200, 0))
self.find_box.setObjectName(_fromUtf8("find_box"))
self.hboxlayout.addWidget(self.find_box)
self.find_button = QtGui.QPushButton(EditAuthorsDialog)
self.find_button.setText(_("F&ind"))
self.find_button.setObjectName(_fromUtf8("find_button"))
self.hboxlayout.addWidget(self.find_button)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.hboxlayout.addItem(spacerItem)
self.verticalLayout.addLayout(self.hboxlayout)
self.table = QtGui.QTableWidget(EditAuthorsDialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.table.sizePolicy().hasHeightForWidth())
self.table.setSizePolicy(sizePolicy)
self.table.setColumnCount(0)
self.table.setObjectName(_fromUtf8("table"))
self.table.setRowCount(0)
self.verticalLayout.addWidget(self.table)
self.gridlayout = QtGui.QGridLayout()
self.gridlayout.setObjectName(_fromUtf8("gridlayout"))
self.sort_by_author = QtGui.QPushButton(EditAuthorsDialog)
self.sort_by_author.setText(_("Sort by author"))
self.sort_by_author.setObjectName(_fromUtf8("sort_by_author"))
self.gridlayout.addWidget(self.sort_by_author, 0, 0, 1, 1)
self.sort_by_author_sort = QtGui.QPushButton(EditAuthorsDialog)
self.sort_by_author_sort.setText(_("Sort by author sort"))
self.sort_by_author_sort.setObjectName(_fromUtf8("sort_by_author_sort"))
self.gridlayout.addWidget(self.sort_by_author_sort, 0, 1, 1, 1)
self.recalc_author_sort = QtGui.QPushButton(EditAuthorsDialog)
self.recalc_author_sort.setToolTip(_("Reset all the author sort values to a value automatically\n"
"generated from the author. Exactly how this value is automatically\n"
"generated can be controlled via Preferences->Advanced->Tweaks"))
self.recalc_author_sort.setText(_("Recalculate all author sort values"))
self.recalc_author_sort.setObjectName(_fromUtf8("recalc_author_sort"))
self.gridlayout.addWidget(self.recalc_author_sort, 1, 0, 1, 1)
self.auth_sort_to_author = QtGui.QPushButton(EditAuthorsDialog)
self.auth_sort_to_author.setToolTip(_("Copy author sort to author for every author. You typically use this button\n"
"after changing Preferences->Advanced->Tweaks->Author sort name algorithm"))
self.auth_sort_to_author.setText(_("Copy all author sort values to author"))
self.auth_sort_to_author.setObjectName(_fromUtf8("auth_sort_to_author"))
self.gridlayout.addWidget(self.auth_sort_to_author, 1, 1, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(EditAuthorsDialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
self.buttonBox.setSizePolicy(sizePolicy)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridlayout.addWidget(self.buttonBox, 1, 2, 1, 1)
self.verticalLayout.addLayout(self.gridlayout)
self.label.setBuddy(self.find_box)
self.retranslateUi(EditAuthorsDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), EditAuthorsDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), EditAuthorsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(EditAuthorsDialog)
示例8: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
self.parent = parent
self._layout = QVBoxLayout()
self.setLayout(self._layout)
self._layout.setContentsMargins(0,0,0,0)
# Set up the find box & button
search_layout = QHBoxLayout()
self._layout.addLayout(search_layout)
self.item_search = HistoryLineEdit(parent)
self.item_search.setMinimumContentsLength(5)
self.item_search.setSizeAdjustPolicy(self.item_search.AdjustToMinimumContentsLengthWithIcon)
try:
self.item_search.lineEdit().setPlaceholderText(
_('Find item in tag browser'))
except:
pass # Using Qt < 4.7
self.item_search.setToolTip(_(
'Search for items. This is a "contains" search; items containing the\n'
'text anywhere in the name will be found. You can limit the search\n'
'to particular categories using syntax similar to search. For example,\n'
'tags:foo will find foo in any tag, but not in authors etc. Entering\n'
'*foo will filter all categories at once, showing only those items\n'
'containing the text "foo"'))
search_layout.addWidget(self.item_search)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser find box',
_('Find item'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(self.set_focus_to_find_box)
self.search_button = QToolButton()
self.search_button.setText(_('Find'))
self.search_button.setToolTip(_('Find the first/next matching item'))
search_layout.addWidget(self.search_button)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser find button',
_('Find button'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(self.search_button.click)
self.expand_button = QToolButton()
self.expand_button.setText('-')
self.expand_button.setToolTip(_('Collapse all categories'))
search_layout.addWidget(self.expand_button)
search_layout.setStretch(0, 10)
search_layout.setStretch(1, 1)
search_layout.setStretch(2, 1)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser collapse all',
_('Collapse all'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(self.expand_button.clicked)
self.current_find_position = None
self.search_button.clicked.connect(self.find)
self.item_search.initialize('tag_browser_search')
self.item_search.lineEdit().returnPressed.connect(self.do_find)
self.item_search.lineEdit().textEdited.connect(self.find_text_changed)
self.item_search.activated[str].connect(self.do_find)
self.item_search.completer().setCaseSensitivity(Qt.CaseSensitive)
parent.tags_view = TagsView(parent)
self.tags_view = parent.tags_view
self.expand_button.clicked.connect(self.tags_view.collapseAll)
self._layout.addWidget(parent.tags_view)
# Now the floating 'not found' box
l = QLabel(self.tags_view)
self.not_found_label = l
l.setFrameStyle(QFrame.StyledPanel)
l.setAutoFillBackground(True)
l.setText('<p><b>'+_('No More Matches.</b><p> Click Find again to go to first match'))
l.setAlignment(Qt.AlignVCenter)
l.setWordWrap(True)
l.resize(l.sizeHint())
l.move(10,20)
l.setVisible(False)
self.not_found_label_timer = QTimer()
self.not_found_label_timer.setSingleShot(True)
self.not_found_label_timer.timeout.connect(self.not_found_label_timer_event,
type=Qt.QueuedConnection)
parent.alter_tb = l = QPushButton(parent)
l.setText(_('Alter Tag Browser'))
l.setIcon(QIcon(I('tags.png')))
l.m = QMenu()
l.setMenu(l.m)
self._layout.addWidget(l)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser alter',
_('Alter tag browser'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(l.showMenu)
#.........这里部分代码省略.........
示例9: TagBrowserWidget
class TagBrowserWidget(QWidget): # {{{
def __init__(self, parent):
QWidget.__init__(self, parent)
self.parent = parent
self._layout = QVBoxLayout()
self.setLayout(self._layout)
self._layout.setContentsMargins(0,0,0,0)
# Set up the find box & button
search_layout = QHBoxLayout()
self._layout.addLayout(search_layout)
self.item_search = HistoryLineEdit(parent)
self.item_search.setMinimumContentsLength(5)
self.item_search.setSizeAdjustPolicy(self.item_search.AdjustToMinimumContentsLengthWithIcon)
try:
self.item_search.lineEdit().setPlaceholderText(
_('Find item in tag browser'))
except:
pass # Using Qt < 4.7
self.item_search.setToolTip(_(
'Search for items. This is a "contains" search; items containing the\n'
'text anywhere in the name will be found. You can limit the search\n'
'to particular categories using syntax similar to search. For example,\n'
'tags:foo will find foo in any tag, but not in authors etc. Entering\n'
'*foo will filter all categories at once, showing only those items\n'
'containing the text "foo"'))
search_layout.addWidget(self.item_search)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser find box',
_('Find item'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(self.set_focus_to_find_box)
self.search_button = QToolButton()
self.search_button.setText(_('Find'))
self.search_button.setToolTip(_('Find the first/next matching item'))
search_layout.addWidget(self.search_button)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser find button',
_('Find button'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(self.search_button.click)
self.expand_button = QToolButton()
self.expand_button.setText('-')
self.expand_button.setToolTip(_('Collapse all categories'))
search_layout.addWidget(self.expand_button)
search_layout.setStretch(0, 10)
search_layout.setStretch(1, 1)
search_layout.setStretch(2, 1)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser collapse all',
_('Collapse all'), default_keys=(),
action=ac, group=_('Tag Browser'))
ac.triggered.connect(self.expand_button.clicked)
self.current_find_position = None
self.search_button.clicked.connect(self.find)
self.item_search.initialize('tag_browser_search')
self.item_search.lineEdit().returnPressed.connect(self.do_find)
self.item_search.lineEdit().textEdited.connect(self.find_text_changed)
self.item_search.activated[str].connect(self.do_find)
self.item_search.completer().setCaseSensitivity(Qt.CaseSensitive)
parent.tags_view = TagsView(parent)
self.tags_view = parent.tags_view
self.expand_button.clicked.connect(self.tags_view.collapseAll)
self._layout.addWidget(parent.tags_view)
# Now the floating 'not found' box
l = QLabel(self.tags_view)
self.not_found_label = l
l.setFrameStyle(QFrame.StyledPanel)
l.setAutoFillBackground(True)
l.setText('<p><b>'+_('No More Matches.</b><p> Click Find again to go to first match'))
l.setAlignment(Qt.AlignVCenter)
l.setWordWrap(True)
l.resize(l.sizeHint())
l.move(10,20)
l.setVisible(False)
self.not_found_label_timer = QTimer()
self.not_found_label_timer.setSingleShot(True)
self.not_found_label_timer.timeout.connect(self.not_found_label_timer_event,
type=Qt.QueuedConnection)
parent.alter_tb = l = QPushButton(parent)
l.setText(_('Alter Tag Browser'))
l.setIcon(QIcon(I('tags.png')))
l.m = QMenu()
l.setMenu(l.m)
self._layout.addWidget(l)
ac = QAction(parent)
parent.addAction(ac)
parent.keyboard.register_shortcut('tag browser alter',
_('Alter tag browser'), default_keys=(),
action=ac, group=_('Tag Browser'))
#.........这里部分代码省略.........
示例10: Ui_TagListEditor
class Ui_TagListEditor(object):
def setupUi(self, TagListEditor):
TagListEditor.setObjectName(_fromUtf8("TagListEditor"))
TagListEditor.resize(397, 335)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("chapters.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
TagListEditor.setWindowIcon(icon)
self.gridlayout = QtGui.QGridLayout(TagListEditor)
self.gridlayout.setObjectName(_fromUtf8("gridlayout"))
self.horizontalLayout_11 = QtGui.QHBoxLayout()
self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11"))
self.search_box = HistoryLineEdit(TagListEditor)
self.search_box.setObjectName(_fromUtf8("search_box"))
self.horizontalLayout_11.addWidget(self.search_box)
self.search_button = QtGui.QToolButton(TagListEditor)
self.search_button.setObjectName(_fromUtf8("search_button"))
self.horizontalLayout_11.addWidget(self.search_button)
self.gridlayout.addLayout(self.horizontalLayout_11, 0, 1, 1, 1)
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.delete_button = QtGui.QToolButton(TagListEditor)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("trash.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.delete_button.setIcon(icon1)
self.delete_button.setIconSize(QtCore.QSize(32, 32))
self.delete_button.setObjectName(_fromUtf8("delete_button"))
self.verticalLayout_2.addWidget(self.delete_button)
self.rename_button = QtGui.QToolButton(TagListEditor)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(_fromUtf8(I("edit_input.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.rename_button.setIcon(icon2)
self.rename_button.setIconSize(QtCore.QSize(32, 32))
self.rename_button.setObjectName(_fromUtf8("rename_button"))
self.verticalLayout_2.addWidget(self.rename_button)
self.gridlayout.addLayout(self.verticalLayout_2, 1, 0, 1, 1)
self.table = QtGui.QTableWidget(TagListEditor)
self.table.setAlternatingRowColors(True)
self.table.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.table.setObjectName(_fromUtf8("table"))
self.table.setColumnCount(0)
self.table.setRowCount(0)
self.gridlayout.addWidget(self.table, 1, 1, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(TagListEditor)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(True)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridlayout.addWidget(self.buttonBox, 3, 0, 1, 2)
self.retranslateUi(TagListEditor)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), TagListEditor.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), TagListEditor.reject)
QtCore.QMetaObject.connectSlotsByName(TagListEditor)
def retranslateUi(self, TagListEditor):
TagListEditor.setWindowTitle(_("Category Editor"))
self.search_box.setToolTip(_("Search for an item in the Tag column"))
self.search_button.setText(_("Find"))
self.search_button.setToolTip(_("Copy the selected color name to the clipboard"))
self.delete_button.setToolTip(_("Delete item from database. This will unapply the item from all books and then remove it from the database."))
self.delete_button.setText(_("..."))
self.rename_button.setToolTip(_("Rename the item in every book where it is used."))
self.rename_button.setText(_("..."))
self.rename_button.setShortcut(_("Ctrl+S"))
示例11: setupUi
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(872, 610)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("store.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Dialog.setWindowIcon(icon)
Dialog.setSizeGripEnabled(True)
self.verticalLayout_5 = QtGui.QVBoxLayout(Dialog)
self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
self.top_layout = QtGui.QHBoxLayout()
self.top_layout.setObjectName(_fromUtf8("top_layout"))
self.label = QtGui.QLabel(Dialog)
self.label.setObjectName(_fromUtf8("label"))
self.top_layout.addWidget(self.label)
self.adv_search_button = QtGui.QToolButton(Dialog)
self.adv_search_button.setObjectName(_fromUtf8("adv_search_button"))
self.top_layout.addWidget(self.adv_search_button)
self.search_edit = HistoryLineEdit(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_edit.sizePolicy().hasHeightForWidth())
self.search_edit.setSizePolicy(sizePolicy)
self.search_edit.setObjectName(_fromUtf8("search_edit"))
self.top_layout.addWidget(self.search_edit)
self.search = QtGui.QPushButton(Dialog)
self.search.setObjectName(_fromUtf8("search"))
self.top_layout.addWidget(self.search)
self.verticalLayout_5.addLayout(self.top_layout)
self.store_splitter = QtGui.QSplitter(Dialog)
self.store_splitter.setOrientation(QtCore.Qt.Horizontal)
self.store_splitter.setObjectName(_fromUtf8("store_splitter"))
self.groupBox = QtGui.QGroupBox(self.store_splitter)
self.groupBox.setObjectName(_fromUtf8("groupBox"))
self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox)
self.verticalLayout_2.setSpacing(0)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.store_list = QtGui.QScrollArea(self.groupBox)
self.store_list.setWidgetResizable(True)
self.store_list.setObjectName(_fromUtf8("store_list"))
self.scrollAreaWidgetContents = QtGui.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 193, 127))
self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
self.store_list.setWidget(self.scrollAreaWidgetContents)
self.verticalLayout_2.addWidget(self.store_list)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.select_all_stores = QtGui.QPushButton(self.groupBox)
self.select_all_stores.setObjectName(_fromUtf8("select_all_stores"))
self.verticalLayout.addWidget(self.select_all_stores)
self.select_invert_stores = QtGui.QPushButton(self.groupBox)
self.select_invert_stores.setObjectName(_fromUtf8("select_invert_stores"))
self.verticalLayout.addWidget(self.select_invert_stores)
self.select_none_stores = QtGui.QPushButton(self.groupBox)
self.select_none_stores.setObjectName(_fromUtf8("select_none_stores"))
self.verticalLayout.addWidget(self.select_none_stores)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.verticalLayoutWidget = QtGui.QWidget(self.store_splitter)
self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
self.verticalLayout_4 = QtGui.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout_4.setMargin(0)
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
self.results_view = ResultsView(self.verticalLayoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.results_view.sizePolicy().hasHeightForWidth())
self.results_view.setSizePolicy(sizePolicy)
self.results_view.setMinimumSize(QtCore.QSize(0, 0))
self.results_view.setAlternatingRowColors(True)
self.results_view.setIconSize(QtCore.QSize(32, 32))
self.results_view.setRootIsDecorated(False)
self.results_view.setUniformRowHeights(False)
self.results_view.setItemsExpandable(False)
self.results_view.setSortingEnabled(True)
self.results_view.setExpandsOnDoubleClick(False)
self.results_view.setObjectName(_fromUtf8("results_view"))
self.results_view.header().setStretchLastSection(False)
self.verticalLayout_4.addWidget(self.results_view)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.configure = QtGui.QToolButton(self.verticalLayoutWidget)
self.configure.setObjectName(_fromUtf8("configure"))
self.horizontalLayout.addWidget(self.configure)
self.open_external = QtGui.QCheckBox(self.verticalLayoutWidget)
self.open_external.setObjectName(_fromUtf8("open_external"))
self.horizontalLayout.addWidget(self.open_external)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.verticalLayout_4.addLayout(self.horizontalLayout)
self.verticalLayout_5.addWidget(self.store_splitter)
self.bottom_layout = QtGui.QHBoxLayout()
self.bottom_layout.setObjectName(_fromUtf8("bottom_layout"))
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.bottom_layout.addWidget(self.label_2)
self.total = QtGui.QLabel(Dialog)
self.total.setObjectName(_fromUtf8("total"))
#.........这里部分代码省略.........
示例12: setupUi
#.........这里部分代码省略.........
self.search_field.setToolTip(_("The name of the field that you want to search"))
self.search_field.setObjectName(_fromUtf8("search_field"))
self.vargrid.addWidget(self.search_field, 4, 1, 1, 1)
self.HLayout_31 = QtGui.QHBoxLayout()
self.HLayout_31.setObjectName(_fromUtf8("HLayout_31"))
self.xlabel_24 = QtGui.QLabel(self.tabWidgetPage3)
self.xlabel_24.setText(_("Search &mode:"))
self.xlabel_24.setObjectName(_fromUtf8("xlabel_24"))
self.HLayout_31.addWidget(self.xlabel_24)
self.search_mode = QtGui.QComboBox(self.tabWidgetPage3)
self.search_mode.setToolTip(_("Choose whether to use basic text matching or advanced regular expression matching"))
self.search_mode.setObjectName(_fromUtf8("search_mode"))
self.HLayout_31.addWidget(self.search_mode)
spacerItem6 = QtGui.QSpacerItem(20, 10, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.HLayout_31.addItem(spacerItem6)
self.vargrid.addLayout(self.HLayout_31, 4, 2, 1, 1)
self.s_r_src_ident_label = QtGui.QLabel(self.tabWidgetPage3)
self.s_r_src_ident_label.setText(_("Identifier type:"))
self.s_r_src_ident_label.setObjectName(_fromUtf8("s_r_src_ident_label"))
self.vargrid.addWidget(self.s_r_src_ident_label, 5, 0, 1, 1)
self.s_r_src_ident = QtGui.QComboBox(self.tabWidgetPage3)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.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.setToolTip(_("Choose which identifier type to operate upon"))
self.s_r_src_ident.setObjectName(_fromUtf8("s_r_src_ident"))
self.vargrid.addWidget(self.s_r_src_ident, 5, 1, 1, 1)
self.template_label = QtGui.QLabel(self.tabWidgetPage3)
self.template_label.setText(_("Te&mplate:"))
self.template_label.setObjectName(_fromUtf8("template_label"))
self.vargrid.addWidget(self.template_label, 5, 0, 1, 1)
self.s_r_template = HistoryLineEdit(self.tabWidgetPage3)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.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.setToolTip(_("Enter a template to be used as the source for the search/replace"))
self.s_r_template.setObjectName(_fromUtf8("s_r_template"))
self.vargrid.addWidget(self.s_r_template, 5, 1, 1, 1)
self.xlabel_2 = QtGui.QLabel(self.tabWidgetPage3)
self.xlabel_2.setText(_("&Search for:"))
self.xlabel_2.setObjectName(_fromUtf8("xlabel_2"))
self.vargrid.addWidget(self.xlabel_2, 6, 0, 1, 1)
self.search_for = HistoryLineEdit(self.tabWidgetPage3)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(100)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_for.sizePolicy().hasHeightForWidth())
self.search_for.setSizePolicy(sizePolicy)
self.search_for.setToolTip(_("Enter what you are looking for, either plain text or a regular expression, depending on the mode"))
self.search_for.setObjectName(_fromUtf8("search_for"))
self.vargrid.addWidget(self.search_for, 6, 1, 1, 1)
self.case_sensitive = QtGui.QCheckBox(self.tabWidgetPage3)
self.case_sensitive.setToolTip(_("Check this box if the search string must match exactly upper and lower case. Uncheck it if case is to be ignored"))
self.case_sensitive.setText(_("Cas&e sensitive"))
self.case_sensitive.setChecked(True)
self.case_sensitive.setObjectName(_fromUtf8("case_sensitive"))
self.vargrid.addWidget(self.case_sensitive, 6, 2, 1, 1)
self.xlabel_4 = QtGui.QLabel(self.tabWidgetPage3)
self.xlabel_4.setText(_("&Replace with:"))
self.xlabel_4.setObjectName(_fromUtf8("xlabel_4"))
self.vargrid.addWidget(self.xlabel_4, 7, 0, 1, 1)
self.replace_with = HistoryLineEdit(self.tabWidgetPage3)
示例13: Ui_Dialog
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(602, 245)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("lt.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Dialog.setWindowIcon(icon)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.old_location = QtGui.QLabel(Dialog)
self.old_location.setWordWrap(True)
self.old_location.setObjectName(_fromUtf8("old_location"))
self.gridLayout.addWidget(self.old_location, 0, 0, 1, 4)
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.existing_library = QtGui.QRadioButton(Dialog)
self.existing_library.setChecked(True)
self.existing_library.setObjectName(_fromUtf8("existing_library"))
self.gridLayout.addWidget(self.existing_library, 4, 0, 1, 4)
self.hbox1 = QtGui.QHBoxLayout()
self.hbox1.setObjectName(_fromUtf8("hbox1"))
self.empty_library = QtGui.QRadioButton(Dialog)
self.empty_library.setObjectName(_fromUtf8("empty_library"))
self.hbox1.addWidget(self.empty_library)
self.copy_structure = QtGui.QCheckBox(Dialog)
self.copy_structure.setObjectName(_fromUtf8("copy_structure"))
self.hbox1.addWidget(self.copy_structure)
self.gridLayout.addLayout(self.hbox1, 5, 0, 1, 3)
self.move_library = QtGui.QRadioButton(Dialog)
self.move_library.setObjectName(_fromUtf8("move_library"))
self.gridLayout.addWidget(self.move_library, 6, 0, 1, 3)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridLayout.addWidget(self.buttonBox, 8, 2, 1, 1)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem, 7, 2, 1, 1)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem1, 3, 0, 1, 1)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem2, 1, 0, 1, 1)
self.browse_button = QtGui.QToolButton(Dialog)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("document_open.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.browse_button.setIcon(icon1)
self.browse_button.setObjectName(_fromUtf8("browse_button"))
self.gridLayout.addWidget(self.browse_button, 2, 3, 1, 1)
self.location = HistoryLineEdit(Dialog)
self.location.setObjectName(_fromUtf8("location"))
self.gridLayout.addWidget(self.location, 2, 1, 1, 2)
self.label_2.setBuddy(self.location)
self.retranslateUi(Dialog)
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)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(_("Choose your calibre library"))
self.old_location.setText(_("Your calibre library is currently located at {0}"))
self.label_2.setText(_("New &Location:"))
self.existing_library.setText(_("Use the previously &existing library at the new location"))
self.empty_library.setText(_("&Create an empty library at the new location"))
self.copy_structure.setText(_("&Copy structure from the current library"))
self.copy_structure.setToolTip(_("Copy the custom columns, saved searches, column widths, plugboards,\n"
"user categories, and other information from the old to the new library"))
self.move_library.setText(_("&Move current library to new location"))
self.browse_button.setText(_("..."))
示例14: setupUi
def setupUi(self, EditAuthorsDialog):
EditAuthorsDialog.setObjectName(_fromUtf8("EditAuthorsDialog"))
EditAuthorsDialog.resize(768, 342)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(EditAuthorsDialog.sizePolicy().hasHeightForWidth())
EditAuthorsDialog.setSizePolicy(sizePolicy)
self.verticalLayout = QtGui.QVBoxLayout(EditAuthorsDialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName(_fromUtf8("hboxlayout"))
self.label = QtGui.QLabel(EditAuthorsDialog)
self.label.setObjectName(_fromUtf8("label"))
self.hboxlayout.addWidget(self.label)
self.find_box = HistoryLineEdit(EditAuthorsDialog)
self.find_box.setMinimumSize(QtCore.QSize(200, 0))
self.find_box.setObjectName(_fromUtf8("find_box"))
self.hboxlayout.addWidget(self.find_box)
self.find_button = QtGui.QPushButton(EditAuthorsDialog)
self.find_button.setObjectName(_fromUtf8("find_button"))
self.hboxlayout.addWidget(self.find_button)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.hboxlayout.addItem(spacerItem)
self.verticalLayout.addLayout(self.hboxlayout)
self.table = QtGui.QTableWidget(EditAuthorsDialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.table.sizePolicy().hasHeightForWidth())
self.table.setSizePolicy(sizePolicy)
self.table.setColumnCount(0)
self.table.setObjectName(_fromUtf8("table"))
self.table.setRowCount(0)
self.verticalLayout.addWidget(self.table)
self.gridlayout = QtGui.QGridLayout()
self.gridlayout.setObjectName(_fromUtf8("gridlayout"))
self.sort_by_author = QtGui.QPushButton(EditAuthorsDialog)
self.sort_by_author.setObjectName(_fromUtf8("sort_by_author"))
self.gridlayout.addWidget(self.sort_by_author, 0, 0, 1, 1)
self.sort_by_author_sort = QtGui.QPushButton(EditAuthorsDialog)
self.sort_by_author_sort.setObjectName(_fromUtf8("sort_by_author_sort"))
self.gridlayout.addWidget(self.sort_by_author_sort, 0, 1, 1, 1)
self.recalc_author_sort = QtGui.QPushButton(EditAuthorsDialog)
self.recalc_author_sort.setObjectName(_fromUtf8("recalc_author_sort"))
self.gridlayout.addWidget(self.recalc_author_sort, 1, 0, 1, 1)
self.auth_sort_to_author = QtGui.QPushButton(EditAuthorsDialog)
self.auth_sort_to_author.setObjectName(_fromUtf8("auth_sort_to_author"))
self.gridlayout.addWidget(self.auth_sort_to_author, 1, 1, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(EditAuthorsDialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
self.buttonBox.setSizePolicy(sizePolicy)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridlayout.addWidget(self.buttonBox, 1, 2, 1, 1)
self.verticalLayout.addLayout(self.gridlayout)
self.label.setBuddy(self.find_box)
self.retranslateUi(EditAuthorsDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), EditAuthorsDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), EditAuthorsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(EditAuthorsDialog)