Added count Invited Members to Create Circles Dialog.

Changed some context menu icons for People list and Circles tree.
Added icon when im Circle Admin.
This commit is contained in:
defnax 2016-06-15 00:08:45 +02:00
parent 56e079739c
commit 69e98b8e2d
5 changed files with 47 additions and 13 deletions

View File

@ -298,6 +298,8 @@ void CreateCircleDialog::addMember(const QString& keyId, const QString& idtype,
//member->setIcon(RSCIRCLEID_COL_NICKNAME, pixmap); //member->setIcon(RSCIRCLEID_COL_NICKNAME, pixmap);
tree->addTopLevelItem(member); tree->addTopLevelItem(member);
ui.members_groupBox->setTitle( tr("Invited Members") + " (" + QString::number(ui.treeWidget_membership->topLevelItemCount()) + ")" );
} }
/** Maybe we can use RsGxsCircleGroup instead of RsGxsCircleDetails ??? (TODO)**/ /** Maybe we can use RsGxsCircleGroup instead of RsGxsCircleDetails ??? (TODO)**/

View File

@ -14,7 +14,16 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -42,7 +51,7 @@
<item row="1" column="0"> <item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="members_groupBox">
<property name="title"> <property name="title">
<string>Invited Members</string> <string>Invited Members</string>
</property> </property>
@ -174,7 +183,16 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -335,7 +353,16 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<property name="margin"> <property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">

View File

