From 70975b30d996c1e7d844bd33e2a76d770839e288 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 19 Apr 2020 16:09:42 +0200 Subject: [PATCH] Display the avatar for the Wire author Display the avatar for the Wire author --- retroshare-gui/src/gui/TheWire/WireGroupItem.cpp | 11 +++++++++++ retroshare-gui/src/gui/TheWire/WireGroupItem.ui | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/retroshare-gui/src/gui/TheWire/WireGroupItem.cpp b/retroshare-gui/src/gui/TheWire/WireGroupItem.cpp index 71eafb3fe..ea771df5f 100644 --- a/retroshare-gui/src/gui/TheWire/WireGroupItem.cpp +++ b/retroshare-gui/src/gui/TheWire/WireGroupItem.cpp @@ -24,6 +24,7 @@ #include #include "WireGroupItem.h" +#include "gui/gxs/GxsIdDetails.h" #include #include @@ -49,6 +50,16 @@ void WireGroupItem::setup() label_groupName->setText(QString::fromStdString(mGroup.mMeta.mGroupName)); label_authorId->setId(mGroup.mMeta.mAuthorId); frame_details->setVisible(false); + + RsIdentityDetails idDetails ; + rsIdentity->getIdDetails(mGroup.mMeta.mAuthorId,idDetails); + + QPixmap pixmap ; + + if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) + pixmap = GxsIdDetails::makeDefaultIcon(mGroup.mMeta.mAuthorId,GxsIdDetails::SMALL); + + label_avatar->setPixmap(pixmap); connect(toolButton_show, SIGNAL(clicked()), this, SLOT(show())); connect(toolButton_subscribe, SIGNAL(clicked()), this, SLOT(subscribe())); diff --git a/retroshare-gui/src/gui/TheWire/WireGroupItem.ui b/retroshare-gui/src/gui/TheWire/WireGroupItem.ui index a71e1ed23..bf1f162a4 100644 --- a/retroshare-gui/src/gui/TheWire/WireGroupItem.ui +++ b/retroshare-gui/src/gui/TheWire/WireGroupItem.ui @@ -25,6 +25,22 @@ + + + + + 32 + 32 + + + + Avatar + + + true + + +