mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-15 16:49:20 -05:00
fixed display of group node restriction in GxsGroupDialog and info
This commit is contained in:
parent
45b189c080
commit
931c3df282
5 changed files with 120 additions and 83 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue