diff --git a/src/calibre/gui2/dialogs/tag_list_editor.py b/src/calibre/gui2/dialogs/tag_list_editor.py index aae68c4966..136eeaff24 100644 --- a/src/calibre/gui2/dialogs/tag_list_editor.py +++ b/src/calibre/gui2/dialogs/tag_list_editor.py @@ -5,7 +5,7 @@ from PyQt4.Qt import (Qt, QDialog, QTableWidgetItem, QIcon, QByteArray, QString, QSize) from calibre.gui2.dialogs.tag_list_editor_ui import Ui_TagListEditor -from calibre.gui2 import question_dialog, error_dialog, gprefs +from calibre.gui2 import question_dialog, error_dialog, info_dialog, gprefs from calibre.utils.icu import sort_key class NameTableWidgetItem(QTableWidgetItem): @@ -149,6 +149,9 @@ class TagListEditor(QDialog, Ui_TagListEditor): self.table.itemChanged.connect(self.finish_editing) self.buttonBox.accepted.connect(self.accepted) + self.search_box.initialize('tag_list_search_box_' + cat_name) + self.search_button.clicked.connect(self.search_clicked) + try: geom = gprefs.get('tag_list_editor_dialog_geometry', None) if geom is not None: @@ -158,6 +161,26 @@ class TagListEditor(QDialog, Ui_TagListEditor): except: pass + def search_clicked(self): + search_for = unicode(self.search_box.text()) + if not search_for: + error_dialog(self, _('Find'), _('You must enter some text to search for'), + show=True, show_copy_button=False) + return + row = self.table.currentRow() + if row < 0: + row = 0 + rows = self.table.rowCount() + for i in range(0, rows): + row += 1 + if row >= rows: + row = 0 + item = self.table.item(row, 0) + if search_for in unicode(item.text()): + self.table.setCurrentItem(item) + return + info_dialog(self, _('Find'), _('No tag found'), show=True, show_copy_button=False) + def table_column_resized(self, col, old, new): self.table_column_widths = [] for c in range(0, self.table.columnCount()): diff --git a/src/calibre/gui2/dialogs/tag_list_editor.ui b/src/calibre/gui2/dialogs/tag_list_editor.ui index ccc404bf9c..cd36d57044 100644 --- a/src/calibre/gui2/dialogs/tag_list_editor.ui +++ b/src/calibre/gui2/dialogs/tag_list_editor.ui @@ -18,75 +18,88 @@ :/images/chapters.png:/images/chapters.png - - + + - - - - - - - Delete item from database. This will unapply the item from all books and then remove it from the database. - - - ... - - - - :/images/trash.png:/images/trash.png - - - - 32 - 32 - - - - - - - - Rename the item in every book where it is used. - - - ... - - - - :/images/edit_input.png:/images/edit_input.png - - - - 32 - 32 - - - - Ctrl+S - - - - - - - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - - + + + Search for an item in the Tag column + + + + + + + Find + + + Copy the selected color name to the clipboard + + - + + + + + + Delete item from database. This will unapply the item from all books and then remove it from the database. + + + ... + + + + :/images/trash.png:/images/trash.png + + + + 32 + 32 + + + + + + + + Rename the item in every book where it is used. + + + ... + + + + :/images/edit_input.png:/images/edit_input.png + + + + 32 + 32 + + + + Ctrl+S + + + + + + + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + + Qt::Horizontal @@ -101,6 +114,13 @@ + + + HistoryLineEdit + QLineEdit +
widgets.h
+
+