Clean up naming and added to display avatar icons.

This commit is contained in:
defnax 2015-09-11 01:15:45 +02:00
parent b1527b608f
commit cecaf31f7d
4 changed files with 30 additions and 22 deletions

View File

@ -25,6 +25,7 @@
#include <algorithm>
#include "gui/Circles/CreateCircleDialog.h"
#include "gui/gxs/GxsIdDetails.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsidentity.h>
@ -50,10 +51,6 @@ CreateCircleDialog::CreateCircleDialog()
/* Setup Queue */
mCircleQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
//QString text = pId.empty() ? tr("Start New Thread") : tr("Post Forum Message");
//setWindowTitle(text);
//Settings->loadWidgetInformation(this);
ui.headerFrame->setHeaderImage(QPixmap(":/images/circles/circles_64.png"));
@ -122,12 +119,12 @@ void CreateCircleDialog::editNewId(bool isExternal)
if (isExternal)
{
setupForExternalCircle();
ui.headerFrame->setHeaderText(tr("Create New External Circle"));
ui.headerFrame->setHeaderText(tr("Create New Circle"));
}
else
{
setupForPersonalCircle();
ui.headerFrame->setHeaderText(tr("Create New Personal Circle"));
ui.headerFrame->setHeaderText(tr("Create New Circle"));
}
/* enable stuff that might be locked */
@ -139,14 +136,14 @@ void CreateCircleDialog::setupForPersonalCircle()
/* hide distribution line */
ui.groupBox_title->setTitle(tr("Personal Circle Details"));
ui.groupBox_title->setTitle(tr("Circle Details"));
ui.frame_PgpTypes->hide();
ui.frame_Distribution->hide();
ui.idChooserLabel->hide();
ui.idChooser->hide();
//ui.toolButton_NewId->hide();
getPgpIdentities();
//getPgpIdentities();
}
void CreateCircleDialog::setupForExternalCircle()
@ -154,7 +151,7 @@ void CreateCircleDialog::setupForExternalCircle()
mIsExternalCircle = true;
/* show distribution line */
ui.groupBox_title->setTitle(tr("External Circle Details"));
ui.groupBox_title->setTitle(tr("Circle Details"));
ui.frame_PgpTypes->show();
ui.frame_Distribution->show();
ui.idChooserLabel->show();
@ -220,6 +217,7 @@ void CreateCircleDialog::addMember(const QString& keyId, const QString& idtype,
member->setText(RSCIRCLEID_COL_NICKNAME, nickname);
member->setText(RSCIRCLEID_COL_KEYID, keyId);
member->setText(RSCIRCLEID_COL_IDTYPE, idtype);
//member->setIcon(RSCIRCLEID_COL_NICKNAME, pixmap);
tree->addTopLevelItem(member);
}
@ -522,7 +520,7 @@ void CreateCircleDialog::loadCircle(uint32_t token)
updateCircleGUI();
}
void CreateCircleDialog::getPgpIdentities()
/*void CreateCircleDialog::getPgpIdentities()
{
std::cerr << "CreateCircleDialog::getPgpIdentities()";
std::cerr << std::endl;
@ -556,7 +554,7 @@ void CreateCircleDialog::getPgpIdentities()
}
filterIds();
}
}*/
void CreateCircleDialog::requestGxsIdentities()
@ -616,6 +614,11 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
QString keyId = QString::fromStdString(data.mMeta.mGroupId.toStdString());
QString nickname = QString::fromUtf8(data.mMeta.mGroupName.c_str());
QString idtype = tr("Anon Id");
QPixmap pixmap ;
if(data.mImage.mSize == 0 || !pixmap.loadFromData(data.mImage.mData, data.mImage.mSize, "PNG"))
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID) {
if (data.mPgpKnown) {
@ -629,6 +632,7 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setText(RSCIRCLEID_COL_NICKNAME, nickname);
item->setIcon(RSCIRCLEID_COL_NICKNAME, QIcon(pixmap));
item->setText(RSCIRCLEID_COL_KEYID, keyId);
item->setText(RSCIRCLEID_COL_IDTYPE, idtype);
tree->addTopLevelItem(item);

View File

@ -41,7 +41,7 @@ public:
void editNewId(bool isExternal);
void editExistingId(const RsGxsGroupId &circleId, const bool &clearList = true);
void addMember(const QString &keyId, const QString &idtype, const QString &nickname );
void addMember(const QString &keyId, const QString &idtype, const QString &nickname);
void addMember(const RsGxsIdGroup &idGroup);
void addCircle(const RsGxsCircleDetails &cirDetails);
@ -73,7 +73,7 @@ private:
void requestCircle(const RsGxsGroupId &groupId);
void requestGxsIdentities();
void getPgpIdentities();
//void getPgpIdentities();
void filterIds();

View File

@ -128,7 +128,7 @@
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Known Identities</string>
<string>Known People</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@ -240,7 +240,11 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="circleName"/>
<widget class="QLineEdit" name="circleName">
<property name="placeholderText">
<string>Circle name</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="idChooserLabel">

View File

@ -298,20 +298,20 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
mStateHelper->setActive(CIRCLESDIALOG_GROUPMETA, true);
/* add the top level item */
QTreeWidgetItem *personalCirclesItem = new QTreeWidgetItem();
personalCirclesItem->setText(0, tr("Personal Circles"));
ui->treeWidget_membership->addTopLevelItem(personalCirclesItem);
//QTreeWidgetItem *personalCirclesItem = new QTreeWidgetItem();
//personalCirclesItem->setText(0, tr("Personal Circles"));
//ui->treeWidget_membership->addTopLevelItem(personalCirclesItem);
QTreeWidgetItem *externalAdminCirclesItem = new QTreeWidgetItem();
externalAdminCirclesItem->setText(0, tr("External Circles (Admin)"));
externalAdminCirclesItem->setText(0, tr("Circles (Admin)"));
ui->treeWidget_membership->addTopLevelItem(externalAdminCirclesItem);
QTreeWidgetItem *externalSubCirclesItem = new QTreeWidgetItem();
externalSubCirclesItem->setText(0, tr("External Circles (Subscribed)"));
externalSubCirclesItem->setText(0, tr("Circles (Subscribed)"));
ui->treeWidget_membership->addTopLevelItem(externalSubCirclesItem);
QTreeWidgetItem *externalOtherCirclesItem = new QTreeWidgetItem();
externalOtherCirclesItem->setText(0, tr("External Circles (Other)"));
externalOtherCirclesItem->setText(0, tr("Circles (Other)"));
ui->treeWidget_membership->addTopLevelItem(externalOtherCirclesItem);
for(vit = groupInfo.begin(); vit != groupInfo.end(); ++vit)
@ -327,7 +327,7 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
if (vit->mCircleType == GXS_CIRCLE_TYPE_LOCAL)
{
personalCirclesItem->addChild(groupItem);
//personalCirclesItem->addChild(groupItem);
}
else
{