diff --git a/src/calibre/gui2/layout.py b/src/calibre/gui2/layout.py index 246fa168a0..e5ec5a9131 100644 --- a/src/calibre/gui2/layout.py +++ b/src/calibre/gui2/layout.py @@ -200,13 +200,6 @@ class SearchBar(QWidget): # {{{ x.setIcon(QIcon(I('arrow-down.png'))) l.addWidget(x) - x = parent.search_options_button = QToolButton(self) - x.setIcon(QIcon(I('config.png'))) - x.setObjectName("search_option_button") - l.addWidget(x) - x.setToolTip(_("Change the way searching for books works")) - x.setVisible(False) - x = parent.saved_search = SavedSearchBox(self) x.setMaximumSize(QSize(150, 16777215)) x.setMinimumContentsLength(15) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 48fbfb7291..ce5e0d9877 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -743,6 +743,8 @@ class BooksView(QTableView): # {{{ id_to_select = self._model.get_current_highlighted_id() if id_to_select is not None: self.select_rows([id_to_select], using_ids=True) + elif self._model.highlight_only: + self.clearSelection() self.setFocus(Qt.OtherFocusReason) def connect_to_search_box(self, sb, search_done): diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index f5b3649e27..c349d84a68 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -364,7 +364,6 @@ class SearchBoxMixin(object): # {{{ unicode(self.search.toolTip()))) self.advanced_search_button.setStatusTip(self.advanced_search_button.toolTip()) self.clear_button.setStatusTip(self.clear_button.toolTip()) - self.search_options_button.clicked.connect(self.search_options_button_clicked) self.set_highlight_only_button_icon() self.highlight_only_button.clicked.connect(self.highlight_only_clicked) tt = _('Enable or disable search highlighting.') + '

' @@ -374,6 +373,8 @@ class SearchBoxMixin(object): # {{{ def highlight_only_clicked(self, state): config['highlight_search_matches'] = not config['highlight_search_matches'] self.set_highlight_only_button_icon() + self.search.do_search() + self.focus_to_library() def set_highlight_only_button_icon(self): if config['highlight_search_matches']: @@ -404,10 +405,6 @@ class SearchBoxMixin(object): # {{{ self.search.do_search() self.focus_to_library() - def search_options_button_clicked(self): - self.iactions['Preferences'].do_config(initial_plugin=('Interface', - 'Search'), close_after_initial=True) - def focus_to_library(self): self.current_view().setFocus(Qt.OtherFocusReason) diff --git a/src/calibre/gui2/tag_view.py b/src/calibre/gui2/tag_view.py index 188fd3367d..7b68229da0 100644 --- a/src/calibre/gui2/tag_view.py +++ b/src/calibre/gui2/tag_view.py @@ -15,7 +15,7 @@ from functools import partial from PyQt4.Qt import (Qt, QTreeView, QApplication, pyqtSignal, QFont, QSize, QIcon, QPoint, QVBoxLayout, QHBoxLayout, QComboBox, QTimer, QAbstractItemModel, QVariant, QModelIndex, QMenu, QFrame, - QWidget, QItemDelegate, QString, QLabel, + QWidget, QItemDelegate, QString, QLabel, QPushButton, QShortcut, QKeySequence, SIGNAL, QMimeData, QToolButton) from calibre.ebooks.metadata import title_sort @@ -1809,9 +1809,6 @@ class TagsModel(QAbstractItemModel): # {{{ # }}} -category_managers = ( - ) - class TagBrowserMixin(object): # {{{ def __init__(self, db): @@ -1833,20 +1830,23 @@ class TagBrowserMixin(object): # {{{ self.tags_view.restriction_error.connect(self.do_restriction_error, type=Qt.QueuedConnection) - for text, func, args in ( - (_('Manage Authors'), self.do_author_sort_edit, (self, - None)), - (_('Manage Series'), self.do_tags_list_edit, (None, - 'series')), - (_('Manage Publishers'), self.do_tags_list_edit, (None, - 'publisher')), - (_('Manage Tags'), self.do_tags_list_edit, (None, 'tags')), - (_('Manage User Categories'), - self.do_edit_user_categories, (None,)), - (_('Manage Saved Searches'), self.do_saved_search_edit, - (None,)) + for text, func, args, cat_name in ( + (_('Manage Authors'), + self.do_author_sort_edit, (self, None), 'authors'), + (_('Manage Series'), + self.do_tags_list_edit, (None, 'series'), 'series'), + (_('Manage Publishers'), + self.do_tags_list_edit, (None, 'publisher'), 'publisher'), + (_('Manage Tags'), + self.do_tags_list_edit, (None, 'tags'), 'tags'), + (_('Manage User Categories'), + self.do_edit_user_categories, (None,), 'user:'), + (_('Manage Saved Searches'), + self.do_saved_search_edit, (None,), 'search') ): - self.manage_items_button.menu().addAction(text, partial(func, *args)) + self.manage_items_button.menu().addAction( + QIcon(I(category_icon_map[cat_name])), + text, partial(func, *args)) def do_restriction_error(self): error_dialog(self.tags_view, _('Invalid search restriction'), @@ -2166,11 +2166,9 @@ class TagBrowserWidget(QWidget): # {{{ parent.tag_match.setStatusTip(parent.tag_match.toolTip()) - l = parent.manage_items_button = QToolButton(self) - l.setIcon(QIcon(I('tags.png'))) + l = parent.manage_items_button = QPushButton(self) + l.setStyleSheet('QPushButton {text-align: left; }') l.setText(_('Manage authors, tags, etc')) - l.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) - l.setPopupMode(l.InstantPopup) l.setToolTip(_('All of these category_managers are available by right-clicking ' 'on items in the tag browser above')) l.m = QMenu() diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 8d31d9da32..f234d48739 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -529,10 +529,10 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ action.location_selected(location) if location == 'library': self.search_restriction.setEnabled(True) - self.search_options_button.setEnabled(True) + self.highlight_only_button.setEnabled(True) else: self.search_restriction.setEnabled(False) - self.search_options_button.setEnabled(False) + self.highlight_only_button.setEnabled(False) # Reset the view in case something changed while it was invisible self.current_view().reset() self.set_number_of_books_shown() diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index b5155368c7..bdcefd13a2 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -854,7 +854,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): mi.uuid = row[fm['uuid']] mi.title_sort = row[fm['sort']] mi.last_modified = row[fm['last_modified']] - mi.size = row[fm['size']] formats = row[fm['formats']] if not formats: formats = None