mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
Added in Icons to GxsIDs.
Can support: - "Unique" Icon based of GxsID. - Icon indicating PGP/Anon. - Icons for RecognTags. Needs more work to Make Unique Icons look good. and Add Icon sets. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7084 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
731d28bd41
commit
a4f0221d89
10 changed files with 567 additions and 145 deletions
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "GxsIdLabel.h"
|
||||
#include "GxsIdDetails.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -59,56 +60,6 @@ bool GxsIdLabel::getId(RsGxsId &id)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool MakeIdDesc(const RsGxsId &id, QString &str)
|
||||
{
|
||||
RsIdentityDetails details;
|
||||
|
||||
if (!rsIdentity->getIdDetails(id, details))
|
||||
{
|
||||
str = "Loading... " + QString::fromStdString(id.substr(0,5));
|
||||
return false;
|
||||
}
|
||||
|
||||
str = QString::fromUtf8(details.mNickname.c_str());
|
||||
|
||||
std::list<RsRecognTag>::iterator it;
|
||||
for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++)
|
||||
{
|
||||
str += " (";
|
||||
str += QString::number(it->tag_class);
|
||||
str += ":";
|
||||
str += QString::number(it->tag_type);
|
||||
str += ")";
|
||||
}
|
||||
|
||||
bool addCode = true;
|
||||
if (details.mPgpLinked)
|
||||
{
|
||||
str += " (PGP) [";
|
||||
if (details.mPgpKnown)
|
||||
{
|
||||
/* look up real name */
|
||||
std::string authorName = rsPeers->getPeerName(details.mPgpId);
|
||||
str += QString::fromUtf8(authorName.c_str());
|
||||
str += "]";
|
||||
|
||||
addCode = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str += " (Anon) [";
|
||||
}
|
||||
|
||||
if (addCode)
|
||||
{
|
||||
str += QString::fromStdString(id.substr(0,5));
|
||||
str += "...]";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define MAX_ATTEMPTS 3
|
||||
|
||||
void GxsIdLabel::loadId()
|
||||
|
@ -117,7 +68,8 @@ void GxsIdLabel::loadId()
|
|||
|
||||
/* try and get details - if not there ... set callback */
|
||||
QString desc;
|
||||
bool loaded = MakeIdDesc(mId, desc);
|
||||
std::list<QIcon> icons;
|
||||
bool loaded = GxsIdDetails::MakeIdDesc(mId, false, desc, icons);
|
||||
|
||||
setText(desc);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue