diff --git a/src/gui/generic/serverguiwrapper.cpp b/src/gui/generic/serverguiwrapper.cpp
index ab59bab5..947c8947 100644
--- a/src/gui/generic/serverguiwrapper.cpp
+++ b/src/gui/generic/serverguiwrapper.cpp
@@ -101,7 +101,7 @@ void ServerGuiWrapper::updateMyButtonsState() {}
void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {}
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
-void ServerGuiWrapper::startVoteOnKick(int /*playerId*/, int /*timeoutSec*/) {}
+void ServerGuiWrapper::startVoteOnKick(int /*playerId*/, int /*timeoutSec*/, int /*numVotesNeededToKick*/) {}
void ServerGuiWrapper::changeVoteOnKickButtonsState(bool /*showHide*/) {}
void ServerGuiWrapper::refreshVotesMonitor(int /*currentVotes*/, int /*numVotesNeededToKick*/) {}
void ServerGuiWrapper::endVoteOnKick() {}
diff --git a/src/gui/generic/serverguiwrapper.h b/src/gui/generic/serverguiwrapper.h
index da581682..50473d10 100644
--- a/src/gui/generic/serverguiwrapper.h
+++ b/src/gui/generic/serverguiwrapper.h
@@ -88,7 +88,7 @@ public:
void startTimeoutAnimation(int playerId, int timeoutSec);
void stopTimeoutAnimation(int playerId);
- void startVoteOnKick(int playerId, int timeoutSec);
+ void startVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick);
void changeVoteOnKickButtonsState(bool showHide);
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
void endVoteOnKick();
diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h
index 13dd29ad..f37b43ab 100644
--- a/src/gui/guiinterface.h
+++ b/src/gui/guiinterface.h
@@ -97,7 +97,7 @@ public:
virtual void startTimeoutAnimation(int playerId, int timeoutSec) =0;
virtual void stopTimeoutAnimation(int playerId) =0;
- virtual void startVoteOnKick(int playerId, int timeoutSec) =0;
+ virtual void startVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick) =0;
virtual void changeVoteOnKickButtonsState(bool showHide) =0;
virtual void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
virtual void endVoteOnKick() =0;
diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp
index 7db35898..4c6a9fcf 100755
--- a/src/gui/qt/gametable/gametableimpl.cpp
+++ b/src/gui/qt/gametable/gametableimpl.cpp
@@ -589,7 +589,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalPostRiverRunAnimation1()), this, SLOT(postRiverRunAnimation1()));
connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn()));
connect(this, SIGNAL(signalNextRoundCleanGui()), this, SLOT(nextRoundCleanGui()));
- connect(this, SIGNAL(signalStartVoteOnKick(int, int)), this, SLOT(startVoteOnKick(int, int)));
+ connect(this, SIGNAL(signalStartVoteOnKick(int, int, int)), this, SLOT(startVoteOnKick(int, int, int)));
connect(this, SIGNAL(signalChangeVoteOnKickButtonsState(bool)), this, SLOT(changeVoteOnKickButtonsState(bool)));
connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick()));
@@ -2676,7 +2676,7 @@ void gameTableImpl::keyPressEvent ( QKeyEvent * event ) {
else { keyUpDownChatCounter = 0; }
//TESTING UNIT
- if (event->key() == Qt::Key_M) { startVoteOnKick(3,60); }
+ if (event->key() == Qt::Key_M) { startVoteOnKick(3,60, 6); }
if (event->key() == Qt::Key_N) { endVoteOnKick(); }
}
@@ -3099,7 +3099,7 @@ void gameTableImpl::triggerVoteOnKick(int id) {
}
}
-void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
+void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick)
{
if(tabWidget_Left->widget(2) != tab_Kick)
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
@@ -3107,9 +3107,11 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
tabWidget_Left->setCurrentIndex(2);
pushButton_voteOnKickNo->hide();
pushButton_voteOnKickYes->hide();
-
voteOnKickTimeoutSecs = timeoutSec;
+
playerAboutToKickId = playerId;
+ refreshVotesMonitor(1, numVotesNeededToKick);
+
startVoteOnKickTimeout();
int i;
@@ -3175,7 +3177,7 @@ void gameTableImpl::nextVoteOnKickTimeoutAnimationFrame()
void gameTableImpl::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick)
{
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerAboutToKickId));
- 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));
+ label_votesMonitor->setText(tr("Player %1 has %2 votes
against him. %3 votes needed to kick.").arg(QString::fromUtf8(info.playerName.c_str())).arg(currentVotes).arg(numVotesNeededToKick));
}
void gameTableImpl::refreshCardsChance(GameState bero)
@@ -3201,4 +3203,3 @@ void gameTableImpl::refreshCardsChance(GameState bero)
delete myCardsValue;
}
-
diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h
index ae076f53..a845a8e7 100755
--- a/src/gui/qt/gametable/gametableimpl.h
+++ b/src/gui/qt/gametable/gametableimpl.h
@@ -119,7 +119,7 @@ signals:
void signalNextRoundCleanGui();
- void signalStartVoteOnKick(int playerId, int timeoutSec);
+ void signalStartVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick);
void signalChangeVoteOnKickButtonsState(bool showHide);
void signalEndVoteOnKick();
@@ -282,7 +282,7 @@ public slots:
void showMaximized ();
void closeGameTable();
- void startVoteOnKick(int playerId, int timeoutSec);
+ void startVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick);
void changeVoteOnKickButtonsState(bool showHide);
void endVoteOnKick();
void voteOnKickYes();
diff --git a/src/gui/qt/gametable/myavatarlabel.cpp b/src/gui/qt/gametable/myavatarlabel.cpp
index b7f05d73..8194359c 100644
--- a/src/gui/qt/gametable/myavatarlabel.cpp
+++ b/src/gui/qt/gametable/myavatarlabel.cpp
@@ -23,7 +23,7 @@ MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
{
myContextMenu = new QMenu;
- action_VoteForKick = new QAction(QIcon(":/gfx/list_remove_user.png"), tr("Start vote on kick this user"), myContextMenu);
+ action_VoteForKick = new QAction(QIcon(":/gfx/list_remove_user.png"), tr("Start vote to kick this user"), myContextMenu);
myContextMenu->addAction(action_VoteForKick);
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp
index 2033fe5b..556f0c1a 100644
--- a/src/gui/qt/guiwrapper.cpp
+++ b/src/gui/qt/guiwrapper.cpp
@@ -105,7 +105,7 @@ void GuiWrapper::disableMyButtons() { myW->signalDisableMyButtons(); }
void GuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) { myW->signalStartTimeoutAnimation(playerId, timeoutSec); }
void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnimation(playerId); }
-void GuiWrapper::startVoteOnKick(int playerId, int timeoutSec) { myW->signalStartVoteOnKick(playerId, timeoutSec); }
+void GuiWrapper::startVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick) { myW->signalStartVoteOnKick(playerId, timeoutSec, numVotesNeededToKick); }
void GuiWrapper::changeVoteOnKickButtonsState(bool showHide) { myW->changeVoteOnKickButtonsState(showHide); }
void GuiWrapper::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) { myW->refreshVotesMonitor(currentVotes, numVotesNeededToKick); }
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h
index 6c39f3a2..c4b5f64e 100644
--- a/src/gui/qt/guiwrapper.h
+++ b/src/gui/qt/guiwrapper.h
@@ -96,7 +96,7 @@ public:
void startTimeoutAnimation(int playerId, int timeoutSec);
void stopTimeoutAnimation(int playerId);
- void startVoteOnKick(int playerId, int timeoutSec);
+ void startVoteOnKick(int playerId, int timeoutSec, int numVotesNeededToKick);
void changeVoteOnKickButtonsState(bool showHide);
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
void endVoteOnKick();