mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 07:47:03 -05:00
Added Ban/Unban Context menu actions for People list.
This commit is contained in:
parent
5404cda302
commit
4dacd9a54d
@ -950,6 +950,29 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
||||
}
|
||||
|
||||
contextMnu.addAction(QIcon(":/images/mail_new.png"), tr("Send message to this person"), this, SLOT(sendMsg()));
|
||||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
RsReputations::ReputationInfo info ;
|
||||
std::string Id = item->text(RSID_COL_KEYID).toStdString();
|
||||
rsReputations->getReputationInfo(RsGxsId(Id),info) ;
|
||||
|
||||
|
||||
QAction *banaction = contextMnu.addAction(QIcon(":/images/denied16.png"), tr("Ban this person"), this, SLOT(banPerson()));
|
||||
QAction *unbanaction = contextMnu.addAction(QIcon(), tr("Unban this person"), this, SLOT(unbanPerson()));
|
||||
|
||||
|
||||
if(info.mAssessment == RsReputations::ASSESSMENT_BAD)
|
||||
{
|
||||
banaction->setVisible(false);
|
||||
unbanaction->setVisible(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
banaction->setVisible(true);
|
||||
unbanaction->setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1008,3 +1031,35 @@ void IdDialog::sendMsg()
|
||||
/* window will destroy itself! */
|
||||
|
||||
}
|
||||
|
||||
void IdDialog::banPerson()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (!item)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::string Id = item->text(RSID_COL_KEYID).toStdString();
|
||||
|
||||
rsReputations->setOwnOpinion(RsGxsId(Id),RsReputations::OPINION_NEGATIVE) ;
|
||||
|
||||
requestIdDetails();
|
||||
requestIdList();
|
||||
}
|
||||
|
||||
void IdDialog::unbanPerson()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (!item)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::string Id = item->text(RSID_COL_KEYID).toStdString();
|
||||
|
||||
rsReputations->setOwnOpinion(RsGxsId(Id),RsReputations::OPINION_POSITIVE) ;
|
||||
|
||||
requestIdDetails();
|
||||
requestIdList();
|
||||
}
|
||||
|
@ -75,6 +75,9 @@ private slots:
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void IdListCustomPopupMenu( QPoint point );
|
||||
|
||||
void banPerson();
|
||||
void unbanPerson();
|
||||
|
||||
private:
|
||||
void processSettings(bool load);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user