diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index 0785b683f..e6821a088 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -41,8 +41,8 @@ #define CREATECIRCLEDIALOG_IDINFO 3 #define RSCIRCLEID_COL_NICKNAME 0 -#define RSCIRCLEID_COL_KEYID 1 -#define RSCIRCLEID_COL_IDTYPE 2 +#define RSCIRCLEID_COL_IDTYPE 1 +#define RSCIRCLEID_COL_KEYID 2 /** Constructor */ CreateCircleDialog::CreateCircleDialog() @@ -84,7 +84,7 @@ CreateCircleDialog::CreateCircleDialog() QObject::connect(ui.radioButton_ListAll, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ; QObject::connect(ui.radioButton_ListAllPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ; - QObject::connect(ui.radioButton_ListKnownPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ; + QObject::connect(ui.radioButton_ListFriendPGP, SIGNAL(toggled(bool)), this, SLOT(idTypeChanged())) ; QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ; QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ; @@ -96,9 +96,11 @@ CreateCircleDialog::CreateCircleDialog() mIsExternalCircle = true; mClearList = true; #if QT_VERSION >= 0x040700 - ui.circleName->setPlaceholderText(QApplication::translate("CreateCircleDialog", "Circle name", 0)); + ui.circleName->setPlaceholderText(QApplication::translate("CreateCircleDialog", "Circle name", 0)); #endif + ui.treeWidget_IdList->setColumnHidden(RSCIRCLEID_COL_KEYID,true); // no need to show this. the tooltip will do it. + //ui.idChooser->loadIds(0,RsGxsId()); ui.circleComboBox->loadCircles(RsGxsCircleId()); } @@ -263,7 +265,7 @@ void CreateCircleDialog::addMember(const RsGxsIdGroup &idGroup) { QString keyId = QString::fromStdString(idGroup.mMeta.mGroupId.toStdString()); QString nickname = QString::fromUtf8(idGroup.mMeta.mGroupName.c_str()); - QString idtype = tr("Anon Id"); + QString idtype = tr("[Anonymous Id]"); QPixmap pixmap ; @@ -324,7 +326,7 @@ void CreateCircleDialog::addCircle(const RsGxsCircleDetails &cirDetails) QString keyId = QString::fromStdString(gxs_id.toStdString()); QString nickname = QString::fromUtf8(gxs_details.mNickname.c_str()); - QString idtype = tr("Anon Id"); + QString idtype = tr("[Anonymous Id]"); QPixmap pixmap ; @@ -333,8 +335,8 @@ void CreateCircleDialog::addCircle(const RsGxsCircleDetails &cirDetails) addMember(keyId, idtype, nickname, QIcon(pixmap)); - }//if(!gxs_id.isNull() && rsIdentity->getIdDetails(gxs_id,gxs_details)) - }//for (itUnknownPeers it = cirDetails.mUnknownPeers.begin() + } + } typedef std::set::const_iterator itAllowedPeers; for (itAllowedPeers it = cirDetails.mAllowedNodes.begin() ; it != cirDetails.mAllowedNodes.end() ; ++it ) @@ -352,8 +354,8 @@ void CreateCircleDialog::addCircle(const RsGxsCircleDetails &cirDetails) addMember(keyId, idtype, nickname, QIcon(avatar)); - }//if(!gpg_id.isNull() && rsPeers->getGPGDetails(gpg_id,details)) - }//for (itAllowedPeers it = cirDetails.mAllowedPeers.begin() + } + } } void CreateCircleDialog::removeMember() @@ -385,7 +387,7 @@ void CreateCircleDialog::createCircle() QMessageBox::warning(this, tr("RetroShare"),tr("Please set a name for your Circle"), QMessageBox::Ok, QMessageBox::Ok); return; //Don't add a empty Subject!! - }//if(name.isEmpty()) + } RsGxsCircleGroup circle = mCircleGroup; // init with loaded group @@ -459,16 +461,6 @@ void CreateCircleDialog::createCircle() } - // if (mIsExistingCircle) - // { - // std::cerr << "CreateCircleDialog::createCircle() Existing Circle TODO"; - // std::cerr << std::endl; - // - // // cannot edit these yet. - // QMessageBox::warning(this, tr("RetroShare"),tr("Cannot Edit Existing Circles Yet"), QMessageBox::Ok, QMessageBox::Ok); - // return; - // } - if (mIsExternalCircle) { #ifdef DEBUG_CREATE_CIRCLE_DIALOG @@ -742,22 +734,20 @@ void CreateCircleDialog::fillIdentitiesList(const std::vector& id_ QTreeWidget *tree = ui.treeWidget_IdList; tree->clear(); - bool acceptAnonymous = ui.radioButton_ListAll->isChecked(); - bool acceptAllPGP = ui.radioButton_ListAllPGP->isChecked(); - //bool acceptKnownPGP = ui.radioButton_ListKnownPGP->isChecked(); + bool acceptAll = ui.radioButton_ListAll->isChecked(); + bool acceptOnlySignedIdentities = ui.radioButton_ListAllPGP->isChecked(); + bool acceptOnlyIdentitiesSignedByFriend = ui.radioButton_ListFriendPGP->isChecked(); for(const auto& idGroup:id_groups) { + bool isSigned = !idGroup.mPgpId.isNull(); + bool isSignedByFriendNode = isSigned && rsPeers->isPgpFriend(idGroup.mPgpId); + /* do filtering */ bool ok = false; - if (acceptAnonymous) - ok = true; - else if (acceptAllPGP) - ok = idGroup.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility ; - else if (idGroup.mPgpKnown) - ok = idGroup.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility ; - if (!ok) { + if(!(acceptAll ||(acceptOnlySignedIdentities && isSigned) ||(acceptOnlyIdentitiesSignedByFriend && isSignedByFriendNode))) + { #ifdef DEBUG_CREATE_CIRCLE_DIALOG std::cerr << "CreateCircleDialog::insertIdentities() Skipping ID: " << data.mMeta.mGroupId; std::cerr << std::endl; @@ -767,23 +757,21 @@ void CreateCircleDialog::fillIdentitiesList(const std::vector& id_ QString keyId = QString::fromStdString(idGroup.mMeta.mGroupId.toStdString()); QString nickname = QString::fromUtf8(idGroup.mMeta.mGroupName.c_str()); - QString idtype = tr("Anon Id"); + QString idtype ; QPixmap pixmap ; if(idGroup.mImage.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idGroup.mImage.mData, idGroup.mImage.mSize, pixmap, GxsIdDetails::SMALL)) pixmap = GxsIdDetails::makeDefaultIcon(RsGxsId(idGroup.mMeta.mGroupId),GxsIdDetails::SMALL) ; - if (idGroup.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) + if (!idGroup.mPgpId.isNull()) { - if (idGroup.mPgpKnown) { - RsPeerDetails details; - rsPeers->getGPGDetails(idGroup.mPgpId, details); - idtype = QString::fromUtf8(details.name.c_str()); - } - else - idtype = tr("PGP Linked Id"); + RsPeerDetails details; + if(rsPeers->getGPGDetails(idGroup.mPgpId, details)) + idtype = QString::fromUtf8(details.name.c_str()); + else + idtype = tr("[Unknown]"); } QTreeWidgetItem *item = new QTreeWidgetItem(); @@ -793,6 +781,11 @@ void CreateCircleDialog::fillIdentitiesList(const std::vector& id_ item->setText(RSCIRCLEID_COL_IDTYPE, idtype); tree->addTopLevelItem(item); + RsIdentityDetails det; + + if(rsIdentity->getIdDetails(RsGxsId(idGroup.mMeta.mGroupId),det)) + item->setToolTip(RSCIRCLEID_COL_NICKNAME,GxsIdDetails::getComment(det)); + // External Circle. if (mIsExistingCircle) { diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui index 8e3b5ed2e..773980cc7 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui @@ -6,8 +6,8 @@ 0 0 - 600 - 500 + 1211 + 647 @@ -161,12 +161,7 @@ - ID - - - - - Type + Profile @@ -210,9 +205,9 @@ - + - Signed by known nodes + Signed by friend node @@ -411,7 +406,7 @@ <html><head/><body><p>Circles can be restricted to the members of another circle. Only the members of that second circle will be allowed to see the new circle and its content (list of members, etc).</p></body></html> - Only visible to members of: + Only &visible to members of: @@ -455,6 +450,11 @@ + + GxsIdChooser + QComboBox +
gui/gxs/GxsIdChooser.h
+
LineEditClear QLineEdit @@ -471,11 +471,6 @@
gui/common/HeaderFrame.h
1
- - GxsIdChooser - QComboBox -
gui/gxs/GxsIdChooser.h
-
GxsCircleChooser QComboBox