From 4fb593f1b988ec2992a8da5f0dc2b6134dbe531d Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 26 Jan 2011 23:09:25 +0000 Subject: [PATCH] Fixed display of the avatar in MsgItem. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3986 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/NewsFeed.cpp | 2 +- retroshare-gui/src/gui/feeds/MsgItem.cpp | 8 +++++--- retroshare-gui/src/gui/feeds/MsgItem.h | 2 +- retroshare-gui/src/gui/feeds/MsgItem.ui | 18 ++++++++++-------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index 0a3fbff6c..d9ad086d8 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -404,7 +404,7 @@ void NewsFeed::addFeedItemChatNew(RsFeedItem &fi) void NewsFeed::addFeedItemMessage(RsFeedItem &fi) { /* make new widget */ - MsgItem *mi = new MsgItem(this, NEWSFEED_MESSAGELIST, fi.mId1, fi.mId1, false); + MsgItem *mi = new MsgItem(this, NEWSFEED_MESSAGELIST, fi.mId1, false); /* store in list */ diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 662e43ef9..2796c3e86 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -27,6 +27,7 @@ #include "SubFileItem.h" #include "gui/msgs/MessageComposer.h" #include "gui/chat/HandleRichText.h" +#include "gui/notifyqt.h" #include #include @@ -36,8 +37,8 @@ ****/ /** Constructor */ -MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId, std::string msgId, bool isHome) -:QWidget(NULL), mParent(parent), mFeedId(feedId), mPeerId(peerId), mMsgId(msgId), mIsHome(isHome) +MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, std::string msgId, bool isHome) +:QWidget(NULL), mParent(parent), mFeedId(feedId), mMsgId(msgId), mIsHome(isHome) { /* Invoke the Qt Designer generated object setup routine */ setupUi(this); @@ -54,11 +55,12 @@ MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId, std::s connect( deleteButton, SIGNAL( clicked( void ) ), this, SLOT( deleteMsg ( void ) ) ); connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyMsg ( void ) ) ); + connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); + small(); updateItemStatic(); updateItem(); updateAvatar(QString::fromStdString(mPeerId)); - } diff --git a/retroshare-gui/src/gui/feeds/MsgItem.h b/retroshare-gui/src/gui/feeds/MsgItem.h index a0e1f28d1..d1d220815 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.h +++ b/retroshare-gui/src/gui/feeds/MsgItem.h @@ -34,7 +34,7 @@ class MsgItem : public QWidget, private Ui::MsgItem public: /** Default Constructor */ - MsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId, std::string msgId, bool isHome); + MsgItem(FeedHolder *parent, uint32_t feedId, std::string msgId, bool isHome); /** Default Destructor */ diff --git a/retroshare-gui/src/gui/feeds/MsgItem.ui b/retroshare-gui/src/gui/feeds/MsgItem.ui index 0565daf15..6f2a4c7c0 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.ui +++ b/retroshare-gui/src/gui/feeds/MsgItem.ui @@ -61,8 +61,8 @@ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2291E0, stop: 1 #3EB3FF); } - - + + true @@ -122,7 +122,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF); - + :/images/edit_add24.png:/images/edit_add24.png @@ -142,7 +142,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF); - + :/images/close_normal.png:/images/close_normal.png @@ -174,7 +174,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF); Reply Message - + :/images/mail_reply.png:/images/mail_reply.png @@ -213,7 +213,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF); - + :/images/mail_delete.png:/images/mail_delete.png @@ -233,7 +233,7 @@ stop: 0 #2291E0, stop: 1 #3EB3FF); - + :/images/startall.png:/images/startall.png @@ -275,6 +275,8 @@ stop: 0 #2291E0, stop: 1 #3EB3FF); - + + +