admin action submenu fixes
This commit is contained in:
@@ -1694,12 +1694,9 @@ void gameLobbyDialogImpl::showNickListContextMenu(QPoint p)
|
|||||||
nickListPlayerInGameInfo->setText(playerInGameInfoString);
|
nickListPlayerInGameInfo->setText(playerInGameInfoString);
|
||||||
|
|
||||||
|
|
||||||
// check for admin and add admin actions
|
// check for admin and remove admin actions for non-admins
|
||||||
if(mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId()).isAdmin) {
|
if(!mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId()).isAdmin) {
|
||||||
nickListAdminSubMenu->show();
|
nickListContextMenu->removeAction(nickListAdminSubMenu->menuAction());
|
||||||
}
|
|
||||||
else {
|
|
||||||
nickListAdminSubMenu->hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//popup a little more to the right to avaoid double click action
|
//popup a little more to the right to avaoid double click action
|
||||||
@@ -1713,12 +1710,9 @@ void gameLobbyDialogImpl::showGameListContextMenu(QPoint p)
|
|||||||
{
|
{
|
||||||
if(myGameListModel->rowCount() && myGameListSelectionModel->currentIndex().isValid()) {
|
if(myGameListModel->rowCount() && myGameListSelectionModel->currentIndex().isValid()) {
|
||||||
|
|
||||||
// check for admin and add admin actions
|
// check for admin and remove admin actions for non-admins
|
||||||
if(mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId()).isAdmin) {
|
if(!mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId()).isAdmin) {
|
||||||
gameListAdminSubMenu->show();
|
gameListContextMenu->removeAction(gameListAdminSubMenu->menuAction());
|
||||||
}
|
|
||||||
else {
|
|
||||||
gameListAdminSubMenu->hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//popup a little more to the right to avaoid double click action
|
//popup a little more to the right to avaoid double click action
|
||||||
@@ -2218,7 +2212,7 @@ void gameLobbyDialogImpl::adminActionTotalKickBan()
|
|||||||
{
|
{
|
||||||
assert(mySession);
|
assert(mySession);
|
||||||
if (myNickListSelectionModel->hasSelection()) {
|
if (myNickListSelectionModel->hasSelection()) {
|
||||||
unsigned playerId = myGameListSelectionModel->selectedRows().first().data(Qt::UserRole).toUInt();
|
unsigned playerId = myNickListSelectionModel->selectedRows().first().data(Qt::UserRole).toUInt();
|
||||||
PlayerInfo info(mySession->getClientPlayerInfo(playerId));
|
PlayerInfo info(mySession->getClientPlayerInfo(playerId));
|
||||||
|
|
||||||
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
|
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
|
||||||
|
|||||||
Reference in New Issue
Block a user