From cecaf31f7db663083ebd891c5712211f306c6b38 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 11 Sep 2015 01:15:45 +0200 Subject: [PATCH] Clean up naming and added to display avatar icons. --- .../src/gui/Circles/CreateCircleDialog.cpp | 26 +++++++++++-------- .../src/gui/Circles/CreateCircleDialog.h | 4 +-- .../src/gui/Circles/CreateCircleDialog.ui | 8 ++++-- retroshare-gui/src/gui/Identity/IdDialog.cpp | 14 +++++----- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index 36580c1fd..94403d384 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -25,6 +25,7 @@ #include #include "gui/Circles/CreateCircleDialog.h" +#include "gui/gxs/GxsIdDetails.h" #include #include @@ -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); diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.h b/retroshare-gui/src/gui/Circles/CreateCircleDialog.h index fe08d0dab..d8a3865d4 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.h +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.h @@ -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(); diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui index 377d00c90..8abb10dd3 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui @@ -128,7 +128,7 @@ - Known Identities + Known People @@ -240,7 +240,11 @@ - + + + Circle name + + diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 67e5b6279..151915d36 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -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 {