@ -100,6 +100,8 @@
#define IMAGE_INVITED ":/icons/bullet_yellow_128.png" #define IMAGE_INVITED ":/icons/bullet_yellow_128.png"
#define IMAGE_MEMBER ":/icons/bullet_green_128.png" #define IMAGE_MEMBER ":/icons/bullet_green_128.png"
#define IMAGE_UNKNOWN ":/icons/bullet_grey_128.png" #define IMAGE_UNKNOWN ":/icons/bullet_grey_128.png"
#define IMAGE_ADMIN ":/icons/bullet_blue_128.png"
#define IMAGE_INFO ":/images/info16.png"
// comment this out in order to remove the sorting of circles into "belong to" and "other visible circles" // comment this out in order to remove the sorting of circles into "belong to" and "other visible circles"
#define CIRCLE_MEMBERSHIP_CATEGORIES 1 #define CIRCLE_MEMBERSHIP_CATEGORIES 1
@ -399,7 +401,7 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
if(!mExternalOtherCircleItem) if(!mExternalOtherCircleItem)
{ {
mExternalOtherCircleItem = new QTreeWidgetItem(); mExternalOtherCircleItem = new QTreeWidgetItem();
mExternalOtherCircleItem->setText(0, tr("Other visible external circles")); mExternalOtherCircleItem->setText(0, tr("Other circles"));
ui->treeWidget_membership->addTopLevelItem(mExternalOtherCircleItem); ui->treeWidget_membership->addTopLevelItem(mExternalOtherCircleItem);
} }
@ -407,7 +409,7 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
if(!mExternalBelongingCircleItem ) if(!mExternalBelongingCircleItem )
{ {
mExternalBelongingCircleItem = new QTreeWidgetItem(); mExternalBelongingCircleItem = new QTreeWidgetItem();
mExternalBelongingCircleItem->setText(0, tr("External circles my identities belong to")); mExternalBelongingCircleItem->setText(0, tr("Circles I belong to"));
ui->treeWidget_membership->addTopLevelItem(mExternalBelongingCircleItem); ui->treeWidget_membership->addTopLevelItem(mExternalBelongingCircleItem);
} }
#endif #endif
@ -698,6 +700,8 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
if(am_I_in_circle) if(am_I_in_circle)
item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(IMAGE_MEMBER)) ; item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(IMAGE_MEMBER)) ;
else if(am_I_admin)
item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(IMAGE_ADMIN)) ;
else if(am_I_invited || am_I_pending) else if(am_I_invited || am_I_pending)
item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(IMAGE_INVITED)) ; item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(IMAGE_INVITED)) ;
else else
@ -963,7 +967,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint )
am_I_circle_admin = true ; am_I_circle_admin = true ;
} }
else else
contextMnu.addAction(QIcon(IMAGE_EDIT), tr("See details"), this, SLOT(showEditExistingCircle())); contextMnu.addAction(QIcon(IMAGE_INFO), tr("See details"), this, SLOT(showEditExistingCircle()));
#ifdef CIRCLE_MEMBERSHIP_CATEGORIES #ifdef CIRCLE_MEMBERSHIP_CATEGORIES
} }
#endif #endif
@ -1001,7 +1005,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint )
static const int CANCEL = 3 ; // Admin list: no Subscription request: yes static const int CANCEL = 3 ; // Admin list: no Subscription request: yes
const QString menu_titles[4] = { tr("Request subscription"), tr("Accept circle invitation"), tr("Quit this circle"),tr("Cancel subscribe request")} ; const QString menu_titles[4] = { tr("Request subscription"), tr("Accept circle invitation"), tr("Quit this circle"),tr("Cancel subscribe request")} ;
const QString image_names[4] = { ":/images/edit_16.png",":/images/edit_16.png",":/images/edit_16.png",":/images/edit_16.png" } ; const QString image_names[4] = { ":/images/edit_add24.png",":/images/accepted16.png",":/images/door_in.png",":/images/cancel.png" } ;
std::vector< std::vector<RsGxsId> > ids(4) ; std::vector< std::vector<RsGxsId> > ids(4) ;
@ -1040,7 +1044,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint )
RsIdentityDetails det ; RsIdentityDetails det ;
QString id_name ; QString id_name ;
if(rsIdentity->getIdDetails(ids[i][0],det)) if(rsIdentity->getIdDetails(ids[i][0],det))
id_name = tr("for identity ")+QString::fromUtf8(det.mNickname.c_str()) + "(ID=" + QString::fromStdString(ids[i][0].toStdString()) + ")" ; id_name = tr("for identity ")+QString::fromUtf8(det.mNickname.c_str()) + " (ID=" + QString::fromStdString(ids[i][0].toStdString()) + ")" ;
else else
id_name = tr("for identity ")+QString::fromStdString(ids[i][0].toStdString()) ; id_name = tr("for identity ")+QString::fromStdString(ids[i][0].toStdString()) ;
@ -1068,7 +1072,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint )
RsIdentityDetails det ; RsIdentityDetails det ;
QString id_name ; QString id_name ;
if(rsIdentity->getIdDetails(ids[i][j],det)) if(rsIdentity->getIdDetails(ids[i][j],det))
id_name = tr("for identity ")+QString::fromUtf8(det.mNickname.c_str()) + "(ID=" + QString::fromStdString(ids[i][j].toStdString()) + ")" ; id_name = tr("for identity ")+QString::fromUtf8(det.mNickname.c_str()) + " (ID=" + QString::fromStdString(ids[i][j].toStdString()) + ")" ;
else else
id_name = tr("for identity ")+QString::fromStdString(ids[i][j].toStdString()) ; id_name = tr("for identity ")+QString::fromStdString(ids[i][j].toStdString()) ;
@ -2073,13 +2077,13 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
contextMnu.addSeparator(); contextMnu.addSeparator();
if(n_positive_reputations == 0) // only unban when all items are banned if(n_positive_reputations == 0) // only unban when all items are banned
contextMnu.addAction(QIcon(), tr("Set positive opinion"), this, SLOT(positivePerson())); contextMnu.addAction(QIcon(":/images/vote_up.png"), tr("Set positive opinion"), this, SLOT(positivePerson()));
if(n_neutral_reputations == 0) // only unban when all items are banned if(n_neutral_reputations == 0) // only unban when all items are banned
contextMnu.addAction(QIcon(), tr("Set neutral opinion"), this, SLOT(neutralPerson())); contextMnu.addAction(QIcon(":/images/vote_neutral.png"), tr("Set neutral opinion"), this, SLOT(neutralPerson()));
if(n_negative_reputations == 0) if(n_negative_reputations == 0)
contextMnu.addAction(QIcon(":/images/denied16.png"), tr("Set negative opinion"), this, SLOT(negativePerson())); contextMnu.addAction(QIcon(":/images/vote_down.png"), tr("Set negative opinion"), this, SLOT(negativePerson()));
} }
if(one_item_owned_by_you && n_selected_items==1) if(one_item_owned_by_you && n_selected_items==1)

View File

@ -554,6 +554,7 @@
<file>images/view_split_top_bottom.png</file> <file>images/view_split_top_bottom.png</file>
<file>images/vote_up.png</file> <file>images/vote_up.png</file>
<file>images/vote_down.png</file> <file>images/vote_down.png</file>
<file>images/vote_neutral.png</file>
<file>images/window_fullscreen.png</file> <file>images/window_fullscreen.png</file>
<file>images/window_nofullscreen.png</file> <file>images/window_nofullscreen.png</file>
<file>images/identity/identities_32.png</file> <file>images/identity/identities_32.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB