From ef4a29d4d4e130f1b40e161006bbfe04cdd58d02 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 6 Jan 2019 15:56:39 +0100 Subject: [PATCH] Improved Display of Moderator selection box on a useable place * Improved Author & Moderator labels display as link * Improved display of moderator selection box display on right side * Added own tree item "My Circles" to see your own circles easyer then before when you are admin. * Profile generation dialog moved node type box to advanced section. --- retroshare-gui/src/gui/GenCertDialog.cpp | 4 + retroshare-gui/src/gui/GenCertDialog.ui | 247 +++++++++-------- retroshare-gui/src/gui/Identity/IdDialog.cpp | 18 +- retroshare-gui/src/gui/Identity/IdDialog.h | 1 + retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp | 45 ++- retroshare-gui/src/gui/gxs/GxsGroupDialog.h | 1 + retroshare-gui/src/gui/gxs/GxsGroupDialog.ui | 260 ++++++++++-------- 7 files changed, 336 insertions(+), 240 deletions(-) diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index 7581c4a2a..eb678370b 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -324,6 +324,10 @@ void GenCertDialog::setupState() ui.keylength_label->setVisible(adv_state); ui.keylength_comboBox->setVisible(adv_state); + ui.nodeType_CB->setVisible(adv_state); + ui.nodeTypeExplanation_TE->setVisible(adv_state); + ui.nodetype_label->setVisible(adv_state); + ui.entropy_bar->setVisible(true); ui.genButton->setVisible(true); diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui index 6c030db02..64d09328f 100644 --- a/retroshare-gui/src/gui/GenCertDialog.ui +++ b/retroshare-gui/src/gui/GenCertDialog.ui @@ -6,8 +6,8 @@ 0 0 - 978 - 826 + 633 + 532 @@ -69,44 +69,6 @@ - - - - - 75 - true - - - - Node type: - - - - - - - - 0 - 0 - - - - - Standard node - - - - - Hidden node (over Tor) - - - - - Hidden node (Tor/I2P - Manually configured) - - - - @@ -168,6 +130,13 @@ + + + + + + + @@ -184,7 +153,7 @@ - + @@ -206,10 +175,19 @@ - - - - + + + + + 0 + 0 + + + + <html><head/><body><p>Please move your mouse around in order to collect as much randomness as possible. A minimum of 20% is needed to create your node keys.</p></body></html> + + + 24 @@ -241,23 +219,7 @@ - - - - - 0 - 0 - - - - <html><head/><body><p>Please move your mouse around in order to collect as much randomness as possible. A minimum of 20% is needed to create your node keys.</p></body></html> - - - 24 - - - - + @@ -413,7 +375,29 @@ - + + + + + 24 + 24 + + + + + + + :/icons/svg/person.svg + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + 6 @@ -484,6 +468,13 @@ + + + + + + + @@ -497,7 +488,7 @@ - + @@ -530,35 +521,6 @@ - - - - - - - - - - - - 24 - 24 - - - - - - - :/icons/svg/person.svg - - - true - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - @@ -584,6 +546,31 @@ + + + + + 24 + 24 + + + + This password is for PGP + + + + + + :/icons/svg/password.svg + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + @@ -628,31 +615,6 @@ - - - - - 24 - 24 - - - - This password is for PGP - - - - - - :/icons/svg/password.svg - - - true - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - @@ -678,7 +640,7 @@ - + @@ -700,6 +662,53 @@ + + + + + 0 + 0 + + + + + Standard node + + + + + Hidden node (over Tor) + + + + + Hidden node (Tor/I2P - Manually configured) + + + + + + + + + 24 + 26 + + + + Node type + + + + + + :/icons/png/settings.png + + + true + + + diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 464a4fe10..48bc4682a 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -165,7 +165,8 @@ IdDialog::IdDialog(QWidget *parent) : ui->treeWidget_membership->clear(); - mExternalOtherCircleItem = NULL ; + mMyCircleItem = NULL ; + mExternalOtherCircleItem = NULL ; mExternalBelongingCircleItem = NULL ; /* Setup UI helper */ @@ -505,6 +506,12 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token) //ui->treeWidget_membership->addTopLevelItem(personalCirclesItem); #ifdef CIRCLE_MEMBERSHIP_CATEGORIES + if(!mMyCircleItem ) + { + mMyCircleItem = new QTreeWidgetItem(); + mMyCircleItem->setText(0, tr("My Circles")); + ui->treeWidget_membership->addTopLevelItem(mMyCircleItem); + } if(!mExternalOtherCircleItem) { mExternalOtherCircleItem = new QTreeWidgetItem(); @@ -599,7 +606,14 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token) item->setData(CIRCLEGROUP_CIRCLE_COL_GROUPFLAGS, Qt::UserRole, QVariant(vit->mSubscribeFlags)); #ifdef CIRCLE_MEMBERSHIP_CATEGORIES - if(am_I_in_circle) + if(am_I_admin) + { +#ifdef ID_DEBUG + std::cerr << " adding item for circle " << vit->mGroupId << " to own circles"<< std::endl; +#endif + mMyCircleItem->addChild(item); + } + else if(am_I_in_circle) { #ifdef ID_DEBUG std::cerr << " adding item for circle " << vit->mGroupId << " to own circles"<< std::endl; diff --git a/retroshare-gui/src/gui/Identity/IdDialog.h b/retroshare-gui/src/gui/Identity/IdDialog.h index 5d6d4c825..30f2d0641 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.h +++ b/retroshare-gui/src/gui/Identity/IdDialog.h @@ -149,6 +149,7 @@ private: QTreeWidgetItem *ownItem; QTreeWidgetItem *mExternalBelongingCircleItem; QTreeWidgetItem *mExternalOtherCircleItem; + QTreeWidgetItem *mMyCircleItem; RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ; std::map mCircleUpdates ; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index 1bb448d60..4bf950a5e 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -24,6 +24,7 @@ #include "util/DateTime.h" #include "GxsGroupDialog.h" #include "gui/common/PeerDefs.h" +#include "gui/RetroShareLink.h" #include "retroshare/rsgxsflags.h" #include @@ -35,6 +36,7 @@ #include + // Control of Publish Signatures. // // These are now defined in rsgxsflags.h @@ -99,6 +101,8 @@ void GxsGroupDialog::init() connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(cancelDialog())); connect(ui.pubKeyShare_cb, SIGNAL(clicked()), this, SLOT(setShareList())); connect(ui.addAdmins_cb, SIGNAL(clicked()), this, SLOT(setAdminsList())); + connect(ui.filtercomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged(int))); + connect(ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo())); connect(ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo())); @@ -119,8 +123,14 @@ void GxsGroupDialog::init() if (!ui.addAdmins_cb->isChecked()) { ui.adminsList->hide(); + ui.filtercomboBox->hide(); //this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height()); } + + /* Add filter types */ + ui.filtercomboBox->addItem(tr("All People")); + ui.filtercomboBox->addItem(tr("My Contacts")); + ui.filtercomboBox->setCurrentIndex(0); /* initialize key share list */ ui.shareKeyList->setHeaderText(tr("Contacts:")); @@ -132,6 +142,7 @@ void GxsGroupDialog::init() ui.adminsList->setModus(FriendSelectionWidget::MODUS_CHECK); ui.adminsList->setShowType(FriendSelectionWidget::SHOW_GXS); ui.adminsList->start(); + /* Setup Reasonable Defaults */ @@ -442,6 +453,8 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description) setupReadonly(); clearForm(); setGroupSignFlags(mGrpMeta.mSignFlags) ; + + RetroShareLink link; /* setup name */ ui.groupName->setText(QString::fromUtf8(mGrpMeta.mGroupName.c_str())); @@ -455,6 +468,10 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description) else ui.lastpostline->setText(DateTime::formatLongDateTime(mGrpMeta.mLastPost)); ui.authorLabel->setId(mGrpMeta.mAuthorId); + + link = RetroShareLink::createMessage(mGrpMeta.mAuthorId, ""); + ui.authorLabel->setText(link.toHtml()); + ui.IDline->setText(QString::fromStdString(mGrpMeta.mGroupId.toStdString())); ui.descriptiontextEdit->setPlainText(description); @@ -869,6 +886,7 @@ void GxsGroupDialog::setSelectedModerators(const std::set& ids) QString moderatorsListString ; RsIdentityDetails det; + RetroShareLink link; for(auto it(ids.begin());it!=ids.end();++it) { @@ -877,9 +895,15 @@ void GxsGroupDialog::setSelectedModerators(const std::set& ids) if(!moderatorsListString.isNull()) moderatorsListString += ", " ; - moderatorsListString += det.mNickname.empty()?("[Unknown]"):QString::fromStdString(det.mNickname) ; - } + if(det.mNickname.empty()) + moderatorsListString += "[Unknown]"; + + link = RetroShareLink::createMessage(det.mId, ""); + if (link.valid()) + moderatorsListString += link.toHtml() + " "; + } + //ui.moderatorsLabel->setId(det.mId); ui.moderatorsLabel->setText(moderatorsListString); } @@ -898,10 +922,12 @@ void GxsGroupDialog::setAdminsList() { //this->resize(this->size().width() + ui.contactsdockWidget->size().width(), this->size().height()); ui.adminsList->show(); + ui.filtercomboBox->show(); } else { // hide share widget ui.adminsList->hide(); + ui.filtercomboBox->hide(); //this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height()); } } @@ -921,6 +947,21 @@ void GxsGroupDialog::setShareList() // } } +void GxsGroupDialog::filterComboBoxChanged(int i) +{ + switch(i) + { + default: + case 0: + ui.adminsList->setShowType(FriendSelectionWidget::SHOW_GXS); + break; + case 1: + ui.adminsList->setShowType(FriendSelectionWidget::SHOW_CONTACTS); + break; + } +} + + /*********************************************************************************** Loading Group. ***********************************************************************************/ diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h index 09c96616a..13cde700f 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h @@ -163,6 +163,7 @@ private: protected slots: void submitGroup(); void addGroupLogo(); + void filterComboBoxChanged(int); protected: virtual void showEvent(QShowEvent*); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui b/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui index 43b351edc..3cd4a50c6 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.ui @@ -6,8 +6,8 @@ 0 0 - 1237 - 1206 + 600 + 736 @@ -48,7 +48,10 @@ - + + 0 + + @@ -187,6 +190,10 @@ Add moderators + + + :/icons/settings/permissions.svg:/icons/settings/permissions.svg + @@ -349,7 +356,20 @@ - + + + + + + + + + + + + + + Description @@ -361,7 +381,7 @@ - + Publish Signatures @@ -399,7 +419,7 @@ - Re&quired + Required @@ -426,7 +446,7 @@ - + Personal Signatures @@ -469,7 +489,7 @@ - + Comments @@ -520,7 +540,7 @@ - + Spam-protection @@ -571,7 +591,7 @@ - + QFrame::StyledPanel @@ -581,16 +601,13 @@ - - - - - - + + 0 + @@ -599,14 +616,111 @@ - + + + + Distribution: + + + + + + + TextLabel + + + true + + + + + + + Name + + + + + + + Last Post + + + + + + + Popularity + + + + + + + + + + true + + + + + + + true + + + + + + + Posts + + + + Moderators: - + + + + true + + + + + + + true + + + + + + + ID + + + + + + + Comments: + + + + + + + Anti Spam: + + + + @@ -627,132 +741,44 @@ - - - - - - - true - - - - - - - true - - - - - - - Posts - - - - - - - GxsIdLabel - - - - - - - ID - - - - - - - true - - - - + Author - + TextLabel - + true - - - - Comments: - - - - + TextLabel - - - - - - Distribution: - - - - - - - Anti Spam: - - - - - - - Last Post - - - - - - - Name - - - - - - - Popularity - - - - - - + true - + - TextLabel + GxsIdLabel + + + true @@ -855,8 +881,8 @@ - +