Skip to content

Commit

Permalink
[GTK] Show display picture in conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonte committed Aug 10, 2009
1 parent 2827052 commit 9c5386d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions amsn2/gui/front_ends/gtk/chat_window.py
Expand Up @@ -32,6 +32,8 @@
import gtk_extras
import papyon
import gobject
import os
from image import Image

class aMSNChatWindow(base.aMSNChatWindow, gtk.Window):
def __init__(self, amsn_core):
Expand All @@ -41,7 +43,7 @@ def __init__(self, amsn_core):
self.showed = False
self.set_default_size(550, 450)
self.set_position(gtk.WIN_POS_CENTER)
self.set_title("aMSN - Chatwindow")
self._theme_manager = amsn_core._core._theme_manager

#leave

Expand Down Expand Up @@ -76,7 +78,10 @@ def __init__(self, amsn_conversation, parent, contacts_uid):

amsncontacts = [self._contactlist_manager.getContact(uid) for uid in contacts_uid]
cviews = [ContactView(self._amsn_core, c) for c in amsncontacts]
self.chatheader = aMSNChatHeader(cviews)
self.chatheader = aMSNChatHeader(self._theme_manager, cviews)

# Titlebar
parent.set_title("aMSN2 - " + str(cviews[0].name.getTag("nickname")))

# Middle
self.textview = HtmlTextView()
Expand Down Expand Up @@ -353,7 +358,7 @@ def onUserJoined(self, contact):
def onUserLeft(self, contact):
print "%s left the conversation" % (contact,)
self.__print_info("%s left the conversation" % (contact,))
self.__set_statusbar_text("%s left the comversation" % (contact,))
self.__set_statusbar_text("%s left the conversation" % (contact,))
self.__typingStopped()

def onUserTyping(self, contact):
Expand All @@ -373,14 +378,15 @@ def nudge(self):


class aMSNChatHeader(gtk.EventBox):
def __init__(self, cviews=None):
def __init__(self, theme_manager, cviews=None):
gtk.EventBox.__init__(self)

self.buddy_icon = gtk.Image()
self.title = gtk.Label()
self.dp = gtk.Image()
self.title_color = gtk.gdk.color_parse('#dadada')
self.psm_color = '#999999'
self.theme_manager = theme_manager

self.title.set_use_markup(True)
self.title.set_justify(gtk.JUSTIFY_LEFT)
Expand Down Expand Up @@ -410,6 +416,10 @@ def update(self, cviews):
psm = cviews[0].name.getTag("psm")
status = cviews[0].name.getTag("status")

#FIXME: Which user do we show in a multiconversation?
img = Image(self.theme_manager, cviews[0].dp)
self.dp.set_from_pixbuf(img.to_pixbuf(50,50))

title = '<span size="large"><b>%s</b></span>' % (nickname, )
title += '<span size="medium"> %s</span>' % (status, )

Expand Down

0 comments on commit 9c5386d

Please sign in to comment.