From 375d64e118eb8d22d58bee0c7e1cfe7b6ac498a1 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 17 Apr 2011 11:51:49 +0100 Subject: [PATCH] Completely remove the search options button. Enable and disable the highlight_only_button when switching between library and device views. --- src/calibre/gui2/layout.py | 7 ------- src/calibre/gui2/search_box.py | 5 ----- src/calibre/gui2/ui.py | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) 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/search_box.py b/src/calibre/gui2/search_box.py index 40c9c34587..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.') + '

' @@ -406,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/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()