Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display DPs in chat window, fix contact list window title bug #5

Merged
3 commits merged into from
Dec 16, 2010
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion amsn2/core/userinterface_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def load_contactlist(self):
if self._login:
self.unload_login()

self._main.title = "aMSN 2"
self._main.set_title("aMSN 2")
self._contactlist.show()

def unload_contactlist(self):
Expand Down
27 changes: 26 additions & 1 deletion amsn2/ui/front_ends/qt4/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import papyon
from amsn2.ui import base
from amsn2.views import ContactView, StringView
from amsn2.views import ContactView, StringView, ImageView

from PyQt4 import QtCore
from PyQt4 import QtGui
Expand Down Expand Up @@ -79,6 +79,31 @@ def __init__(self, amsn_conversation, parent, contacts_uid):
self.color = QtGui.QColor(QtCore.Qt.black) #TODO : load the default color
self.ui.inputWidget.setTextColor(self.color)

remoteDPImgs = self._amsn_conversation._core._contactlist_manager.get_contact(contacts_uid[0]).dp.imgs
foundDP = False
for (type, data) in remoteDPImgs:
if type == ImageView.FILENAME:
self.ui.remoteDP.setPixmap(QtGui.QPixmap(data))
foundDP = True
break

if not foundDP:
remoteDP = QtGui.QPixmap.fromImage(QtGui.QImage("amsn2/themes/displaypic/default/nopic.png"))
self.ui.remoteDP.setPixmap(remoteDP.scaled(96, 96, 0, 1))

localDPImgs = self._amsn_conversation._core._personalinfo_manager._personalinfoview.dp.imgs
foundDP = False
for (type, data) in localDPImgs:
if type == ImageView.FILENAME:
localDP = QtGui.QPixmap(data)
self.ui.localDP.setPixmap(localDP.scaled(96, 96, 0, 1))
foundDP = True
break

if not foundDP:
localDP = QtGui.QPixmap.fromImage(QtGui.QImage("amsn2/themes/displaypic/default/nopic.png"))
self.ui.localDP.setPixmap(localDP.scaled(96, 96, 0, 1))

QtCore.QObject.connect(self.ui.actionInsert_Emoticon, QtCore.SIGNAL("triggered()"), self.showEmoticonList)
QtCore.QObject.connect(self.ui.actionFont, QtCore.SIGNAL("triggered()"), self.chooseFont)
QtCore.QObject.connect(self.ui.actionColor, QtCore.SIGNAL("triggered()"), self.chooseColor)
Expand Down