Exemplo n.º 1
0
 def show_translate(x, y, text):
     if len(filter(lambda word: word != "", (text.split(" ")))) > 1:
         translate_long = get_translate_long()
         if translate_long:
             translate_long.show_translate(x, y, text)
     else:
         translate_simple = get_translate_simple()
         if translate_simple:
             translate_simple.show_translate(x, y, text)
Exemplo n.º 2
0
    def hide_translate():
        translate_simple = get_translate_simple()
        if translate_simple:
            if translate_simple.isVisible() and not translate_simple.in_translate_area():
                translate_simple.hide_translate()

        translate_long = get_translate_long()
        if translate_long:
            if translate_long.isVisible() and not translate_long.in_translate_area():
                translate_long.hide_translate()
Exemplo n.º 3
0
 def show_translate(x, y, text, search_mode=True):
     hide_translate()
     
     if len(filter(lambda word: word != "", (text.split(" ")))) > 1:
         translate_long = get_translate_long()
         if translate_long:
             translate_long.show_translate(x, y, text, search_mode)
     else:
         translate_simple = get_translate_simple()
         if translate_simple:
             translate_simple.show_translate(x, y, text, search_mode)
Exemplo n.º 4
0
    def show_translate(x, y, text, search_mode=True):
        hide_translate()

        if len(filter(lambda word: word != "", (text.split(" ")))) > 1:
            translate_long = get_translate_long()
            if translate_long:
                translate_long.show_translate(x, y, text, search_mode)
        else:
            translate_simple = get_translate_simple()
            if translate_simple:
                translate_simple.show_translate(x, y, text, search_mode)
Exemplo n.º 5
0
    def hide_translate():
        translate_simple = get_translate_simple()
        if translate_simple:
            if translate_simple.isVisible(
            ) and not translate_simple.in_translate_area():
                translate_simple.hide_translate()

        translate_long = get_translate_long()
        if translate_long:
            if translate_long.isVisible(
            ) and not translate_long.in_translate_area():
                translate_long.hide_translate()