mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
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:
parent
1af2d39540
commit
375d64e118
@ -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)
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user