next steps votekick gui implementation

This commit is contained in:
doitux
2008-11-11 22:45:11 +00:00
parent 4ba76e60dd
commit f501ef1a20
7 changed files with 31 additions and 0 deletions
+4
View File
@@ -101,6 +101,10 @@ void ServerGuiWrapper::updateMyButtonsState() {}
void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {} void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {}
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {} void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
void ServerGuiWrapper::startVoteOnKick(int /*playerId*/, int /*timeoutSec*/) {}
void ServerGuiWrapper::changeVoteOnKickButtonsState(bool /*showHide*/) {}
void ServerGuiWrapper::endVoteOnKick() {}
void ServerGuiWrapper::logPlayerActionMsg(string /*playerName*/, int /*action*/, int /*setValue*/) {} void ServerGuiWrapper::logPlayerActionMsg(string /*playerName*/, int /*action*/, int /*setValue*/) {}
void ServerGuiWrapper::logNewGameHandMsg(int /*gameID*/, int /*handID*/) {} void ServerGuiWrapper::logNewGameHandMsg(int /*gameID*/, int /*handID*/) {}
void ServerGuiWrapper::logPlayerWinsMsg(std::string /*playerName*/, int /*pot*/, bool /*main*/) {} void ServerGuiWrapper::logPlayerWinsMsg(std::string /*playerName*/, int /*pot*/, bool /*main*/) {}
+4
View File
@@ -88,6 +88,10 @@ public:
void startTimeoutAnimation(int playerId, int timeoutSec); void startTimeoutAnimation(int playerId, int timeoutSec);
void stopTimeoutAnimation(int playerId); void stopTimeoutAnimation(int playerId);
void startVoteOnKick(int playerId, int timeoutSec);
void changeVoteOnKickButtonsState(bool showHide);
void endVoteOnKick();
void logPlayerActionMsg(std::string playerName, int action, int setValue) ; void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
void logNewGameHandMsg(int gameID, int handID) ; void logNewGameHandMsg(int gameID, int handID) ;
void logPlayerWinsMsg(std::string playerName, int pot, bool main); void logPlayerWinsMsg(std::string playerName, int pot, bool main);
+4
View File
@@ -97,6 +97,10 @@ public:
virtual void startTimeoutAnimation(int playerId, int timeoutSec) =0; virtual void startTimeoutAnimation(int playerId, int timeoutSec) =0;
virtual void stopTimeoutAnimation(int playerId) =0; virtual void stopTimeoutAnimation(int playerId) =0;
virtual void startVoteOnKick(int playerId, int timeoutSec) =0;
virtual void changeVoteOnKickButtonsState(bool showHide) =0;
virtual void endVoteOnKick() =0;
//log.cpp //log.cpp
virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0; virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0;
virtual void logNewGameHandMsg(int gameID, int HandID) =0; virtual void logNewGameHandMsg(int gameID, int HandID) =0;
+15
View File
@@ -590,6 +590,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn())); connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn()));
connect(this, SIGNAL(signalNextRoundCleanGui()), this, SLOT(nextRoundCleanGui())); connect(this, SIGNAL(signalNextRoundCleanGui()), this, SLOT(nextRoundCleanGui()));
connect(this, SIGNAL(signalStartVoteOnKick(int, int)), this, SLOT(startVoteOnKick(int, int))); connect(this, SIGNAL(signalStartVoteOnKick(int, int)), this, SLOT(startVoteOnKick(int, int)));
connect(this, SIGNAL(signalChangeVoteOnKickButtonsState(bool)), this, SLOT(changeVoteOnKickButtonsState(bool)));
connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick())); connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick()));
} }
@@ -3097,6 +3098,8 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick"))); tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
tabWidget_Left->setCurrentIndex(2); tabWidget_Left->setCurrentIndex(2);
pushButton_voteOnKickNo->hide();
pushButton_voteOnKickYes->hide();
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId)); PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
label_kickUser->setText(tr("Do you want to kick <b>%1</b> \nfrom this game?").arg(QString::fromUtf8(info.playerName.c_str()))); label_kickUser->setText(tr("Do you want to kick <b>%1</b> \nfrom this game?").arg(QString::fromUtf8(info.playerName.c_str())));
@@ -3106,6 +3109,18 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
startVoteOnKickTimeout(); startVoteOnKickTimeout();
} }
void gameTableImpl::changeVoteOnKickButtonsState(bool showHide)
{
if(showHide) {
pushButton_voteOnKickNo->show();
pushButton_voteOnKickYes->show();
}
else {
pushButton_voteOnKickNo->hide();
pushButton_voteOnKickYes->hide();
}
}
void gameTableImpl::endVoteOnKick() void gameTableImpl::endVoteOnKick()
{ {
stopVoteOnKickTimeout(); stopVoteOnKickTimeout();
+2
View File
@@ -120,6 +120,7 @@ signals:
void signalNextRoundCleanGui(); void signalNextRoundCleanGui();
void signalStartVoteOnKick(int playerId, int timeoutSec); void signalStartVoteOnKick(int playerId, int timeoutSec);
void signalChangeVoteOnKickButtonsState(bool showHide);
void signalEndVoteOnKick(); void signalEndVoteOnKick();
public slots: public slots:
@@ -282,6 +283,7 @@ public slots:
void closeGameTable(); void closeGameTable();
void startVoteOnKick(int playerId, int timeoutSec); void startVoteOnKick(int playerId, int timeoutSec);
void changeVoteOnKickButtonsState(bool showHide);
void endVoteOnKick(); void endVoteOnKick();
void voteOnKickYes(); void voteOnKickYes();
void voteOnKickNo(); void voteOnKickNo();
+1
View File
@@ -106,6 +106,7 @@ void GuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) { myW->sign
void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnimation(playerId); } 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) { myW->signalStartVoteOnKick(playerId, timeoutSec); }
void GuiWrapper::changeVoteOnKickButtonsState(bool showHide) { myW->changeVoteOnKickButtonsState(showHide); }
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); } void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->signalLogPlayerActionMsg(QString::fromUtf8(playerName.c_str()), action, setValue); } void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->signalLogPlayerActionMsg(QString::fromUtf8(playerName.c_str()), action, setValue); }
+1
View File
@@ -97,6 +97,7 @@ public:
void stopTimeoutAnimation(int playerId); void stopTimeoutAnimation(int playerId);
void startVoteOnKick(int playerId, int timeoutSec); void startVoteOnKick(int playerId, int timeoutSec);
void changeVoteOnKickButtonsState(bool showHide);
void endVoteOnKick(); void endVoteOnKick();
void logPlayerActionMsg(std::string playerName, int action, int setValue) ; void logPlayerActionMsg(std::string playerName, int action, int setValue) ;