mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 16:39:29 -05:00
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
This commit is contained in:
parent
9a10d80613
commit
22690ff937
@ -5,6 +5,7 @@
|
||||
#include <retroshare/rsnotify.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsphoto.h>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#ifdef TURTLE_HOPPING
|
||||
#include <retroshare/rsturtle.h>
|
||||
#endif
|
||||
@ -359,6 +360,12 @@ void NotifyQt::UpdateGUI()
|
||||
/* id the name */
|
||||
std::string name = rsPeers->getPeerName(id);
|
||||
std::string realmsg = "<strong>" + name + "</strong>";
|
||||
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user