mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
7a2c1347fe
commit
9ebe33c9de
@ -234,13 +234,13 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
|
|||||||
|
|
||||||
if (item && item->type() == TYPE_LOBBY)
|
if (item && item->type() == TYPE_LOBBY)
|
||||||
{
|
{
|
||||||
|
std::list<RsGxsId> own_identities ;
|
||||||
|
rsIdentity->getOwnIds(own_identities) ;
|
||||||
|
|
||||||
if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool())
|
if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool())
|
||||||
contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Leave this lobby"), this, SLOT(unsubscribeItem()));
|
contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Leave this lobby"), this, SLOT(unsubscribeItem()));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::list<RsGxsId> own_identities ;
|
|
||||||
rsIdentity->getOwnIds(own_identities) ;
|
|
||||||
|
|
||||||
QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem();
|
QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem();
|
||||||
uint32_t item_flags = item->data(COLUMN_DATA,ROLE_ID).toUInt() ;
|
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())) ;
|
action->setData(QString::fromStdString((*it).toStdString())) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (item->data(COLUMN_DATA, ROLE_AUTOSUBSCRIBE).toBool())
|
if (item->data(COLUMN_DATA, ROLE_AUTOSUBSCRIBE).toBool())
|
||||||
contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
||||||
else
|
else if(!own_identities.empty())
|
||||||
{
|
|
||||||
if(!own_identities.empty())
|
|
||||||
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
contextMnu.addSeparator();//-------------------------------------------------------------------
|
contextMnu.addSeparator();//-------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user