mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
fixed display of group node restriction in GxsGroupDialog and info
This commit is contained in:
parent
45b189c080
commit
931c3df282
@ -44,14 +44,20 @@ void GroupChooser::loadGroups(uint32_t chooserFlags, const RsNodeGroupId& defaul
|
||||
}
|
||||
|
||||
|
||||
static bool MakeNodeGroupDesc(const RsGroupInfo& info, QString &desc)
|
||||
bool GroupChooser::makeNodeGroupDesc(const RsGroupInfo& info, QString &desc)
|
||||
{
|
||||
desc.clear();
|
||||
desc = QString::fromUtf8(info.name.c_str());
|
||||
|
||||
desc += " (Node group) [";
|
||||
desc += QString::fromStdString(info.id.toStdString().substr(0,5));
|
||||
desc += "...]";
|
||||
if(info.name.empty())
|
||||
desc = tr("[Unknown]") ;
|
||||
else
|
||||
desc = "\"" + QString::fromUtf8(info.name.c_str()) + "\"";
|
||||
|
||||
desc += " [" ;
|
||||
desc += QString::fromStdString(info.id.toStdString().substr(0,3));
|
||||
desc += "...";
|
||||
desc += QString::fromStdString(info.id.toStdString().substr(info.id.toStdString().length()-2,2));
|
||||
desc += "]";
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -76,7 +82,7 @@ void GroupChooser::loadGroups()
|
||||
{
|
||||
/* add to Chooser */
|
||||
QString str;
|
||||
if (!MakeNodeGroupDesc(*it, str))
|
||||
if (!makeNodeGroupDesc(*it, str))
|
||||
{
|
||||
std::cerr << "GroupChooser::loadGroups() ERROR Desc for Id: " << it->id;
|
||||
std::cerr << std::endl;
|
||||
|
@ -25,7 +25,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QComboBox>
|
||||
#include <retroshare/rsgxscircles.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
class GroupChooser : public QComboBox
|
||||
{
|
||||
@ -35,6 +35,7 @@ public:
|
||||
void loadGroups(uint32_t chooserFlags, const RsNodeGroupId& defaultId);
|
||||
bool getChosenGroup(RsNodeGroupId& id);
|
||||
|
||||
static bool makeNodeGroupDesc(const RsGroupInfo& info, QString &desc);
|
||||
private:
|
||||
void loadGroups();
|
||||
uint32_t mFlags;
|
||||
|
@ -440,11 +440,21 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
|
||||
switch(mGrpMeta.mCircleType)
|
||||
{
|
||||
case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY:
|
||||
{
|
||||
ui.typeLocal->setChecked(true);
|
||||
distribution_string = tr("Your friends only") ;
|
||||
distribution_string = tr("Only friends nodes in group ") ;
|
||||
|
||||
RsGroupInfo ginfo ;
|
||||
rsPeers->getGroupInfo(RsNodeGroupId(mGrpMeta.mInternalCircle),ginfo) ;
|
||||
|
||||
QString desc;
|
||||
GroupChooser::makeNodeGroupDesc(ginfo, desc);
|
||||
distribution_string += desc ;
|
||||
|
||||
ui.localComboBox->loadGroups(0, RsNodeGroupId(mGrpMeta.mInternalCircle));
|
||||
ui.distributionCircleComboBox->setVisible(false) ;
|
||||
ui.localComboBox->setVisible(true) ;
|
||||
}
|
||||
break;
|
||||
case GXS_CIRCLE_TYPE_PUBLIC:
|
||||
ui.typePublic->setChecked(true);
|
||||
|
@ -301,6 +301,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Messsages will spread way beyond your friend nodes, as long as people subscribe to the channel/forum/posted you're creating.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Public</string>
|
||||
</property>
|
||||
@ -326,6 +329,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Messages will spread among Retroshare nodes that host one of the identities listed as member of the circle and who also subscribe the media. Only these nodes will be able to see that this forum/channel/posted media exists. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restricted to Circle</string>
|
||||
</property>
|
||||
@ -356,6 +362,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Messages will only be distributed to the selected subset of your friend nodes. They will not forward messages with each other, but only use your own node as a central hub to distribute them.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Only For Your Friends</string>
|
||||
</property>
|
||||
|
@ -817,9 +817,20 @@ void GxsForumThreadWidget::insertGroupData()
|
||||
distrib_string = tr("Restricted to members of circle ")+QString::fromStdString(group.mMeta.mCircleId.toStdString()) ;
|
||||
}
|
||||
break ;
|
||||
case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY: distrib_string = tr("Your eyes only");
|
||||
case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY:
|
||||
{
|
||||
distrib_string = tr("Only friends nodes in group ") ;
|
||||
|
||||
RsGroupInfo ginfo ;
|
||||
rsPeers->getGroupInfo(RsNodeGroupId(group.mMeta.mInternalCircle),ginfo) ;
|
||||
|
||||
QString desc;
|
||||
GroupChooser::makeNodeGroupDesc(ginfo, desc);
|
||||
distrib_string += desc ;
|
||||
}
|
||||
break ;
|
||||
case GXS_CIRCLE_TYPE_LOCAL: distrib_string = tr("You and your friend nodes");
|
||||
|
||||
case GXS_CIRCLE_TYPE_LOCAL: distrib_string = tr("Your eyes only"); // this is not yet supported. If you see this, it is a bug!
|
||||
break ;
|
||||
default:
|
||||
std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user