[Dextrose] [PATCH v3 Word] Updated translated word when language to translate is changed. (Ticket #2210)

Ishan Bansal ishan at seeta.in
Tue Oct 12 03:02:39 EDT 2010


New global variable 'newtotranslate' added to update the translated text when
the language to translate is being changed.

Signed-off-by: Ishan Bansal <ishan at seeta.in>, Anubhav Aggarwal <anubhav at seeta.in>
---
 pippy_app.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

v1->v2 : Global variable removed and subject updated.
v2->v3 : Co-author fields added in accordance with the guidelines for patch submission

diff --git a/pippy_app.py b/pippy_app.py
index b9a5a25..f9b0be7 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -49,6 +49,7 @@ class WordsActivity(ViewSourceActivity):
         self.fromlang = "English"
         self.tolang   = "Spanish"
         self.languagemodel = LanguageModel.LanguageModel()
+        self.newtotranslate = 'none'
 
         # Main layout.
         hbox = gtk.HBox(homogeneous=True)
@@ -151,6 +152,8 @@ class WordsActivity(ViewSourceActivity):
 
     def lang2combo_cb(self, combo):
         self.languagemodel.SetLanguages("English", self.langs[combo.get_active()])
+        self.translated.set_text("")
+        self.totranslate_cb(self.newtotranslate)
         
     def lang1sel_cb(self, column):
         # FIXME: Complete the text entry box
@@ -177,6 +180,7 @@ class WordsActivity(ViewSourceActivity):
 
     def totranslate_cb(self, totranslate):
         entry = totranslate.get_text()
+        self.newtotranslate = totranslate
         # Ask for completion suggestions
         if not entry:
             return
-- 
1.7.0.4



More information about the Dextrose mailing list