eric6/Plugins/UiExtensionPlugins/Translator/TranslatorWidget.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8259
2bbec88047dd
equal deleted inserted replaced
8190:fb0ef164f536 8273:698ae46f40a4
36 36
37 @param plugin reference to the plugin object (TranslatorPlugin) 37 @param plugin reference to the plugin object (TranslatorPlugin)
38 @param translator reference to the translator object (Translator) 38 @param translator reference to the translator object (Translator)
39 @param parent reference to the parent widget (QWidget) 39 @param parent reference to the parent widget (QWidget)
40 """ 40 """
41 super(TranslatorWidget, self).__init__(parent) 41 super().__init__(parent)
42 self.setupUi(self) 42 self.setupUi(self)
43 43
44 self.__plugin = plugin 44 self.__plugin = plugin
45 self.__translator = translator 45 self.__translator = translator
46 46
337 337
338 def __updatePronounceButtons(self): 338 def __updatePronounceButtons(self):
339 """ 339 """
340 Private slot to set the state of the pronounce buttons. 340 Private slot to set the state of the pronounce buttons.
341 """ 341 """
342 if self.__translationEngine is not None: 342 hasTTS = self.__translationEngine and self.__translationEngine.hasTTS()
343 hasTTS = self.__translationEngine.hasTTS()
344 else:
345 hasTTS = False
346 self.pronounceOrigButton.setEnabled( 343 self.pronounceOrigButton.setEnabled(
347 hasTTS and bool(self.origEdit.toPlainText())) 344 hasTTS and bool(self.origEdit.toPlainText()))
348 self.pronounceTransButton.setEnabled( 345 self.pronounceTransButton.setEnabled(
349 hasTTS and bool(self.transEdit.toPlainText())) 346 hasTTS and bool(self.transEdit.toPlainText()))
350 347

eric ide

mercurial