Preparing admin functions in PokerTH client.

This commit is contained in:
lotodore
2013-02-24 16:22:51 +01:00
parent 6d85adf7e2
commit 883ccdcf44
13 changed files with 77 additions and 15 deletions
@@ -2179,7 +2179,7 @@ void gameLobbyDialogImpl::reportBadGameName()
{
assert(mySession);
if (myGameListSelectionModel->hasSelection()) {
unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt();
unsigned gameId = myGameListSelectionModel->selectedRows().first().data(Qt::UserRole).toUInt();
GameInfo info(mySession->getClientGameInfo(gameId));
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
@@ -2196,14 +2196,14 @@ void gameLobbyDialogImpl::adminActionCloseGame()
{
assert(mySession);
if (myGameListSelectionModel->hasSelection()) {
unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt();
unsigned gameId = myGameListSelectionModel->selectedRows().first().data(Qt::UserRole).toUInt();
GameInfo info(mySession->getClientGameInfo(gameId));
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
tr("Are you sure you want to close the game:\n\"%1\"?").arg(QString::fromUtf8(info.name.c_str())), QMessageBox::Yes | QMessageBox::No);
if(ret == QMessageBox::Yes) {
mySession->adminActionCloseGame(gameId);
//TODO mySession->adminActionCloseGame(gameId);
}
}
}
@@ -2212,14 +2212,14 @@ void gameLobbyDialogImpl::adminActionTotalKickBan()
{
assert(mySession);
if (myNickListSelectionModel->hasSelection()) {
unsigned playerId = selection->selectedRows().first().data(Qt::UserRole).toUInt();
unsigned playerId = myGameListSelectionModel->selectedRows().first().data(Qt::UserRole).toUInt();
PlayerInfo info(mySession->getClientPlayerInfo(playerId));
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
tr("Are you sure you want to total kickban the player: \"%1\"?").arg(QString::fromUtf8(info.playerName.c_str())), QMessageBox::Yes | QMessageBox::No);
if(ret == QMessageBox::Yes) {
mySession->adminActionTotalKickBan(playerId);
// TODO mySession->adminActionTotalKickBan(playerId);
}
}
}