Completely remove the search options button. Enable and disable the highlight_only_button when switching between library and device views.

This commit is contained in:
Charles Haley 2011-04-17 11:51:49 +01:00
parent 1af2d39540
commit 375d64e118
3 changed files with 2 additions and 14 deletions

View File

@ -200,13 +200,6 @@ class SearchBar(QWidget): # {{{
x.setIcon(QIcon(I('arrow-down.png'))) x.setIcon(QIcon(I('arrow-down.png')))
l.addWidget(x) 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 = parent.saved_search = SavedSearchBox(self)
x.setMaximumSize(QSize(150, 16777215)) x.setMaximumSize(QSize(150, 16777215))
x.setMinimumContentsLength(15) x.setMinimumContentsLength(15)

View File

@ -364,7 +364,6 @@ class SearchBoxMixin(object): # {{{
unicode(self.search.toolTip()))) unicode(self.search.toolTip())))
self.advanced_search_button.setStatusTip(self.advanced_search_button.toolTip()) self.advanced_search_button.setStatusTip(self.advanced_search_button.toolTip())
self.clear_button.setStatusTip(self.clear_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.set_highlight_only_button_icon()
self.highlight_only_button.clicked.connect(self.highlight_only_clicked) self.highlight_only_button.clicked.connect(self.highlight_only_clicked)
tt = _('Enable or disable search highlighting.') + '<br><br>' tt = _('Enable or disable search highlighting.') + '<br><br>'
@ -406,10 +405,6 @@ class SearchBoxMixin(object): # {{{
self.search.do_search() self.search.do_search()
self.focus_to_library() 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): def focus_to_library(self):
self.current_view().setFocus(Qt.OtherFocusReason) self.current_view().setFocus(Qt.OtherFocusReason)

View File

@ -529,10 +529,10 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
action.location_selected(location) action.location_selected(location)
if location == 'library': if location == 'library':
self.search_restriction.setEnabled(True) self.search_restriction.setEnabled(True)
self.search_options_button.setEnabled(True) self.highlight_only_button.setEnabled(True)
else: else:
self.search_restriction.setEnabled(False) 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 # Reset the view in case something changed while it was invisible
self.current_view().reset() self.current_view().reset()
self.set_number_of_books_shown() self.set_number_of_books_shown()