mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-29 16:53:31 -05:00
Clean up naming and added to display avatar icons.
This commit is contained in:
parent
b1527b608f
commit
cecaf31f7d
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "gui/Circles/CreateCircleDialog.h"
|
#include "gui/Circles/CreateCircleDialog.h"
|
||||||
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include <retroshare/rsidentity.h>
|
#include <retroshare/rsidentity.h>
|
||||||
@ -50,10 +51,6 @@ CreateCircleDialog::CreateCircleDialog()
|
|||||||
/* Setup Queue */
|
/* Setup Queue */
|
||||||
mCircleQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
mCircleQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
||||||
mIdQueue = new TokenQueue(rsIdentity->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"));
|
ui.headerFrame->setHeaderImage(QPixmap(":/images/circles/circles_64.png"));
|
||||||
|
|
||||||
@ -122,12 +119,12 @@ void CreateCircleDialog::editNewId(bool isExternal)
|
|||||||
if (isExternal)
|
if (isExternal)
|
||||||
{
|
{
|
||||||
setupForExternalCircle();
|
setupForExternalCircle();
|
||||||
ui.headerFrame->setHeaderText(tr("Create New External Circle"));
|
ui.headerFrame->setHeaderText(tr("Create New Circle"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setupForPersonalCircle();
|
setupForPersonalCircle();
|
||||||
ui.headerFrame->setHeaderText(tr("Create New Personal Circle"));
|
ui.headerFrame->setHeaderText(tr("Create New Circle"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable stuff that might be locked */
|
/* enable stuff that might be locked */
|
||||||
@ -139,14 +136,14 @@ void CreateCircleDialog::setupForPersonalCircle()
|
|||||||
|
|
||||||
/* hide distribution line */
|
/* hide distribution line */
|
||||||
|
|
||||||
ui.groupBox_title->setTitle(tr("Personal Circle Details"));
|
ui.groupBox_title->setTitle(tr("Circle Details"));
|
||||||
ui.frame_PgpTypes->hide();
|
ui.frame_PgpTypes->hide();
|
||||||
ui.frame_Distribution->hide();
|
ui.frame_Distribution->hide();
|
||||||
ui.idChooserLabel->hide();
|
ui.idChooserLabel->hide();
|
||||||
ui.idChooser->hide();
|
ui.idChooser->hide();
|
||||||
//ui.toolButton_NewId->hide();
|
//ui.toolButton_NewId->hide();
|
||||||
|
|
||||||
getPgpIdentities();
|
//getPgpIdentities();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateCircleDialog::setupForExternalCircle()
|
void CreateCircleDialog::setupForExternalCircle()
|
||||||
@ -154,7 +151,7 @@ void CreateCircleDialog::setupForExternalCircle()
|
|||||||
mIsExternalCircle = true;
|
mIsExternalCircle = true;
|
||||||
|
|
||||||
/* show distribution line */
|
/* show distribution line */
|
||||||
ui.groupBox_title->setTitle(tr("External Circle Details"));
|
ui.groupBox_title->setTitle(tr("Circle Details"));
|
||||||
ui.frame_PgpTypes->show();
|
ui.frame_PgpTypes->show();
|
||||||
ui.frame_Distribution->show();
|
ui.frame_Distribution->show();
|
||||||
ui.idChooserLabel->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_NICKNAME, nickname);
|
||||||
member->setText(RSCIRCLEID_COL_KEYID, keyId);
|
member->setText(RSCIRCLEID_COL_KEYID, keyId);
|
||||||
member->setText(RSCIRCLEID_COL_IDTYPE, idtype);
|
member->setText(RSCIRCLEID_COL_IDTYPE, idtype);
|
||||||
|
//member->setIcon(RSCIRCLEID_COL_NICKNAME, pixmap);
|
||||||
|
|
||||||
tree->addTopLevelItem(member);
|
tree->addTopLevelItem(member);
|
||||||
}
|
}
|
||||||
@ -522,7 +520,7 @@ void CreateCircleDialog::loadCircle(uint32_t token)
|
|||||||
updateCircleGUI();
|
updateCircleGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateCircleDialog::getPgpIdentities()
|
/*void CreateCircleDialog::getPgpIdentities()
|
||||||
{
|
{
|
||||||
std::cerr << "CreateCircleDialog::getPgpIdentities()";
|
std::cerr << "CreateCircleDialog::getPgpIdentities()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
@ -556,7 +554,7 @@ void CreateCircleDialog::getPgpIdentities()
|
|||||||
}
|
}
|
||||||
|
|
||||||
filterIds();
|
filterIds();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
void CreateCircleDialog::requestGxsIdentities()
|
void CreateCircleDialog::requestGxsIdentities()
|
||||||
@ -616,6 +614,11 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
|||||||
QString keyId = QString::fromStdString(data.mMeta.mGroupId.toStdString());
|
QString keyId = QString::fromStdString(data.mMeta.mGroupId.toStdString());
|
||||||
QString nickname = QString::fromUtf8(data.mMeta.mGroupName.c_str());
|
QString nickname = QString::fromUtf8(data.mMeta.mGroupName.c_str());
|
||||||
QString idtype = tr("Anon Id");
|
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.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID) {
|
||||||
if (data.mPgpKnown) {
|
if (data.mPgpKnown) {
|
||||||
@ -629,6 +632,7 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
|||||||
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||||
item->setText(RSCIRCLEID_COL_NICKNAME, nickname);
|
item->setText(RSCIRCLEID_COL_NICKNAME, nickname);
|
||||||
|
item->setIcon(RSCIRCLEID_COL_NICKNAME, QIcon(pixmap));
|
||||||
item->setText(RSCIRCLEID_COL_KEYID, keyId);
|
item->setText(RSCIRCLEID_COL_KEYID, keyId);
|
||||||
item->setText(RSCIRCLEID_COL_IDTYPE, idtype);
|
item->setText(RSCIRCLEID_COL_IDTYPE, idtype);
|
||||||
tree->addTopLevelItem(item);
|
tree->addTopLevelItem(item);
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
|
|
||||||
void editNewId(bool isExternal);
|
void editNewId(bool isExternal);
|
||||||
void editExistingId(const RsGxsGroupId &circleId, const bool &clearList = true);
|
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 addMember(const RsGxsIdGroup &idGroup);
|
||||||
void addCircle(const RsGxsCircleDetails &cirDetails);
|
void addCircle(const RsGxsCircleDetails &cirDetails);
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ private:
|
|||||||
|
|
||||||
void requestCircle(const RsGxsGroupId &groupId);
|
void requestCircle(const RsGxsGroupId &groupId);
|
||||||
void requestGxsIdentities();
|
void requestGxsIdentities();
|
||||||
void getPgpIdentities();
|
//void getPgpIdentities();
|
||||||
|
|
||||||
void filterIds();
|
void filterIds();
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Known Identities</string>
|
<string>Known People</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
@ -240,7 +240,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="circleName"/>
|
<widget class="QLineEdit" name="circleName">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Circle name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="idChooserLabel">
|
<widget class="QLabel" name="idChooserLabel">
|
||||||
|
@ -298,20 +298,20 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
|
|||||||
mStateHelper->setActive(CIRCLESDIALOG_GROUPMETA, true);
|
mStateHelper->setActive(CIRCLESDIALOG_GROUPMETA, true);
|
||||||
|
|
||||||
/* add the top level item */
|
/* add the top level item */
|
||||||
QTreeWidgetItem *personalCirclesItem = new QTreeWidgetItem();
|
//QTreeWidgetItem *personalCirclesItem = new QTreeWidgetItem();
|
||||||
personalCirclesItem->setText(0, tr("Personal Circles"));
|
//personalCirclesItem->setText(0, tr("Personal Circles"));
|
||||||
ui->treeWidget_membership->addTopLevelItem(personalCirclesItem);
|
//ui->treeWidget_membership->addTopLevelItem(personalCirclesItem);
|
||||||
|
|
||||||
QTreeWidgetItem *externalAdminCirclesItem = new QTreeWidgetItem();
|
QTreeWidgetItem *externalAdminCirclesItem = new QTreeWidgetItem();
|
||||||
externalAdminCirclesItem->setText(0, tr("External Circles (Admin)"));
|
externalAdminCirclesItem->setText(0, tr("Circles (Admin)"));
|
||||||
ui->treeWidget_membership->addTopLevelItem(externalAdminCirclesItem);
|
ui->treeWidget_membership->addTopLevelItem(externalAdminCirclesItem);
|
||||||
|
|
||||||
QTreeWidgetItem *externalSubCirclesItem = new QTreeWidgetItem();
|
QTreeWidgetItem *externalSubCirclesItem = new QTreeWidgetItem();
|
||||||
externalSubCirclesItem->setText(0, tr("External Circles (Subscribed)"));
|
externalSubCirclesItem->setText(0, tr("Circles (Subscribed)"));
|
||||||
ui->treeWidget_membership->addTopLevelItem(externalSubCirclesItem);
|
ui->treeWidget_membership->addTopLevelItem(externalSubCirclesItem);
|
||||||
|
|
||||||
QTreeWidgetItem *externalOtherCirclesItem = new QTreeWidgetItem();
|
QTreeWidgetItem *externalOtherCirclesItem = new QTreeWidgetItem();
|
||||||
externalOtherCirclesItem->setText(0, tr("External Circles (Other)"));
|
externalOtherCirclesItem->setText(0, tr("Circles (Other)"));
|
||||||
ui->treeWidget_membership->addTopLevelItem(externalOtherCirclesItem);
|
ui->treeWidget_membership->addTopLevelItem(externalOtherCirclesItem);
|
||||||
|
|
||||||
for(vit = groupInfo.begin(); vit != groupInfo.end(); ++vit)
|
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)
|
if (vit->mCircleType == GXS_CIRCLE_TYPE_LOCAL)
|
||||||
{
|
{
|
||||||
personalCirclesItem->addChild(groupItem);
|
//personalCirclesItem->addChild(groupItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user