This commit is contained in:
Kovid Goyal 2024-09-13 12:58:47 +05:30
parent ae3277b17f
commit e56f92fa2c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -227,7 +227,8 @@ class TTSManager(QObject):
def _state_changed(self, state: QTextToSpeech.State) -> None:
prev_state, self.state = self.state, state
if state is QTextToSpeech.State.Error:
error_dialog(self, _('Read aloud failed'), self.tts.error_message(), show=True)
from calibre.gui2.tts.types import widget_parent
error_dialog(widget_parent(self), _('Read aloud failed'), self.tts.error_message(), show=True)
if state is QTextToSpeech.State.Paused:
self.emit_state_event('pause')
elif state is QTextToSpeech.State.Speaking: