diff --git a/src/gui/generic/serverguiwrapper.cpp b/src/gui/generic/serverguiwrapper.cpp
index ba4a58e1..ab59bab5 100644
--- a/src/gui/generic/serverguiwrapper.cpp
+++ b/src/gui/generic/serverguiwrapper.cpp
@@ -103,6 +103,7 @@ void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
void ServerGuiWrapper::startVoteOnKick(int /*playerId*/, int /*timeoutSec*/) {}
void ServerGuiWrapper::changeVoteOnKickButtonsState(bool /*showHide*/) {}
+void ServerGuiWrapper::refreshVotesMonitor(int /*currentVotes*/, int /*numVotesNeededToKick*/) {}
void ServerGuiWrapper::endVoteOnKick() {}
void ServerGuiWrapper::logPlayerActionMsg(string /*playerName*/, int /*action*/, int /*setValue*/) {}
diff --git a/src/gui/generic/serverguiwrapper.h b/src/gui/generic/serverguiwrapper.h
index 972a7c19..da581682 100644
--- a/src/gui/generic/serverguiwrapper.h
+++ b/src/gui/generic/serverguiwrapper.h
@@ -90,6 +90,7 @@ public:
void startVoteOnKick(int playerId, int timeoutSec);
void changeVoteOnKickButtonsState(bool showHide);
+ void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
void endVoteOnKick();
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h
index 37e7c63b..13dd29ad 100644
--- a/src/gui/guiinterface.h
+++ b/src/gui/guiinterface.h
@@ -99,6 +99,7 @@ public:
virtual void startVoteOnKick(int playerId, int timeoutSec) =0;
virtual void changeVoteOnKickButtonsState(bool showHide) =0;
+ virtual void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
virtual void endVoteOnKick() =0;
//log.cpp
diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp
index 46607d4e..7db35898 100755
--- a/src/gui/qt/gametable/gametableimpl.cpp
+++ b/src/gui/qt/gametable/gametableimpl.cpp
@@ -3108,9 +3108,6 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
pushButton_voteOnKickNo->hide();
pushButton_voteOnKickYes->hide();
- PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
- label_kickUser->setText(tr("Do you want to kick %1
from this game?").arg(QString::fromUtf8(info.playerName.c_str())));
-
voteOnKickTimeoutSecs = timeoutSec;
playerAboutToKickId = playerId;
startVoteOnKickTimeout();
@@ -3124,10 +3121,15 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
void gameTableImpl::changeVoteOnKickButtonsState(bool showHide)
{
if(showHide) {
+
+ PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerAboutToKickId));
+ label_kickUser->setText(tr("Do you want to kick %1
from this game?").arg(QString::fromUtf8(info.playerName.c_str())));
+
pushButton_voteOnKickNo->show();
pushButton_voteOnKickYes->show();
}
else {
+ label_kickUser->clear();
pushButton_voteOnKickNo->hide();
pushButton_voteOnKickYes->hide();
}
@@ -3170,10 +3172,10 @@ void gameTableImpl::nextVoteOnKickTimeoutAnimationFrame()
label_kickVoteTimeout->setText(tr("%1 secs left").arg(voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds()));
}
-void gameTableImpl::refreshVotesMonitor()
+void gameTableImpl::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick)
{
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerAboutToKickId));
- label_votesMonitor->setText(tr("Player %1 has %2 votes against him.").arg(QString::fromUtf8(info.playerName.c_str())));
+ label_votesMonitor->setText(tr("Player %1 has %2 votes against him.
%3 votes needed to kick.").arg(QString::fromUtf8(info.playerName.c_str()), currentVotes, numVotesNeededToKick));
}
void gameTableImpl::refreshCardsChance(GameState bero)
diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h
index 3efc56ed..ae076f53 100755
--- a/src/gui/qt/gametable/gametableimpl.h
+++ b/src/gui/qt/gametable/gametableimpl.h
@@ -290,7 +290,7 @@ public slots:
void startVoteOnKickTimeout();
void stopVoteOnKickTimeout();
void nextVoteOnKickTimeoutAnimationFrame();
- void refreshVotesMonitor();
+ void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
private:
diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp
index 0c395830..2033fe5b 100644
--- a/src/gui/qt/guiwrapper.cpp
+++ b/src/gui/qt/guiwrapper.cpp
@@ -107,6 +107,7 @@ void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnim
void GuiWrapper::startVoteOnKick(int playerId, int timeoutSec) { myW->signalStartVoteOnKick(playerId, timeoutSec); }
void GuiWrapper::changeVoteOnKickButtonsState(bool showHide) { myW->changeVoteOnKickButtonsState(showHide); }
+void GuiWrapper::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) { myW->refreshVotesMonitor(currentVotes, numVotesNeededToKick); }
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->signalLogPlayerActionMsg(QString::fromUtf8(playerName.c_str()), action, setValue); }
diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h
index 7c8be091..6c39f3a2 100644
--- a/src/gui/qt/guiwrapper.h
+++ b/src/gui/qt/guiwrapper.h
@@ -98,6 +98,7 @@ public:
void startVoteOnKick(int playerId, int timeoutSec);
void changeVoteOnKickButtonsState(bool showHide);
+ void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
void endVoteOnKick();
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;