commit to bug test with alex
This commit is contained in:
parent
3feff20ddd
commit
0affca1760
2 changed files with 28 additions and 4 deletions
|
@ -572,7 +572,8 @@ Copyright © 2003-2005 Gajim Team
|
||||||
<b>Gajim Team</b>
|
<b>Gajim Team</b>
|
||||||
Vincent Hanquez (tab@snarc.org)
|
Vincent Hanquez (tab@snarc.org)
|
||||||
Yann Le Boulanger (asterix@lagaule.org)
|
Yann Le Boulanger (asterix@lagaule.org)
|
||||||
Nikos Kouremenos (nkour@jabber.org)</property>
|
Nikos Kouremenos (nkour@jabber.org)
|
||||||
|
Alex Podaras (bigpod@jabber.org)</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">False</property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
@ -4826,7 +4827,7 @@ Custom</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label199">
|
<widget class="GtkLabel" id="label199">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">Browser</property>
|
<property name="label" translatable="yes">Browser:</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">False</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="use_markup">False</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
@ -4850,7 +4851,7 @@ Custom</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label200">
|
<widget class="GtkLabel" id="label200">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">Mail app</property>
|
<property name="label" translatable="yes">Mail :</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">False</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="use_markup">False</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
|
|
@ -366,6 +366,9 @@ class tabbed_chat_window:
|
||||||
self.chat_notebook.set_show_tabs(False)
|
self.chat_notebook.set_show_tabs(False)
|
||||||
self.show_title()
|
self.show_title()
|
||||||
|
|
||||||
|
def hyperlink_handler(self, *args):
|
||||||
|
pass
|
||||||
|
|
||||||
def new_user(self, user):
|
def new_user(self, user):
|
||||||
self.nb_unread[user.jid] = 0
|
self.nb_unread[user.jid] = 0
|
||||||
self.users[user.jid] = user
|
self.users[user.jid] = user
|
||||||
|
@ -374,7 +377,9 @@ class tabbed_chat_window:
|
||||||
conversation_textview = \
|
conversation_textview = \
|
||||||
self.xmls[user.jid].get_widget('conversation_textview')
|
self.xmls[user.jid].get_widget('conversation_textview')
|
||||||
conversation_buffer = conversation_textview.get_buffer()
|
conversation_buffer = conversation_textview.get_buffer()
|
||||||
|
self.link_tag = conversation_buffer.create_tag('hyperlink', foreground='blue')
|
||||||
end_iter = conversation_buffer.get_end_iter()
|
end_iter = conversation_buffer.get_end_iter()
|
||||||
|
self.link_tag.connect('event', self.hyperlink_handler)
|
||||||
conversation_buffer.create_mark('end', end_iter, 0)
|
conversation_buffer.create_mark('end', end_iter, 0)
|
||||||
self.tagIn[user.jid] = conversation_buffer.create_tag('incoming')
|
self.tagIn[user.jid] = conversation_buffer.create_tag('incoming')
|
||||||
color = self.plugin.config['inmsgcolor']
|
color = self.plugin.config['inmsgcolor']
|
||||||
|
@ -545,7 +550,25 @@ class tabbed_chat_window:
|
||||||
index+=l
|
index+=l
|
||||||
beg = index
|
beg = index
|
||||||
index+=1
|
index+=1
|
||||||
conversation_buffer.insert(end_iter, otext[beg:])
|
#conversation_buffer.insert(end_iter, otext[beg:])
|
||||||
|
|
||||||
|
linksprefix = ['http://', 'https://', 'news://', 'ftp://', 'mailto:', 'ed2k://', 'www.', 'ftp.']
|
||||||
|
start=0
|
||||||
|
otext_lowered = otext.lower() # make them all small letters
|
||||||
|
for word in otext_lowered.split(): # get each word seperately
|
||||||
|
# word must be larger than the linksprefix items which atm the smaller is 4
|
||||||
|
if len(word) > 4:
|
||||||
|
for travelthru in range(len(linksprefix)): # travel tru linksprefix list
|
||||||
|
# linksprefix[travelthru] is http:// then https:// then news:// etc..
|
||||||
|
if word.startswith(linksprefix[travelthru]):
|
||||||
|
start = otext_lowered.index(word)
|
||||||
|
end = start + len(word)
|
||||||
|
print word, 'is a link and is in otext[%s:%s]' % (start, end)
|
||||||
|
conversation_buffer.insert_with_tags_by_name(end_iter, otext[start:end], 'hyperlink')
|
||||||
|
end_iter = conversation_buffer.get_end_iter()
|
||||||
|
break
|
||||||
|
|
||||||
|
conversation_buffer.insert(end_iter, otext[start:])
|
||||||
|
|
||||||
#scroll to the end of the textview
|
#scroll to the end of the textview
|
||||||
conversation_textview.scroll_to_mark(conversation_buffer.get_mark('end'),\
|
conversation_textview.scroll_to_mark(conversation_buffer.get_mark('end'),\
|
||||||
|
|
Loading…
Add table
Reference in a new issue