diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 6ae70cc6..d0b967f5 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -22,7 +22,7 @@ #include "mymessagedialogimpl.h" gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) - : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0), currentInvitationGameId(0) + : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0), currentInvitationGameId(0), inviteDialogIsCurrentlyShown(false) { #ifdef __APPLE__ @@ -1344,14 +1344,23 @@ void gameLobbyDialogImpl::showInfoMsgBox() void gameLobbyDialogImpl::showInvitationDialog(unsigned gameId, unsigned playerIdFrom) { + if(!inviteDialogIsCurrentlyShown) { - myMessageDialogImpl dialog(myConfig, this); - if(dialog.exec(3, tr("You've been invited to the game %1 by %2.
Do you want to join this game?").arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str())), tr("PokerTH - Info Message"), QPixmap(":/gfx/list_add_user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false)) { + inviteDialogIsCurrentlyShown = true; - mySession->acceptGameInvitation(currentInvitationGameId); + myMessageDialogImpl dialog(myConfig, this); + if(dialog.exec(3, tr("You've been invited to the game %1 by %2.
Do you want to join this game?").arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str())), tr("PokerTH - Info Message"), QPixmap(":/gfx/list_add_user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false)) { + + mySession->acceptGameInvitation(currentInvitationGameId); + inviteDialogIsCurrentlyShown = false; + } + else { + mySession->rejectGameInvitation(currentInvitationGameId, DENY_GAME_INVITATION_NO); + inviteDialogIsCurrentlyShown = false; + } } else { - mySession->rejectGameInvitation(currentInvitationGameId, DENY_GAME_INVITATION_NO); + mySession->rejectGameInvitation(currentInvitationGameId, DENY_GAME_INVITATION_BUSY); } } diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h index ca61d0a3..346fe95d 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h @@ -143,6 +143,7 @@ private: QAction *ignorePlayerAction; int infoMsgToShowId; int currentInvitationGameId; + bool inviteDialogIsCurrentlyShown; protected: