MCPcopy Create free account
hub / github.com/dialect-app/dialect / _check_speech_enabled

Method _check_speech_enabled

dialect/window.py:660–685  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

658 self.dest_pron_revealer.props.reveal_child = False
659
660 def _check_speech_enabled(self):
661 if not self.provider["tts"]:
662 return
663
664 src_playing = dest_playing = False
665 if self.current_speech:
666 src_playing = self.current_speech["called_from"] == "src"
667 dest_playing = self.current_speech["called_from"] == "dest"
668
669 # Check src listen button
670 self.lookup_action("listen-src").set_enabled( # type: ignore
671 self.speech_provider_failed
672 or self.src_lang_selector.selected in self.provider["tts"].tts_languages
673 and self.src_buffer.get_char_count() != 0
674 and not self.speech_loading
675 and not dest_playing
676 )
677
678 # Check dest listen button
679 self.lookup_action("listen-dest").set_enabled( # type: ignore
680 self.speech_provider_failed
681 or self.dest_lang_selector.selected in self.provider["tts"].tts_languages
682 and self.dest_buffer.get_char_count() != 0
683 and not self.speech_loading
684 and not src_playing
685 )
686
687 def _check_switch_enabled(self):
688 if not self.provider["trans"]:

Callers 8

load_ttsMethod · 0.95
_on_speechMethod · 0.95
_speech_resetMethod · 0.95
_gst_progress_timeoutMethod · 0.95
_on_src_text_changedMethod · 0.95
_on_dest_text_changedMethod · 0.95
_on_src_lang_changedMethod · 0.95
_on_dest_lang_changedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected