Commit 0b495e09 authored by Dicson's avatar Dicson

ClickableNicknamesPlugin.gtk3 support

parent 368713b0
from clickable_nicknames import ClickableNicknames
from .clickable_nicknames import ClickableNicknames
# -*- coding: utf-8 -*-
import gtk
from string import rstrip
from string import lstrip
from gi.repository import Gtk
from gi.repository import Gdk
from common import gajim
from plugins import GajimPlugin
......@@ -88,25 +87,26 @@ class Base(object):
def on_textview_motion_notify_event(self, widget, event):
# change cursor on the nicks
pointer_x, pointer_y =[0:2]
x, y =,
pointer_x, pointer_y)
pointer_x, pointer_y =
x, y =,
pointer_x, pointer_y)
tags =, y).get_tags()
tag_table =
if self.change_cursor:
self.change_cursor = False
for tag in tags:
if tag in [x[1] for x in self.tags_id]:
self.change_cursor = True
self.textview.on_textview_motion_notify_event(widget, event)
def insert_nick(self, texttag, widget, event, iter_, kind):
# insert nickname to message buffer
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
if event.type == Gdk.EventType.BUTTON_PRESS and event.button.button == 1:
# left mouse button clicked
begin_iter = iter_.copy()
# we get the begining of the tag
......@@ -117,7 +117,7 @@ class Base(object):
while not end_iter.ends_tag(texttag):
buffer_ =
word = buffer_.get_text(begin_iter, end_iter).decode('utf-8')
word = buffer_.get_text(begin_iter, end_iter, True)
nick = word.rstrip().rstrip(gajim.config.get('after_nickname'))
if nick.startswith('* '):
nick = nick.lstrip('* ').split(' ')[0]
......@@ -5,4 +5,4 @@ version: 0.2.2
description: Clickable nicknames in the conversation textview.
authors: Denis Fomin <>
max_gajim_version: 0.15.9
min_gajim_version: 0.15.10
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment