mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-27 15:45:36 +01:00
Handle search result not found
This commit is contained in:
parent
83cbd28323
commit
bb58aa60d9
2 changed files with 9 additions and 0 deletions
|
|
@ -273,6 +273,14 @@ def make_result_current(self, result_num):
|
|||
def search_result_discovered(self, sr):
|
||||
self.make_result_current(sr.result_num)
|
||||
|
||||
def search_result_not_found(self, sr):
|
||||
if sr.on_discovery:
|
||||
return
|
||||
error_dialog(
|
||||
_('Search result not found'), _(
|
||||
'This search result matches text that is hidden in the book and cannot be displayed'))
|
||||
self.show()
|
||||
|
||||
def result_clicked(self, rnum):
|
||||
sr = Object.assign({}, self.result_map[rnum])
|
||||
sr.on_discovery = 0
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ def __init__(self):
|
|||
ui_operations.speak_simple_text = self.speak_simple_text.bind(self)
|
||||
ui_operations.tts = self.tts.bind(self)
|
||||
ui_operations.search_result_discovered = self.view.search_overlay.search_result_discovered
|
||||
ui_operations.search_result_not_found = self.view.search_overlay.search_result_not_found
|
||||
ui_operations.open_url = def(url):
|
||||
window.open(url, '_blank')
|
||||
ui_operations.copy_selection = def(text, html):
|
||||
|
|
|
|||
Loading…
Reference in a new issue