show contact'information when contact_button is pressed in chat window

This commit is contained in:
Yann Leboulanger 2005-02-02 20:58:33 +00:00
parent 958884b8e2
commit 815d00c265
1 changed files with 16 additions and 0 deletions

View File

@ -216,6 +216,8 @@ class tabbed_chat_Window:
self.xml.signal_connect('on_close_clicked', self.on_close_clicked) self.xml.signal_connect('on_close_clicked', self.on_close_clicked)
self.xml.signal_connect('on_msg_key_press_event', \ self.xml.signal_connect('on_msg_key_press_event', \
self.on_msg_key_press_event) self.on_msg_key_press_event)
self.xml.signal_connect('on_button_contact_clicked', \
self.on_button_contact_clicked)
self.tagIn = buffer_conv.create_tag("incoming") self.tagIn = buffer_conv.create_tag("incoming")
color = self.plugin.config['inmsgcolor'] color = self.plugin.config['inmsgcolor']
self.tagIn.set_property("foreground", color) self.tagIn.set_property("foreground", color)
@ -385,6 +387,8 @@ class tabbed_chat_Window:
self.on_close_clicked) self.on_close_clicked)
self.xmls[user.jid].signal_connect('on_msg_key_press_event', \ self.xmls[user.jid].signal_connect('on_msg_key_press_event', \
self.on_msg_key_press_event) self.on_msg_key_press_event)
self.xmls[user.jid].signal_connect('on_button_contact_clicked', \
self.on_button_contact_clicked)
def on_msg_key_press_event(self, widget, event): def on_msg_key_press_event(self, widget, event):
"""When a key is pressed : """When a key is pressed :
@ -414,6 +418,12 @@ class tabbed_chat_Window:
if event.keyval == gtk.keysyms.Escape: if event.keyval == gtk.keysyms.Escape:
self.on_close_clicked(widget) self.on_close_clicked(widget)
def on_button_contact_clicked(self, widget):
"""When button contact is clicked"""
jid = self.get_active_jid()
user = self.users[jid]
self.plugin.roster.on_info(widget, user, self.account)
def read_queue(self, q): def read_queue(self, q):
"""read queue and print messages containted in it""" """read queue and print messages containted in it"""
jid = self.get_active_jid() jid = self.get_active_jid()
@ -630,6 +640,10 @@ class message_Window:
self.nb_unread = 0 self.nb_unread = 0
self.show_title() self.show_title()
def on_button_contact_clicked(self, widget):
"""When button contact is clicked"""
self.plugin.roster.on_info(widget, self.user, self.account)
def __init__(self, user, plugin, account): def __init__(self, user, plugin, account):
self.user = user self.user = user
self.plugin = plugin self.plugin = plugin
@ -658,6 +672,8 @@ class message_Window:
buffer.create_mark('end', end_iter, 0) buffer.create_mark('end', end_iter, 0)
self.xml.signal_connect('gtk_widget_destroy', self.delete_event) self.xml.signal_connect('gtk_widget_destroy', self.delete_event)
self.xml.signal_connect('on_clear_clicked', self.on_clear) self.xml.signal_connect('on_clear_clicked', self.on_clear)
self.xml.signal_connect('on_button_contact_clicked', \
self.on_button_contact_clicked)
self.xml.signal_connect('on_focus', self.on_focus) self.xml.signal_connect('on_focus', self.on_focus)
self.xml.signal_connect('on_history_clicked', self.on_history) self.xml.signal_connect('on_history_clicked', self.on_history)
self.xml.signal_connect('on_msg_key_press_event', \ self.xml.signal_connect('on_msg_key_press_event', \