Beispiel #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)
Beispiel #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()
Beispiel #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)
Beispiel #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)
Beispiel #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()
Beispiel #6
0
 def translate_cursor_word():
     hide_translate()
     
     translate_simple = get_translate_simple()
     if translate_simple:
         translate_simple.translate_cursor_word()
Beispiel #7
0
 def handle_press_alt():
     translate_simple = get_translate_simple()
     if translate_simple:
         translate_simple.translate_cursor_word()
 def is_cursor_in_view_area(self):
     view = get_translate_simple()
     if view == None:
         return False
     else:
         return view.in_translate_area()
 def is_view_visible(self):
     view = get_translate_simple()
     if view == None:
         return False
     else:
         return view.isVisible()
Beispiel #10
0
    def translate_cursor_word():
        hide_translate()

        translate_simple = get_translate_simple()
        if translate_simple:
            translate_simple.translate_cursor_word()