From 2e76454af718d9ed9dea074aa6624d384db3f5f4 Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 31 Mar 2010 12:33:00 +0000 Subject: [PATCH] GUI: invitation refresh game infos bugfix, comeback from game into lobby refresh nicks with flag bugfix, implementd ingore function chat and invitation, adds infomessage --- docs/infomessage-id-desc.txt | 2 + src/gui/qt/chattools/chattools.cpp | 16 ++- src/gui/qt/chattools/chattools.h | 2 + .../gamelobbydialog/gamelobbydialogimpl.cpp | 103 ++++++++++++------ .../qt/gamelobbydialog/gamelobbydialogimpl.h | 5 +- src/gui/qt/resources/im-ban-user_64.png | Bin 0 -> 5497 bytes src/gui/qt/resources/pokerth.qrc | 1 + src/gui/qt/settingsdialog.ui | 15 +-- .../qt/settingsdialog/settingsdialogimpl.cpp | 14 ++- .../qt/settingsdialog/settingsdialogimpl.h | 1 + src/gui/qt/startwindow/startwindowimpl.cpp | 1 - 11 files changed, 103 insertions(+), 57 deletions(-) create mode 100644 src/gui/qt/resources/im-ban-user_64.png diff --git a/docs/infomessage-id-desc.txt b/docs/infomessage-id-desc.txt index 6cb09731..8a7d0d70 100644 --- a/docs/infomessage-id-desc.txt +++ b/docs/infomessage-id-desc.txt @@ -1,2 +1,4 @@ 1: leave lobby during online game: Question(Do you really wanna leave?) 2: join invite only game: Info(You can invite people with right click ...) +3: reciev invite to game: Question(You've been invited to the game %1 by %2.
Do you want to join this game?) +4: click ignore player: Question(Do you really want to put this player on ignore List?) diff --git a/src/gui/qt/chattools/chattools.cpp b/src/gui/qt/chattools/chattools.cpp index 54b67254..1804b3a2 100644 --- a/src/gui/qt/chattools/chattools.cpp +++ b/src/gui/qt/chattools/chattools.cpp @@ -31,6 +31,7 @@ using namespace std; ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, ChatType ct, QTextBrowser *b, QTreeWidget *t, gameLobbyDialogImpl *lo) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myChatType(ct), myConfig(c), myNick(""), myLobby(lo) { myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str()); + ignoreList = myConfig->readConfigStringList("PlayerIgnoreList"); } ChatTools::~ChatTools() @@ -95,8 +96,18 @@ void ChatTools::receiveMessage(QString playerName, QString message) { } + bool nickFoundOnIgnoreList = false; + list::iterator it1; + for(it1=ignoreList.begin(); it1 != ignoreList.end(); it1++) { - myTextBrowser->append(playerName + ": " + tempMsg); + if(playerName == QString::fromUtf8(it1->c_str())) { + nickFoundOnIgnoreList = true; + } + } + + if(!nickFoundOnIgnoreList) { + myTextBrowser->append(playerName + ": " + tempMsg); + } } } @@ -192,6 +203,5 @@ void ChatTools::setChatTextEdited() { void ChatTools::refreshIgnoreList() { - - + ignoreList = myConfig->readConfigStringList("PlayerIgnoreList"); } diff --git a/src/gui/qt/chattools/chattools.h b/src/gui/qt/chattools/chattools.h index 148a217f..a4869aea 100644 --- a/src/gui/qt/chattools/chattools.h +++ b/src/gui/qt/chattools/chattools.h @@ -84,6 +84,8 @@ private: GameTableStyleReader *myStyle; gameLobbyDialogImpl *myLobby; + + std::list ignoreList; }; #endif diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index e928fd58..f090dfff 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -24,7 +24,7 @@ using namespace std; 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), inviteDialogIsCurrentlyShown(false) + : QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0), currentInvitationGameId(0), inviteDialogIsCurrentlyShown(false) { #ifdef __APPLE__ @@ -234,7 +234,7 @@ void gameLobbyDialogImpl::createGame() break; } - hideShowGameDescription(TRUE); + showGameDescription(TRUE); label_SmallBlind->setText(QString("%L1").arg(gameData.firstSmallBlind)); label_StartCash->setText(QString("%L1").arg(gameData.startMoney)); @@ -259,7 +259,6 @@ void gameLobbyDialogImpl::joinGame() if (!inGame && selection->hasSelection()) { unsigned gameId = selection->selectedRows().first().data(Qt::UserRole).toUInt(); - myCurrentGameId = gameId; GameInfo info(mySession->getClientGameInfo(gameId)); bool ok = true; QString password; @@ -337,10 +336,10 @@ void gameLobbyDialogImpl::removedFromGame(int /*reason*/) leftGameDialogUpdate(); } -void gameLobbyDialogImpl::gameSelected(const QModelIndex &index, bool invitedRefreshHack) +void gameLobbyDialogImpl::gameSelected(const QModelIndex &index) { - if ((!inGame && index.isValid()) || (inGame && index.isValid() && invitedRefreshHack) ) + if (!inGame && index.isValid() ) { pushButton_JoinGame->setEnabled(true); @@ -375,7 +374,7 @@ void gameLobbyDialogImpl::gameSelected(const QModelIndex &index, bool invitedRef break; } - hideShowGameDescription(TRUE); + showGameDescription(TRUE); label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind)); label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); // label_MaximumNumberOfPlayers->setText(QString::number(info.data.maxNumberOfPlayers));s @@ -644,7 +643,7 @@ void gameLobbyDialogImpl::clearDialog() header->setText(0, tr("Connected players")); header->setData(0, Qt::UserRole, 0); - hideShowGameDescription(FALSE); + showGameDescription(FALSE); label_typeIcon->setText(" "); label_typeText->setText(" "); label_SmallBlind->setText(""); @@ -689,7 +688,7 @@ void gameLobbyDialogImpl::clearDialog() isGameAdministrator = false; myPlayerId = 0; - hideShowGameDescription(FALSE); + showGameDescription(FALSE); label_nickListCounter->setText("| "+tr("players in chat: %1").arg(0)); label_connectedPlayersCounter->setText(tr("connected players: %1").arg(0)); @@ -772,16 +771,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++; +// } +// } } @@ -888,6 +887,7 @@ void gameLobbyDialogImpl::playerJoinedLobby(unsigned playerId, QString /*playerN QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_NickList, 0); item->setData(0, Qt::DisplayRole, QString::fromUtf8(playerInfo.playerName.c_str())); item->setData(0, Qt::UserRole, playerId); + item->setIcon(0, QIcon(QString(":/cflags/cflags/%1.png").arg("de"))); treeWidget_NickList->sortItems(0, Qt::AscendingOrder); refreshPlayerStats(); @@ -944,6 +944,41 @@ void gameLobbyDialogImpl::joinedGameDialogUpdate() { pushButton_JoinGame->hide(); pushButton_joinAnyGame->hide(); pushButton_Leave->show(); + + //this was added to show game infos even if no game was selected (e.g. invite only game) + assert(mySession); + GameInfo info(mySession->getClientGameInfo(mySession->getClientCurrentGameId())); + + groupBox_GameInfo->setTitle(tr("Game Info") + " - " + QString::fromUtf8(info.name.c_str())); + + switch (info.data.gameType) { + case GAME_TYPE_NORMAL: { + label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png")); + label_typeText->setText(tr("Standard")); + } + break; + case GAME_TYPE_REGISTERED_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png")); + label_typeText->setText(tr("Registered players only")); + } + break; + case GAME_TYPE_INVITE_ONLY: { + label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png")); + label_typeText->setText(tr("Invited players only")); + } + break; + case GAME_TYPE_RANKING: { + label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png")); + label_typeText->setText(tr("Ranking game")); + } + break; + } + + showGameDescription(TRUE); + label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind)); + label_StartCash->setText(QString("%L1").arg(info.data.startMoney)); + updateDialogBlinds(info.data); + label_TimeoutForPlayerAction->setText(QString::number(info.data.playerActionTimeoutSec)); } void gameLobbyDialogImpl::leftGameDialogUpdate() { @@ -959,7 +994,7 @@ void gameLobbyDialogImpl::leftGameDialogUpdate() { header->setText(0, tr("Connected players")); header->setData(0, Qt::UserRole, 0); - hideShowGameDescription(FALSE); + showGameDescription(FALSE); label_typeIcon->setText(" "); label_typeText->setText(" "); label_SmallBlind->setText(""); @@ -1090,7 +1125,7 @@ bool gameLobbyDialogImpl::event ( QEvent * event ) { return QDialog::event(event); } -void gameLobbyDialogImpl::hideShowGameDescription(bool show) { +void gameLobbyDialogImpl::showGameDescription(bool show) { if(show) { label_gameType->show(); @@ -1382,7 +1417,11 @@ void gameLobbyDialogImpl::showInfoMsgBox() void gameLobbyDialogImpl::showInvitationDialog(unsigned gameId, unsigned playerIdFrom) { - if(!inviteDialogIsCurrentlyShown) { + if(inviteDialogIsCurrentlyShown || playerIsOnIgnoreList(playerIdFrom)) { + + mySession->rejectGameInvitation(gameId, DENY_GAME_INVITATION_BUSY); + } + else { inviteDialogIsCurrentlyShown = true; @@ -1397,9 +1436,6 @@ void gameLobbyDialogImpl::showInvitationDialog(unsigned gameId, unsigned playerI inviteDialogIsCurrentlyShown = false; } } - else { - mySession->rejectGameInvitation(gameId, DENY_GAME_INVITATION_BUSY); - } } @@ -1426,13 +1462,10 @@ bool gameLobbyDialogImpl::playerIsOnIgnoreList(unsigned playerId) { list::iterator it1; for(it1= playerIgnoreList.begin(); it1 != playerIgnoreList.end(); it1++) { - QString tmpString = QString::fromUtf8(it1->c_str()); - if(QString("%1").arg(playerId) == tmpString.split(",").at(0)) { - + if(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str()) == QString::fromUtf8(it1->c_str())) { return true; } } - return false; } @@ -1445,12 +1478,16 @@ void gameLobbyDialogImpl::putPlayerOnIgnoreList() { if(!playerIsOnIgnoreList(playerId)) { - list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); - playerIgnoreList.push_back(QString("%1,%2").arg(playerId).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData()); - myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList); - myConfig->writeBuffer(); + myMessageDialogImpl dialog(myConfig, this); + if(dialog.exec(4, tr("You will no longer recieve chat messages or game invitations from this user.
Do you really want to put player %1 on 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) { - myChat->refreshIgnoreList(); + list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList"); + playerIgnoreList.push_back(QString("%1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData()); + myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList); + myConfig->writeBuffer(); + + myChat->refreshIgnoreList(); + } } } } diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h index 702cb781..1815da9a 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h @@ -55,7 +55,7 @@ public slots: void createGame(); void joinGame(); void joinAnyGame(); - void gameSelected(const QModelIndex &, bool invitedRefreshHack = false); + void gameSelected(const QModelIndex &); void updateGameItem(QList , unsigned gameId); void addGame(unsigned gameId); void updateGameMode(unsigned gameId, int newMode); @@ -91,7 +91,7 @@ public slots: void clearDialog(); void keyPressEvent(QKeyEvent * keyEvent); bool event(QEvent * event); - void hideShowGameDescription(bool show); + void showGameDescription(bool show); void showWaitStartGameMsgBox(); void joinAnyGameButtonRefresh(); void reject(); @@ -120,7 +120,6 @@ private: createInternetGameDialogImpl *myCreateInternetGameDialog; QString currentGameName; unsigned myPlayerId; - unsigned myCurrentGameId; bool isGameAdministrator; bool inGame; bool guestMode; diff --git a/src/gui/qt/resources/im-ban-user_64.png b/src/gui/qt/resources/im-ban-user_64.png new file mode 100644 index 0000000000000000000000000000000000000000..c3072efb7d459500201d8c861ded04ac5ef218eb GIT binary patch literal 5497 zcmV-<6^81GP)Px#32;bRa{vGvuK)lWuK`{fksJU300(qQO+^RU0Tvb{AYy{D4^02KL2L_t(|+TB|TlvL%FzVE%-tGarv>V;ltXf_pDhegytAdWE^j2I0X zV=^)hlhNZbfgv-f$%wOPJjQ5ZGC0a{Fd99M11N52M?zE*aRF)8X6=2c?%MZlzWe|E zhiW_L%#p=3^Uk@x>i7Qot^3{m-XD$r4A-~5`c(_%^JDY*e1)cIIXv=dL?<@B@=At2 z=j(F=;5$o~y211fxm<2(o@g;XTQyxLoyjl=K*T`XuyjiG#1IJ35{iVw zL-+;4_cED`7g{uD&eW;TzWdQfXWbl3=K=sQ@Mt0)pAG;BKc4NJRh^&9yZQ`J`0m6V z+QFbmzhJd8Z%a?w(H@x@GJEvJJmhZ$Mc`(6Vo*5D#SojX& zJJygHWMT(sGVwYA791aI48ND)02nKqht>MMdv3qIe$)fta=Cs4Z>}rp!xY%InG~~3 zLdA7Wx}ZGP0W85he1?#G9?v;Un)ti&dp3Y~_oxP7-Kte?sPI+r`ofvv8pg1p>%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EWAuC3fgJCXG4Ym4lP=kj-KC;I(4Js&U&WSu!vFS6N8@C#N*(E(8wVRJXc zT1>cuia;)qT}8A4C!8Jn{V7lk6a|GrA?y>3_4jLZ;>6d?lw00dZEu?FvQmT9Mx{JD z<5?o^1AMv+=C!+hFw^aeH$&9_ae!!RANKuR4@g{EU$2=eD|M&EVqj*+9ZX9Oq!nba z8VLt)6m+C=8bHAM4A!SXsl2YI_zpmsGSO5jdt}cZy(XEQ=&)EWEiWyd;3_Hc7D1(u vUkn8M`+Elb{@oqPsystem_help_64.png list_add_user_64.png im-ban-user.png + im-ban-user_64.png cflags/ad.png diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index f049697e..6c505176 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -1805,21 +1805,8 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - 256 - 218 - - - - - + Remove Player diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index 81d3a47c..98d7478d 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -116,6 +116,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva connect( listWidget_cardDeckStyles, SIGNAL( currentItemChanged(QListWidgetItem*, QListWidgetItem*) ), this, SLOT ( showCurrentCardDeckStylePreview() )); connect( pushButton_addCardDeckStyle, SIGNAL( clicked() ), this, SLOT( addCardDeckStyle()) ); connect( pushButton_removeCardDeckStyle, SIGNAL( clicked() ), this, SLOT( removeCardDeckStyle()) ); + connect( pushButton_internetGameRemoveIgnoredPlayer, SIGNAL( clicked()), this, SLOT( removePlayerFromIgnoredPlayersList())); + } void settingsDialogImpl::exec() { @@ -215,8 +217,7 @@ void settingsDialogImpl::exec() { std::list::iterator it5; for(it5= playerIgnoreList.begin(); it5 != playerIgnoreList.end(); it5++) { QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_internetGameIgnoredPlayers); - item->setText(0, QString::fromUtf8(it5->c_str()).split(",").at(1) ); - item->setData(0, Qt::UserRole, QString::fromUtf8(it5->c_str()).split(",").at(0) ); + item->setText(0, QString::fromUtf8(it5->c_str())); } //Interface @@ -543,7 +544,7 @@ void settingsDialogImpl::isAccepted() { int k; std::list playerIgnoreList; for(k=0; ktopLevelItemCount(); k++) { - playerIgnoreList.push_back(QString("%1,%2").arg(treeWidget_internetGameIgnoredPlayers->topLevelItem(k)->data(0,Qt::UserRole).toUInt()).arg(treeWidget_internetGameIgnoredPlayers->topLevelItem(k)->text(0)).toUtf8().constData()); + playerIgnoreList.push_back(QString("%1").arg(treeWidget_internetGameIgnoredPlayers->topLevelItem(k)->text(0)).toUtf8().constData()); } myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList); @@ -1141,3 +1142,10 @@ void settingsDialogImpl::removeCardDeckStyle() listWidget_cardDeckStyles->takeItem(listWidget_cardDeckStyles->currentRow()); } } + +void settingsDialogImpl::removePlayerFromIgnoredPlayersList() +{ + if(treeWidget_internetGameIgnoredPlayers->selectedItems().count()) { + treeWidget_internetGameIgnoredPlayers->takeTopLevelItem(treeWidget_internetGameIgnoredPlayers->currentIndex().row()); + } +} diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.h b/src/gui/qt/settingsdialog/settingsdialogimpl.h index c36b0b57..732f1fcc 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.h +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.h @@ -90,6 +90,7 @@ public slots: void showCurrentCardDeckStylePreview(); void addCardDeckStyle(); void removeCardDeckStyle(); + void removePlayerFromIgnoredPlayersList(); private: diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index f71f0c5c..fb65a0fe 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -150,7 +150,6 @@ startWindowImpl::startWindowImpl(ConfigFile *c) connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned))); connect(this, SIGNAL(signalLobbyPlayerJoined(unsigned, QString)), myGameLobbyDialog, SLOT(playerJoinedLobby(unsigned, QString))); -// connect(this, SIGNAL(signalLobbyPlayerKicked(QString, QString, QString)), myGameLobbyDialog, SLOT(playerKicked(QString, QString, QString))); connect(this, SIGNAL(signalLobbyPlayerLeft(unsigned)), myGameLobbyDialog, SLOT(playerLeftLobby(unsigned)));