mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Automatically resume speaking after configuring
This commit is contained in:
parent
979a016f1d
commit
d82de098d1
@ -477,6 +477,7 @@ class WebView(RestartingWebEngineView):
|
|||||||
self.current_cfi = self.current_content_file = None
|
self.current_cfi = self.current_content_file = None
|
||||||
RestartingWebEngineView.__init__(self, parent)
|
RestartingWebEngineView.__init__(self, parent)
|
||||||
self.tts = TTS(self)
|
self.tts = TTS(self)
|
||||||
|
self.tts.settings_changed.connect(self.tts_settings_changed)
|
||||||
self.tts.event_received.connect(self.tts_event_received)
|
self.tts.event_received.connect(self.tts_event_received)
|
||||||
self.dead_renderer_error_shown = False
|
self.dead_renderer_error_shown = False
|
||||||
self.render_process_failed.connect(self.render_process_died)
|
self.render_process_failed.connect(self.render_process_died)
|
||||||
@ -716,3 +717,6 @@ class WebView(RestartingWebEngineView):
|
|||||||
|
|
||||||
def tts_event_received(self, which, data):
|
def tts_event_received(self, which, data):
|
||||||
self.execute_when_ready('tts_event', which, data)
|
self.execute_when_ready('tts_event', which, data)
|
||||||
|
|
||||||
|
def tts_settings_changed(self, ui_settings):
|
||||||
|
self.execute_when_ready('tts_event', 'configured', ui_settings)
|
||||||
|
@ -132,6 +132,7 @@ class ReadAloud:
|
|||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
self.pause()
|
self.pause()
|
||||||
|
self.waiting_for_configure = True
|
||||||
ui_operations.tts('configure')
|
ui_operations.tts('configure')
|
||||||
|
|
||||||
def play(self):
|
def play(self):
|
||||||
@ -200,6 +201,10 @@ class ReadAloud:
|
|||||||
elif which is 'end':
|
elif which is 'end':
|
||||||
self.state = STOPPED
|
self.state = STOPPED
|
||||||
self.view.show_next_spine_item()
|
self.view.show_next_spine_item()
|
||||||
|
elif which is 'configured':
|
||||||
|
if self.waiting_for_configure:
|
||||||
|
self.waiting_for_configure = False
|
||||||
|
self.play()
|
||||||
|
|
||||||
def send_message(self, type, **kw):
|
def send_message(self, type, **kw):
|
||||||
self.view.iframe_wrapper.send_message('tts', type=type, **kw)
|
self.view.iframe_wrapper.send_message('tts', type=type, **kw)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user