TranslatorWidget: fixed an issue causing the translate button to remain active even with no Original Language selected (e.g. after changing translator engine).

Tue, 02 Oct 2018 19:22:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 02 Oct 2018 19:22:56 +0200
changeset 6523
3e2897a36771
parent 6522
20c9a023b6c1
child 6524
e5a7bd60b287

TranslatorWidget: fixed an issue causing the translate button to remain active even with no Original Language selected (e.g. after changing translator engine).

Plugins/UiExtensionPlugins/Translator/TranslatorWidget.py file | annotate | diff | comparison | revisions
--- a/Plugins/UiExtensionPlugins/Translator/TranslatorWidget.py	Tue Oct 02 19:11:39 2018 +0200
+++ b/Plugins/UiExtensionPlugins/Translator/TranslatorWidget.py	Tue Oct 02 19:22:56 2018 +0200
@@ -263,8 +263,8 @@
                 if index == -1:
                     index = 0
                 self.transLanguageComboBox.setCurrentIndex(index)
-            
-            self.__updateTranslateButton()
+        
+        self.__updateTranslateButton()
     
     @pyqtSlot(int)
     def on_transLanguageComboBox_currentIndexChanged(self, index):
@@ -323,6 +323,7 @@
         """
         self.__ensureTranslationEngineReady()
         
+        self.__updateTranslateButton()
         self.__updatePronounceButtons()
         
         self.__plugin.setPreferences(
@@ -355,6 +356,7 @@
         """
         enable = bool(self.origEdit.toPlainText())
         enable &= bool(self.__translationLanguage())
+        enable &= bool(self.__originalLanguage())
         self.translateButton.setEnabled(enable)
     
     def __translate(self, text, originalLanguage, translationLanguage):

eric ide

mercurial