show votekick starter nick, disable kick contextmenu for only 2 players

This commit is contained in:
doitux
2008-12-07 21:47:53 +00:00
parent 0a2512da13
commit 15d934e5b8
10 changed files with 84 additions and 35 deletions
+7 -2
View File
@@ -401,6 +401,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
label_kickUser->setStyleSheet("QLabel { color: #99D500;}");
label_votesMonitor->setStyleSheet("QLabel { color: #99D500;}");
label_voteStarterNick->setStyleSheet("QLabel { color: #99D500;}");
label_votestartedby->setStyleSheet("QLabel { color: #99D500;}");
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
@@ -589,7 +591,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(unsigned, int, int)), this, SLOT(startVoteOnKick(unsigned, int, int)));
connect(this, SIGNAL(signalStartVoteOnKick(unsigned, unsigned, int, int)), this, SLOT(startVoteOnKick(unsigned, unsigned, int, int)));
connect(this, SIGNAL(signalChangeVoteOnKickButtonsState(bool)), this, SLOT(changeVoteOnKickButtonsState(bool)));
connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick()));
@@ -3114,7 +3116,7 @@ void gameTableImpl::triggerVoteOnKick(int id) {
}
}
void gameTableImpl::startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick)
void gameTableImpl::startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick)
{
if(tabWidget_Left->widget(2) != tab_Kick)
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
@@ -3127,6 +3129,9 @@ void gameTableImpl::startVoteOnKick(unsigned playerId, int timeoutSec, int numVo
playerAboutToBeKickedId = playerId;
refreshVotesMonitor(1, numVotesNeededToKick);
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(voteStarterPlayerId));
label_voteStarterNick->setText(QString::fromUtf8(info.playerName.c_str()));
startVoteOnKickTimeout();
int i;
+2 -2
View File
@@ -119,7 +119,7 @@ signals:
void signalNextRoundCleanGui();
void signalStartVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick);
void signalStartVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick);
void signalChangeVoteOnKickButtonsState(bool showHide);
void signalEndVoteOnKick();
@@ -283,7 +283,7 @@ public slots:
void showMaximized ();
void closeGameTable();
void startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick);
void startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick);
void changeVoteOnKickButtonsState(bool showHide);
void endVoteOnKick();
void voteOnKickYes();
+8 -1
View File
@@ -38,8 +38,15 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
Game *currentGame = myW->getSession()->getCurrentGame();
PlayerListConstIterator it_c;
int activePlayerCounter=0;
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
if((*it_c)->getMyActiveStatus()) activePlayerCounter++;
}
if(activePlayerCounter > 2) setVoteOnKickContextMenuEnabled(TRUE);
else setVoteOnKickContextMenuEnabled(FALSE);
int i=0;
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {