Ticket #2210: 0001-Updated-translated-word-when-language-to-translate-i.patch

File 0001-Updated-translated-word-when-language-to-translate-i.patch, 1.7 KB (added by ishan, 10 years ago)
  • pippy_app.py

    From 37a365dd534fc7c39de734300a5756333c8685cb Mon Sep 17 00:00:00 2001
    Co-authored-by: Ishan Bansal <ishan@seeta.in>, Anubhav Aggarwal <anubhav@seeta.in>
    Date: Fri, 8 Oct 2010 20:04:46 +0530
    Subject: [PATCH v3 Word] Updated translated word when language to translate is changed. (Ticket #2210)
    
    New global variable 'newtotranslate' added to update the translated text when
    the language to translate is being changed.
    
    Signed-off-by: Ishan Bansal <ishan@seeta.in>, Anubhav Aggarwal <anubhav@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 b class WordsActivity(ViewSourceActivity): 
    4949        self.fromlang = "English"
    5050        self.tolang   = "Spanish"
    5151        self.languagemodel = LanguageModel.LanguageModel()
     52        self.newtotranslate = 'none'
    5253
    5354        # Main layout.
    5455        hbox = gtk.HBox(homogeneous=True)
    class WordsActivity(ViewSourceActivity): 
    151152
    152153    def lang2combo_cb(self, combo):
    153154        self.languagemodel.SetLanguages("English", self.langs[combo.get_active()])
     155        self.translated.set_text("")
     156        self.totranslate_cb(self.newtotranslate)
    154157       
    155158    def lang1sel_cb(self, column):
    156159        # FIXME: Complete the text entry box
    class WordsActivity(ViewSourceActivity): 
    177180
    178181    def totranslate_cb(self, totranslate):
    179182        entry = totranslate.get_text()
     183        self.newtotranslate = totranslate
    180184        # Ask for completion suggestions
    181185        if not entry:
    182186            return