fixed chat lobby context menu to allow to toggle auto subscribe

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8157 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-04-22 17:33:53 +00:00
parent 7a2c1347fe
commit 9ebe33c9de

View File

@ -234,13 +234,13 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
if (item && item->type() == TYPE_LOBBY)
{
std::list<RsGxsId> own_identities ;
rsIdentity->getOwnIds(own_identities) ;
if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool())
contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Leave this lobby"), this, SLOT(unsubscribeItem()));
else
{
std::list<RsGxsId> own_identities ;
rsIdentity->getOwnIds(own_identities) ;
QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem();
uint32_t item_flags = item->data(COLUMN_DATA,ROLE_ID).toUInt() ;
@ -271,16 +271,12 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
action->setData(QString::fromStdString((*it).toStdString())) ;
}
}
}
if (item->data(COLUMN_DATA, ROLE_AUTOSUBSCRIBE).toBool())
contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem()));
else
{
if(!own_identities.empty())
if (item->data(COLUMN_DATA, ROLE_AUTOSUBSCRIBE).toBool())
contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem()));
else if(!own_identities.empty())
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem()));
}
}
}
contextMnu.addSeparator();//-------------------------------------------------------------------