From 22690ff937145df9e9350e8d76826d4aba634b0b Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 21 Nov 2010 15:22:41 +0000 Subject: [PATCH] Added to OnlineToaster to display friends Avatar when available git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3843 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/notifyqt.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index 721674d57..74b6dc845 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #ifdef TURTLE_HOPPING #include #endif @@ -359,6 +360,12 @@ void NotifyQt::UpdateGUI() /* id the name */ std::string name = rsPeers->getPeerName(id); std::string realmsg = "" + name + ""; + + unsigned char *data = NULL; + int size = 0 ; + + rsMsgs->getAvatarData(id,data,size); + switch(type) { case RS_POPUP_MSG: @@ -393,6 +400,21 @@ void NotifyQt::UpdateGUI() { OnlineToaster * onlineToaster = new OnlineToaster(); onlineToaster->setMessage(QString::fromStdString(realmsg)); + + if(size != 0) + { + // set the image + QPixmap pix ; + pix.loadFromData(data,size,"PNG") ; + onlineToaster->setPixmap(pix); + delete[] data ; + + } + else + { + onlineToaster->setPixmap(QPixmap(":/images/user/personal64.png")); + } + onlineToaster->show(); onlineToaster->play(); }