mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
Disable some usercontextmenu actions if the user is offline; fix #234
This commit is contained in:
parent
ea897ee2ef
commit
fe12f71b93
4 changed files with 9 additions and 7 deletions
|
|
@ -102,7 +102,7 @@ void UserContextMenu::banUser_dialogFinished()
|
|||
client->sendCommand(client->prepareModeratorCommand(cmd));
|
||||
}
|
||||
|
||||
void UserContextMenu::showContextMenu(const QPoint &pos, const QString &userName, UserLevelFlags userLevel, int playerId)
|
||||
void UserContextMenu::showContextMenu(const QPoint &pos, const QString &userName, UserLevelFlags userLevel, bool online, int playerId)
|
||||
{
|
||||
aUserName->setText(userName);
|
||||
|
||||
|
|
@ -132,8 +132,9 @@ void UserContextMenu::showContextMenu(const QPoint &pos, const QString &userName
|
|||
menu->addAction(aBan);
|
||||
}
|
||||
bool anotherUser = userName != QString::fromStdString(tabSupervisor->getUserInfo()->name());
|
||||
aChat->setEnabled(anotherUser);
|
||||
aShowGames->setEnabled(anotherUser);
|
||||
aDetails->setEnabled(online);
|
||||
aChat->setEnabled(anotherUser && online);
|
||||
aShowGames->setEnabled(anotherUser && online);
|
||||
aAddToBuddyList->setEnabled(anotherUser);
|
||||
aRemoveFromBuddyList->setEnabled(anotherUser);
|
||||
aAddToIgnoreList->setEnabled(anotherUser);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue