From a54f46365cbd847413133bd2903d6c4aced1cebc Mon Sep 17 00:00:00 2001 From: doitux Date: Fri, 8 Oct 2010 20:30:52 +0000 Subject: [PATCH] invite-only too early timeout-animation bugfix --- .../gamelobbydialog/gamelobbydialogimpl.cpp | 36 ++++++++++--------- .../qt/settingsdialog/settingsdialogimpl.cpp | 14 ++++---- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 5706b360..416ff810 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -861,16 +861,16 @@ void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerNam showInfoMsgBoxTimer->start(1000); } -// if(!myGameListSelectionModel->hasSelection() && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY) { -// int it = 0; -// while (myGameListModel->item(it)) { -// if (myGameListModel->item(it, 0)->data(Qt::UserRole) == mySession->getClientCurrentGameId()) { -// gameSelected(treeView_GameList->model()->index(it,0), true); -// break; -// } -// it++; -// } -// } + // if(!myGameListSelectionModel->hasSelection() && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY) { + // int it = 0; + // while (myGameListModel->item(it)) { + // if (myGameListModel->item(it, 0)->data(Qt::UserRole) == mySession->getClientCurrentGameId()) { + // gameSelected(treeView_GameList->model()->index(it,0), true); + // break; + // } + // it++; + // } + // } } @@ -1090,6 +1090,10 @@ void gameLobbyDialogImpl::joinedGameDialogUpdate() { label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); updateDialogBlinds(info.data); label_TimeoutForPlayerAction->setText(QString::number(info.data.playerActionTimeoutSec)); + + QTreeWidgetItem *header = treeWidget_connectedPlayers->headerItem(); + header->setText(0, tr("Connected players - Max. %1").arg(info.data.maxNumberOfPlayers)); + header->setData(0, Qt::UserRole, info.data.maxNumberOfPlayers); } void gameLobbyDialogImpl::leftGameDialogUpdate() { @@ -1420,7 +1424,7 @@ void gameLobbyDialogImpl::registeredUserMode() void gameLobbyDialogImpl::guestUserMode() { - lineEdit_ChatInput->setText(tr("Chat is only available to registered players.")); + lineEdit_ChatInput->setText(tr("Chat is only available to registered players.")); lineEdit_ChatInput->setDisabled(true); guestMode = true; } @@ -1481,7 +1485,7 @@ void gameLobbyDialogImpl::showInfoMsgBox() switch(infoMsgToShowId) { case 2: { myMessageDialogImpl dialog(myConfig, this); - dialog.exec(2, tr("You have entered a game with type \"invite-only\".\nFeel free to invite other players by right-clicking on their nick in the available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok, true); + dialog.exec(2, tr("You have entered a game with type \"invite-only\".\nFeel free to invite other players by right-clicking on their nick in the available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok, true); } break; default:; @@ -1500,7 +1504,7 @@ void gameLobbyDialogImpl::showInvitationDialog(unsigned gameId, unsigned playerI inviteDialogIsCurrentlyShown = true; myMessageDialogImpl dialog(myConfig, this); - if(dialog.exec(3, tr("You have been invited to the game %1 by %2.
Would you like 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)) { + if(dialog.exec(3, tr("You have been invited to the game %1 by %2.
Would you like 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(gameId); inviteDialogIsCurrentlyShown = false; @@ -1522,9 +1526,9 @@ void gameLobbyDialogImpl::chatInfoPlayerRejectedInvitation(unsigned gameId, unsi { QString string; - if(reason == DENY_GAME_INVITATION_NO) string = tr("%1 has rejected the invitation to %2."); + if(reason == DENY_GAME_INVITATION_NO) string = tr("%1 has rejected the invitation to %2."); - if(reason == DENY_GAME_INVITATION_BUSY) string = tr("%1 cannot join %2 because he is busy."); + if(reason == DENY_GAME_INVITATION_BUSY) string = tr("%1 cannot join %2 because he is busy."); textBrowser_ChatDisplay->append(string.arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str()))); @@ -1553,7 +1557,7 @@ void gameLobbyDialogImpl::putPlayerOnIgnoreList() { if(!playerIsOnIgnoreList(playerId)) { myMessageDialogImpl dialog(myConfig, this); - if(dialog.exec(4, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on your ignore list?").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) { + if(dialog.exec(4, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on your ignore list?").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) { list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); playerIgnoreList.push_back(QString("%1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData()); diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index a31847d0..9280666f 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -39,13 +39,13 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva #endif setupUi(this); - //temporarely remove sql log features - pushButton_deleteLog->hide(); - pushButton_saveLogAs->hide(); - pushButton_exportLogTxt->hide(); - pushButton_exportLogHtml->hide(); - treeWidget_logFiles->hide(); - //////////////////////////////////// + if(!SQLITE_LOG) {//temporarely remove sql log features + pushButton_deleteLog->hide(); + pushButton_saveLogAs->hide(); + pushButton_exportLogTxt->hide(); + pushButton_exportLogHtml->hide(); + treeWidget_logFiles->hide(); + } myManualBlindsOrderDialog = new manualBlindsOrderDialogImpl;