mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
Enabled to display identity icons for Distant peers on Message Composer and on Friend Selection Widget
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7811 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
57640379a8
commit
d26ea4a642
@ -23,6 +23,7 @@
|
||||
#include <QDialogButtonBox>
|
||||
#include "FriendSelectionWidget.h"
|
||||
#include "ui_FriendSelectionWidget.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include <retroshare-gui/RsAutoUpdatePage.h>
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/common/RSTreeWidgetItem.h"
|
||||
@ -526,6 +527,8 @@ void FriendSelectionWidget::secured_fillList()
|
||||
RsIdentityDetails detail;
|
||||
if (!rsIdentity->getIdDetails(RsGxsId(*gxsIt), detail))
|
||||
continue; /* BAD */
|
||||
|
||||
QPixmap identicon = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(*gxsIt))) ;
|
||||
|
||||
// make a widget per friend
|
||||
gxsItem = new RSTreeWidgetItem(mCompareRole, IDTYPE_GXS);
|
||||
@ -533,9 +536,9 @@ void FriendSelectionWidget::secured_fillList()
|
||||
QString name = QString::fromUtf8(detail.mNickname.c_str());
|
||||
gxsItem->setText(COLUMN_NAME, name + " ("+QString::fromStdString( (*gxsIt).toStdString() )+")");
|
||||
|
||||
gxsItem->setTextColor(COLUMN_NAME, textColorOnline());
|
||||
//gxsItem->setTextColor(COLUMN_NAME, textColorOnline());
|
||||
gxsItem->setFlags(Qt::ItemIsUserCheckable | gxsItem->flags());
|
||||
gxsItem->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(RS_STATUS_ONLINE)));
|
||||
gxsItem->setIcon(COLUMN_NAME, QIcon(identicon));
|
||||
gxsItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.mId.toStdString()));
|
||||
gxsItem->setData(COLUMN_DATA, ROLE_SORT, "2 " + name);
|
||||
|
||||
|
@ -51,17 +51,18 @@
|
||||
#include "gui/common/GroupDefs.h"
|
||||
#include "gui/common/StatusDefs.h"
|
||||
#include "gui/common/PeerDefs.h"
|
||||
#include "gui/common/TagDefs.h"
|
||||
#include "gui/common/Emoticons.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/common/Emoticons.h"
|
||||
#include "textformat.h"
|
||||
#include "gui/connect/ConfCertDialog.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/DateTime.h"
|
||||
#include "TagsMenu.h"
|
||||
#include "gui/common/TagDefs.h"
|
||||
#include "gui/connect/ConfCertDialog.h"
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/QtVersion.h"
|
||||
#include "textformat.h"
|
||||
#include "TagsMenu.h"
|
||||
|
||||
#define IMAGE_GROUP16 ":/images/user/group16.png"
|
||||
#define IMAGE_FRIENDINFO ":/images/peerdetails_16x16.png"
|
||||
@ -1444,16 +1445,18 @@ void MessageComposer::setRecipientToRow(int row, enumType type, destinationType
|
||||
case PEER_TYPE_GXS: {
|
||||
|
||||
RsIdentityDetails detail;
|
||||
RsGxsId gid(id) ;
|
||||
RsGxsId gid(id) ;
|
||||
|
||||
if(!rsIdentity->getIdDetails(gid, detail))
|
||||
{
|
||||
std::cerr << "Can't get peer details from " << gid << std::endl;
|
||||
return ;
|
||||
}
|
||||
|
||||
QPixmap identicon = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(gid))) ;
|
||||
|
||||
name = tr("Distant peer (name: %2, PGP key: %1)").arg(QString::fromStdString(gid.toStdString())).arg(QString::fromUtf8(detail.mNickname.c_str())) ;
|
||||
icon = QIcon(StatusDefs::imageUser(RS_STATUS_ONLINE));
|
||||
icon = QIcon(identicon);
|
||||
}
|
||||
break ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user