diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp
index f5e2ac65..02dae737 100644
--- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp
+++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp
@@ -199,6 +199,8 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
nickListContextMenu->addAction(nickListInviteAction);
nickListIgnorePlayerAction = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore player"), nickListContextMenu);
nickListContextMenu->addAction(nickListIgnorePlayerAction);
+ nickListUnignorePlayerAction = new QAction(QIcon(":/gfx/dialog_ok_apply.png"), tr("Unignore player"), nickListContextMenu);
+ nickListContextMenu->addAction(nickListUnignorePlayerAction);
nickListPlayerInfoSubMenu = nickListContextMenu->addMenu(QIcon(":/gfx/dialog-information.png"), tr("Player infos ..."));
nickListPlayerInGameInfo = new QAction(nickListContextMenu);
nickListPlayerInfoSubMenu->addAction(nickListPlayerInGameInfo);
@@ -242,6 +244,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
connect( treeView_GameList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showGameListContextMenu(QPoint) ) );
connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() ));
connect( nickListIgnorePlayerAction, SIGNAL(triggered()), this, SLOT( putPlayerOnIgnoreList() ));
+ connect( nickListUnignorePlayerAction, SIGNAL(triggered()), this, SLOT( removePlayerFromIgnoreList() ));
connect( nickListOpenPlayerStats1, SIGNAL(triggered()), this, SLOT( openPlayerStats1() ));
connect( connectedPlayersListOpenPlayerStats, SIGNAL(triggered()), this, SLOT( openPlayerStats2() ));
connect( lineEdit_searchForPlayers, SIGNAL(textChanged(QString)),this, SLOT(searchForPlayerRegExpChanged()));
@@ -1646,7 +1649,6 @@ void gameLobbyDialogImpl::showNickListContextMenu(QPoint p)
unsigned playerUid = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt();
if(inGame && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY && playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest) {
-
nickListInviteAction->setEnabled(true);
nickListInviteAction->setText(tr("Invite %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())));
@@ -1655,16 +1657,22 @@ void gameLobbyDialogImpl::showNickListContextMenu(QPoint p)
nickListInviteAction->setEnabled(false);
}
- if(playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest) {
-
+ if(playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest && !playerIsOnIgnoreList(playerUid)) {
nickListIgnorePlayerAction->setEnabled(true);
nickListIgnorePlayerAction->setText(tr("Ignore %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())));
} else {
-
nickListIgnorePlayerAction->setEnabled(false);
nickListIgnorePlayerAction->setText(tr("Ignore player ..."));
}
+ if(playerUid != mySession->getClientUniquePlayerId() && !mySession->getClientPlayerInfo(playerUid).isGuest && playerIsOnIgnoreList(playerUid)) {
+ nickListUnignorePlayerAction->setEnabled(true);
+ nickListUnignorePlayerAction->setText(tr("Unignore %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerUid).playerName.c_str())));
+ } else {
+ nickListUnignorePlayerAction->setEnabled(false);
+ nickListUnignorePlayerAction->setText(tr("Unignore player ..."));
+ }
+
unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerUid);
QString playerInGameInfoString;
if(gameIdOfPlayer) {
@@ -1794,21 +1802,32 @@ bool gameLobbyDialogImpl::playerIsOnIgnoreList(unsigned playerId)
void gameLobbyDialogImpl::putPlayerOnIgnoreList()
{
-
if(myNickListSelectionModel->currentIndex().isValid()) {
-
unsigned playerId = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt();
-
if(!playerIsOnIgnoreList(playerId)) {
-
myMessageDialogImpl dialog(myConfig, this);
- if(dialog.exec(INGNORE_PLAYER_QUESTION, 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(IGNORE_PLAYER_QUESTION, 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());
myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
myConfig->writeBuffer();
+ myChat->refreshIgnoreList();
+ }
+ }
+ }
+}
+void gameLobbyDialogImpl::removePlayerFromIgnoreList()
+{
+ if(myNickListSelectionModel->currentIndex().isValid()) {
+ unsigned playerId = myNickListSelectionModel->currentIndex().data(Qt::UserRole).toUInt();
+ if(playerIsOnIgnoreList(playerId)) {
+ myMessageDialogImpl dialog(myConfig, this);
+ if(dialog.exec(UNIGNORE_PLAYER_QUESTION, tr("You will receive chat messages and game invitations from this user again!
Do you really want to remove player %1 from your ignore list?").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())), tr("PokerTH - Question"), QPixmap(":/gfx/dialog_ok_apply.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
+ list playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
+ playerIgnoreList.remove(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 a564a349..b3717b07 100644
--- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h
+++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h
@@ -149,6 +149,7 @@ public slots:
void chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
void putPlayerOnIgnoreList();
+ void removePlayerFromIgnoreList();
bool playerIsOnIgnoreList(unsigned playerid);
void searchForPlayerRegExpChanged();
void showAutoStartTimer();
@@ -205,6 +206,7 @@ private:
QMenu *nickListContextMenu;
QAction *nickListInviteAction;
QAction *nickListIgnorePlayerAction;
+ QAction *nickListUnignorePlayerAction;
QMenu *nickListPlayerInfoSubMenu;
QMenu *nickListAdminSubMenu;
QAction *nickListAdminTotalKickBan;
diff --git a/src/gui/qt/gametable/myavatarlabel.cpp b/src/gui/qt/gametable/myavatarlabel.cpp
index 2c08f1eb..ced1d4d9 100644
--- a/src/gui/qt/gametable/myavatarlabel.cpp
+++ b/src/gui/qt/gametable/myavatarlabel.cpp
@@ -52,11 +52,14 @@ MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
myContextMenu->addAction(action_VoteForKick);
action_IgnorePlayer = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore Player"), myContextMenu);
myContextMenu->addAction(action_IgnorePlayer);
+ action_UnignorePlayer = new QAction(QIcon(":/gfx/dialog_ok_apply.png"), tr("Unignore Player"), myContextMenu);
+ myContextMenu->addAction(action_UnignorePlayer);
action_ReportBadAvatar = new QAction(QIcon(":/gfx/emblem-important.png"), tr("Report inappropriate avatar"), myContextMenu);
myContextMenu->addAction(action_ReportBadAvatar);
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
connect( action_IgnorePlayer, SIGNAL ( triggered() ), this, SLOT ( putPlayerOnIgnoreList() ) );
+ connect( action_UnignorePlayer, SIGNAL ( triggered() ), this, SLOT ( removePlayerFromIgnoreList() ) );
connect( action_ReportBadAvatar, SIGNAL ( triggered() ), this, SLOT ( reportBadAvatar() ) );
connect( action_EditTip, SIGNAL( triggered() ), this, SLOT ( startEditTip() ) );
}
@@ -92,6 +95,7 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event )
}
action_IgnorePlayer->setEnabled(true);
+ action_UnignorePlayer->setDisabled(true);
action_EditTip->setEnabled(true);
int j=0;
for (it_c=seatList->begin(); it_c!=seatList->end(); ++it_c) {
@@ -114,6 +118,11 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event )
} else {
action_ReportBadAvatar->setVisible(false);
}
+
+ if(playerIsOnIgnoreList(QString::fromUtf8((*it_c)->getMyName().c_str()))) {
+ action_UnignorePlayer->setEnabled(true);
+ action_IgnorePlayer->setDisabled(true);
+ }
}
j++;
}
@@ -466,7 +475,6 @@ bool MyAvatarLabel::playerIsOnIgnoreList(QString playerName)
void MyAvatarLabel::putPlayerOnIgnoreList()
{
-
QStringList list;
PlayerListConstIterator it_c;
PlayerList seatList = myW->getSession()->getCurrentGame()->getSeatsList();
@@ -475,15 +483,34 @@ void MyAvatarLabel::putPlayerOnIgnoreList()
}
if(!playerIsOnIgnoreList(list.at(myId))) {
-
myMessageDialogImpl dialog(myW->getMyConfig(), this);
- if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
-
+ if(dialog.exec(IGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.
Do you really want to put player %1 on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
std::list playerIgnoreList = myW->getMyConfig()->readConfigStringList("PlayerIgnoreList");
playerIgnoreList.push_back(list.at(myId).toUtf8().constData());
myW->getMyConfig()->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
myW->getMyConfig()->writeBuffer();
+ myW->getMyChat()->refreshIgnoreList();
+ }
+ }
+}
+
+void MyAvatarLabel::removePlayerFromIgnoreList()
+{
+ QStringList list;
+ PlayerListConstIterator it_c;
+ PlayerList seatList = myW->getSession()->getCurrentGame()->getSeatsList();
+ for (it_c=seatList->begin(); it_c!=seatList->end(); ++it_c) {
+ list << QString::fromUtf8((*it_c)->getMyName().c_str());
+ }
+
+ if(playerIsOnIgnoreList(list.at(myId))) {
+ myMessageDialogImpl dialog(myW->getMyConfig(), this);
+ if(dialog.exec(UNIGNORE_PLAYER_QUESTION, tr("You will receive chat messages and game invitations from this user again!
Do you really want to remove player %1 from your ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/dialog_ok_apply.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
+ std::list playerIgnoreList = myW->getMyConfig()->readConfigStringList("PlayerIgnoreList");
+ playerIgnoreList.remove(list.at(myId).toUtf8().constData());
+ myW->getMyConfig()->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
+ myW->getMyConfig()->writeBuffer();
myW->getMyChat()->refreshIgnoreList();
}
}
diff --git a/src/gui/qt/gametable/myavatarlabel.h b/src/gui/qt/gametable/myavatarlabel.h
index 14e0d993..5c26b85f 100644
--- a/src/gui/qt/gametable/myavatarlabel.h
+++ b/src/gui/qt/gametable/myavatarlabel.h
@@ -78,6 +78,7 @@ public slots:
}
void paintEvent(QPaintEvent*);
void putPlayerOnIgnoreList();
+ void removePlayerFromIgnoreList();
bool playerIsOnIgnoreList(QString playerName);
void reportBadAvatar();
void startEditTip();
@@ -94,6 +95,7 @@ private:
QMenu *myContextMenu;
QAction *action_VoteForKick;
QAction *action_IgnorePlayer;
+ QAction *action_UnignorePlayer;
QAction *action_ReportBadAvatar;
QAction *action_EditTip;
diff --git a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h
index 3fdf62ef..60717c47 100644
--- a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h
+++ b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h
@@ -42,15 +42,15 @@ enum MESSAGE_CONTENT {
BACKTO_LOBBY_QUESTION, //1: leave lobby during online game: Question(Do you really wanna leave?)
INFO_AFTER_JOIN_INVITE_GAME, //2: join invite only game: Info(You can invite people with right click ...)
JOIN_INVITE_GAME_QUESTION, //3: reciev invite to game: Question(You've been invited to the game %1 by %2.
Do you want to join this game?)
- INGNORE_PLAYER_QUESTION, //4: click ignore player: Question(Do you really want to put this player on ignore List?)
+ IGNORE_PLAYER_QUESTION, //4: click ignore player: Question(Do you really want to put this player on ignore List?)
GT_VALUES_MISSING, //5: Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing.
CLOSE_GAMETABLE_QUESTION, //6: close gametable: Do you really wanna quit?
GT_PICS_MISSING, //7: One or more pictures from current game table style \"%1\" were not found:
GT_OUTDATED, //8: Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is
CD_VALUES_MISSING, //9:
CD_PICS_MISSING, //10:
- CD_OUTDATED //11:
-
+ CD_OUTDATED, //11:
+ UNIGNORE_PLAYER_QUESTION //12: click unignore player: Question(Do you really want to remove this player from ignore List?)
};
class ConfigFile;