mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 21:34:10 -05:00
gui: do not attempt to create context menu if idlist is empty
...and other side effects
This commit is contained in:
parent
57cff61873
commit
4eb060e154
@ -246,8 +246,8 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
|
||||
|
||||
void ChatLobbyDialog::textBrowserAskContextMenu(QMenu* contextMnu, QString anchorForPosition, const QPoint /*point*/)
|
||||
{
|
||||
if (anchorForPosition.startsWith(PERSONID)){
|
||||
QString strId = anchorForPosition.replace(PERSONID,"");
|
||||
if (anchorForPosition.startsWith(PERSONID)) {
|
||||
QString strId = anchorForPosition.replace(PERSONID, "");
|
||||
if (strId.contains(" "))
|
||||
strId.truncate(strId.indexOf(" "));
|
||||
|
||||
@ -263,6 +263,8 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
|
||||
{
|
||||
if (!contextMnu)
|
||||
return;
|
||||
if (idList.isEmpty())
|
||||
return;
|
||||
|
||||
contextMnu->addAction(distantChatAct);
|
||||
contextMnu->addAction(sendMessageAct);
|
||||
@ -281,7 +283,7 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
|
||||
votePositiveAct->setEnabled(false);
|
||||
voteNeutralAct->setEnabled(false);
|
||||
voteNegativeAct->setEnabled(false);
|
||||
showInPeopleAct->setEnabled(idList.count()==1);
|
||||
showInPeopleAct->setEnabled(idList.count() == 1);
|
||||
|
||||
distantChatAct->setData(QVariant::fromValue(idList));
|
||||
sendMessageAct->setData(QVariant::fromValue(idList));
|
||||
@ -291,8 +293,6 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
|
||||
voteNegativeAct->setData(QVariant::fromValue(idList));
|
||||
showInPeopleAct->setData(QVariant::fromValue(idList));
|
||||
|
||||
if(idList.count()==1)
|
||||
{
|
||||
RsGxsId gxsid = idList.at(0);
|
||||
|
||||
if(!gxsid.isNull() && !rsIdentity->isOwnId(gxsid))
|
||||
@ -304,7 +304,6 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QList<RsGxs
|
||||
muteAct->setEnabled(true);
|
||||
muteAct->setChecked(isParticipantMuted(gxsid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::voteParticipant()
|
||||
|
Loading…
x
Reference in New Issue
Block a user