Ejemplo n.º 1
0
 def __init__(self):
     gobject.GObject.__init__(self)
     self.set_wrap_mode(gtk.WRAP_CHAR)
     self.set_editable(False)
     self._changed_cursor = False
     self.connect('destroy', self.__destroy_event)
     self.connect('motion-notify-event', self.__motion_notify_event)
     self.connect('leave-notify-event', self.__leave_event)
     self.connect('enter-notify-event', self.__motion_notify_event)
     self.get_buffer().create_tag('eol', scale=pango.SCALE_XX_SMALL)
     self.tooltip = tooltips.BaseTooltip()
     self.config = gajim.config
     self.interface = gajim.interface
     # end big hack
     build_patterns(self, gajim.config, gajim.interface)
Ejemplo n.º 2
0
 def __init__(self):
     GObject.GObject.__init__(self)
     self.set_wrap_mode(Gtk.WrapMode.CHAR)
     self.set_editable(False)
     self._changed_cursor = False
     self.connect('destroy', self.__destroy_event)
     self.connect('motion-notify-event', self.__motion_notify_event)
     self.connect('leave-notify-event', self.__leave_event)
     self.connect('enter-notify-event', self.__motion_notify_event)
     self.connect('realize', self.on_html_text_view_realized)
     self.connect('unrealize', self.on_html_text_view_unrealized)
     self.connect('copy-clipboard', self.on_html_text_view_copy_clipboard)
     self.id_ = self.connect('button-release-event',
                             self.on_left_mouse_button_release)
     self.get_buffer().create_tag('eol')
     self.tooltip = tooltips.BaseTooltip()
     self.config = gajim.config
     self.interface = gajim.interface
Ejemplo n.º 3
0
    from conversation_textview import ConversationTextview
    import gajim as gaj

    log = logging.getLogger()
    gaj.Interface()

    # create fake gajim.plugin_manager.gui_extension_point method for tests
    def gui_extension_point(*args):
        pass

    gajim.plugin_manager = gaj.Interface()
    gajim.plugin_manager.gui_extension_point = gui_extension_point

    htmlview = ConversationTextview(None)

    tooltip = tooltips.BaseTooltip()

    def on_textview_motion_notify_event(widget, event):
        """
        Change the cursor to a hand when we are over a mail or an url
        """
        global change_cursor
        w = htmlview.tv.get_window(Gtk.TextWindowType.TEXT)
        device = w.get_display().get_device_manager().get_client_pointer()
        pointer = w.get_device_position(device)
        x = pointer[1]
        y = pointer[2]
        tags = htmlview.tv.get_iter_at_location(x, y).get_tags()
        if change_cursor:
            w.set_cursor(Gdk.Cursor.new(Gdk.CursorType.XTERM))
            change_cursor = None