mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle search result not found
This commit is contained in:
parent
83cbd28323
commit
bb58aa60d9
@ -273,6 +273,14 @@ class SearchOverlay:
|
||||
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 @@ class ReadUI:
|
||||
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…
x
Reference in New Issue
Block a user