From ccb339be046335261fb497fecd8913186524274b Mon Sep 17 00:00:00 2001 From: doitux Date: Tue, 29 May 2007 18:37:49 +0000 Subject: [PATCH] highlightRoundLabel --> refreshGameLabels --- src/engine/handinterface.h | 1 - src/engine/local_engine/localhand.cpp | 26 +-- src/engine/local_engine/localhand.h | 1 - src/engine/network_engine/clienthand.cpp | 5 +- src/engine/network_engine/clienthand.h | 2 - src/gui/generic/serverguiwrapper.cpp | 228 +++++++++++------------ src/gui/generic/serverguiwrapper.h | 5 +- src/gui/guiinterface.h | 2 +- src/gui/qt/guiwrapper.cpp | 4 +- src/gui/qt/guiwrapper.h | 2 +- src/gui/qt/mainwindow/mainwindowimpl.cpp | 36 ++-- src/gui/qt/mainwindow/mainwindowimpl.h | 6 +- 12 files changed, 147 insertions(+), 171 deletions(-) diff --git a/src/engine/handinterface.h b/src/engine/handinterface.h index 80707a7c..836347ea 100644 --- a/src/engine/handinterface.h +++ b/src/engine/handinterface.h @@ -76,7 +76,6 @@ public: virtual void setLastPlayersTurn(const int& theValue) =0; virtual int getLastPlayersTurn() const =0; - virtual void highlightRoundLabel() =0; virtual void switchRounds() =0; }; diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index da932553..f2d6110b 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -353,7 +353,7 @@ void LocalHand::switchRounds() { //unhighlight actual players groupbox if(playerArray[lastPlayersTurn]->getMyActiveStatus() == 1) myGui->refreshGroupbox(lastPlayersTurn,1); - highlightRoundLabel(); + myGui->refreshGameLabels(actualRound); // /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl; // // cout << "NextPlayerSpeed2 start" << endl; @@ -388,27 +388,3 @@ void LocalHand::switchRounds() { } } - -void LocalHand::highlightRoundLabel() { - switch(actualRound) { - case 0: { - myGui->highlightRoundLabel("Preflop"); - } break; - case 1: { - myGui->highlightRoundLabel("Flop"); - } break; - case 2: { - myGui->highlightRoundLabel("Turn"); - } break; - case 3: { - myGui->highlightRoundLabel("River"); - } break; - case 4: { - myGui->highlightRoundLabel(""); - } break; - default: { - myGui->highlightRoundLabel("!!! FEHLER !!!"); - } - } -} - diff --git a/src/engine/local_engine/localhand.h b/src/engine/local_engine/localhand.h index 307d4b59..20f73822 100755 --- a/src/engine/local_engine/localhand.h +++ b/src/engine/local_engine/localhand.h @@ -82,7 +82,6 @@ public: void assignButtons(); - void highlightRoundLabel(); void switchRounds(); diff --git a/src/engine/network_engine/clienthand.cpp b/src/engine/network_engine/clienthand.cpp index e145a6c5..912ffc6c 100644 --- a/src/engine/network_engine/clienthand.cpp +++ b/src/engine/network_engine/clienthand.cpp @@ -74,8 +74,5 @@ ClientHand::switchRounds() { } -void -ClientHand::highlightRoundLabel() -{ -} + diff --git a/src/engine/network_engine/clienthand.h b/src/engine/network_engine/clienthand.h index 31ed12bf..f61f7cc7 100644 --- a/src/engine/network_engine/clienthand.h +++ b/src/engine/network_engine/clienthand.h @@ -79,8 +79,6 @@ public: void setLastPlayersTurn(const int& theValue) { lastPlayersTurn = theValue; } int getLastPlayersTurn() const { return lastPlayersTurn; } - - void highlightRoundLabel(); void switchRounds(); diff --git a/src/gui/generic/serverguiwrapper.cpp b/src/gui/generic/serverguiwrapper.cpp index 8d5262c3..2d6a8ee9 100644 --- a/src/gui/generic/serverguiwrapper.cpp +++ b/src/gui/generic/serverguiwrapper.cpp @@ -1,114 +1,114 @@ -/*************************************************************************** - * Copyright (C) 2007 by Lothar May * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "serverguiwrapper.h" -#include - - -using namespace std; - - -ServerGuiWrapper::ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb) -: myConfig(config), myClientcb(clientcb), myServercb(servercb) -{ -} - -ServerGuiWrapper::~ServerGuiWrapper() -{ -} - -void ServerGuiWrapper::initGui(int speed) {} - -Session &ServerGuiWrapper::getSession() -{ - assert(mySession.get()); - return *mySession; -} - -void ServerGuiWrapper::setSession(boost::shared_ptr session) -{ - mySession = session; -} - -void ServerGuiWrapper::refreshSet() const {} - -void ServerGuiWrapper::refreshCash() const {} - -void ServerGuiWrapper::refreshAction(int playerID, int playerAction) const {} - -void ServerGuiWrapper::refreshChangePlayer() const {} - -void ServerGuiWrapper::refreshAll() const {} - -void ServerGuiWrapper::refreshPot() const {} -void ServerGuiWrapper::refreshGroupbox(int playerID, int status) const {} -void ServerGuiWrapper::refreshPlayerName() const {} -void ServerGuiWrapper::refreshButton() const {} - -void ServerGuiWrapper::dealHoleCards() {} -void ServerGuiWrapper::dealFlopCards() {} -void ServerGuiWrapper::dealTurnCard() {} -void ServerGuiWrapper::dealRiverCard() {} - -void ServerGuiWrapper::highlightRoundLabel(string round) const {} - - -void ServerGuiWrapper::nextPlayerAnimation() {} - -void ServerGuiWrapper::preflopAnimation1() {} -void ServerGuiWrapper::preflopAnimation2() {} - -void ServerGuiWrapper::flopAnimation1() {} -void ServerGuiWrapper::flopAnimation2() {} - -void ServerGuiWrapper::turnAnimation1() {} -void ServerGuiWrapper::turnAnimation2() {} - -void ServerGuiWrapper::riverAnimation1() {} -void ServerGuiWrapper::riverAnimation2() {} - -void ServerGuiWrapper::postRiverAnimation1() {} -void ServerGuiWrapper::postRiverRunAnimation1() {} - -void ServerGuiWrapper::flipHolecardsAllIn() {} - -void ServerGuiWrapper::nextRoundCleanGui() {} - -void ServerGuiWrapper::meInAction() {} - -void ServerGuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) {} -void ServerGuiWrapper::logNewGameHandMsg(int gameID, int handID) {} -void ServerGuiWrapper::logPlayerWinsMsg(int playerID, int pot) {} -void ServerGuiWrapper::logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4, int card5) {} -void ServerGuiWrapper::logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt, std::string showHas) {} - -void ServerGuiWrapper::SignalNetClientConnect(int actionID) { if (myClientcb) myClientcb->SignalNetClientConnect(actionID); } -void ServerGuiWrapper::SignalNetClientGameInfo(int actionID) { if (myClientcb) myClientcb->SignalNetClientGameInfo(actionID); } -void ServerGuiWrapper::SignalNetClientError(int errorID, int osErrorID) { if (myClientcb) myClientcb->SignalNetClientError(errorID, osErrorID); } -void ServerGuiWrapper::SignalNetClientPlayerJoined(const string &playerName) { if (myClientcb) myClientcb->SignalNetClientPlayerJoined(playerName); } -void ServerGuiWrapper::SignalNetClientPlayerLeft(const string &playerName) { if (myClientcb) myClientcb->SignalNetClientPlayerLeft(playerName); } -void ServerGuiWrapper::SignalNetClientGameStart(boost::shared_ptr game) { if (myClientcb) myClientcb->SignalNetClientGameStart(game); } -void ServerGuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { if (myClientcb) myClientcb->SignalNetClientChatMsg(playerName, msg); } - -void ServerGuiWrapper::SignalNetServerSuccess(int actionID) { if (myServercb) myServercb->SignalNetServerSuccess(actionID); } -void ServerGuiWrapper::SignalNetServerError(int errorID, int osErrorID) { if (myServercb) myServercb->SignalNetServerError(errorID, osErrorID); } -void ServerGuiWrapper::SignalNetServerPlayerJoined(const string &playerName) { if (myServercb) myServercb->SignalNetServerPlayerJoined(playerName); } -void ServerGuiWrapper::SignalNetServerPlayerLeft(const string &playerName) { if (myServercb) myServercb->SignalNetServerPlayerLeft(playerName); } - - +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "serverguiwrapper.h" +#include + + +using namespace std; + + +ServerGuiWrapper::ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb) +: myConfig(config), myClientcb(clientcb), myServercb(servercb) +{ +} + +ServerGuiWrapper::~ServerGuiWrapper() +{ +} + +void ServerGuiWrapper::initGui(int speed) {} + +Session &ServerGuiWrapper::getSession() +{ + assert(mySession.get()); + return *mySession; +} + +void ServerGuiWrapper::setSession(boost::shared_ptr session) +{ + mySession = session; +} + +void ServerGuiWrapper::refreshSet() const {} + +void ServerGuiWrapper::refreshCash() const {} + +void ServerGuiWrapper::refreshAction(int playerID, int playerAction) const {} + +void ServerGuiWrapper::refreshChangePlayer() const {} + +void ServerGuiWrapper::refreshAll() const {} + +void ServerGuiWrapper::refreshPot() const {} +void ServerGuiWrapper::refreshGroupbox(int playerID, int status) const {} +void ServerGuiWrapper::refreshPlayerName() const {} +void ServerGuiWrapper::refreshButton() const {} + +void ServerGuiWrapper::dealHoleCards() {} +void ServerGuiWrapper::dealFlopCards() {} +void ServerGuiWrapper::dealTurnCard() {} +void ServerGuiWrapper::dealRiverCard() {} + +void ServerGuiWrapper::refreshGameLabels(int round) const {} + + +void ServerGuiWrapper::nextPlayerAnimation() {} + +void ServerGuiWrapper::preflopAnimation1() {} +void ServerGuiWrapper::preflopAnimation2() {} + +void ServerGuiWrapper::flopAnimation1() {} +void ServerGuiWrapper::flopAnimation2() {} + +void ServerGuiWrapper::turnAnimation1() {} +void ServerGuiWrapper::turnAnimation2() {} + +void ServerGuiWrapper::riverAnimation1() {} +void ServerGuiWrapper::riverAnimation2() {} + +void ServerGuiWrapper::postRiverAnimation1() {} +void ServerGuiWrapper::postRiverRunAnimation1() {} + +void ServerGuiWrapper::flipHolecardsAllIn() {} + +void ServerGuiWrapper::nextRoundCleanGui() {} + +void ServerGuiWrapper::meInAction() {} + +void ServerGuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) {} +void ServerGuiWrapper::logNewGameHandMsg(int gameID, int handID) {} +void ServerGuiWrapper::logPlayerWinsMsg(int playerID, int pot) {} +void ServerGuiWrapper::logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4, int card5) {} +void ServerGuiWrapper::logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt, std::string showHas) {} + +void ServerGuiWrapper::SignalNetClientConnect(int actionID) { if (myClientcb) myClientcb->SignalNetClientConnect(actionID); } +void ServerGuiWrapper::SignalNetClientGameInfo(int actionID) { if (myClientcb) myClientcb->SignalNetClientGameInfo(actionID); } +void ServerGuiWrapper::SignalNetClientError(int errorID, int osErrorID) { if (myClientcb) myClientcb->SignalNetClientError(errorID, osErrorID); } +void ServerGuiWrapper::SignalNetClientPlayerJoined(const string &playerName) { if (myClientcb) myClientcb->SignalNetClientPlayerJoined(playerName); } +void ServerGuiWrapper::SignalNetClientPlayerLeft(const string &playerName) { if (myClientcb) myClientcb->SignalNetClientPlayerLeft(playerName); } +void ServerGuiWrapper::SignalNetClientGameStart(boost::shared_ptr game) { if (myClientcb) myClientcb->SignalNetClientGameStart(game); } +void ServerGuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { if (myClientcb) myClientcb->SignalNetClientChatMsg(playerName, msg); } + +void ServerGuiWrapper::SignalNetServerSuccess(int actionID) { if (myServercb) myServercb->SignalNetServerSuccess(actionID); } +void ServerGuiWrapper::SignalNetServerError(int errorID, int osErrorID) { if (myServercb) myServercb->SignalNetServerError(errorID, osErrorID); } +void ServerGuiWrapper::SignalNetServerPlayerJoined(const string &playerName) { if (myServercb) myServercb->SignalNetServerPlayerJoined(playerName); } +void ServerGuiWrapper::SignalNetServerPlayerLeft(const string &playerName) { if (myServercb) myServercb->SignalNetServerPlayerLeft(playerName); } + + diff --git a/src/gui/generic/serverguiwrapper.h b/src/gui/generic/serverguiwrapper.h index 0b9114a6..55a15b53 100644 --- a/src/gui/generic/serverguiwrapper.h +++ b/src/gui/generic/serverguiwrapper.h @@ -44,14 +44,13 @@ public: void refreshAll() const; void refreshPlayerName() const; void refreshButton() const; - + void refreshGameLabels(int round) const; + void dealHoleCards(); void dealFlopCards(); void dealTurnCard(); void dealRiverCard(); - void highlightRoundLabel(std::string round) const; - void nextPlayerAnimation(); void preflopAnimation1(); diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h index b6a6bb67..318629ce 100644 --- a/src/gui/guiinterface.h +++ b/src/gui/guiinterface.h @@ -56,7 +56,7 @@ public: virtual void dealTurnCard()=0; virtual void dealRiverCard()=0; - virtual void highlightRoundLabel(std::string) const=0; + virtual void refreshGameLabels(int) const=0; virtual void nextPlayerAnimation()=0; diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index ab6e5ee5..ced874d0 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -58,15 +58,13 @@ void GuiWrapper::refreshPot() const { myW->signalRefreshPot(); } void GuiWrapper::refreshGroupbox(int playerID, int status) const { myW->signalRefreshGroupbox(playerID, status); } void GuiWrapper::refreshPlayerName() const { myW->signalRefreshPlayerName(); } void GuiWrapper::refreshButton() const { myW->signalRefreshButton(); } +void GuiWrapper::refreshGameLabels(int round) const { myW->signalRefreshGameLabels(round); } void GuiWrapper::dealHoleCards() { myW->signalDealHoleCards(); } void GuiWrapper::dealFlopCards() { myW->signalDealFlopCards0(); } void GuiWrapper::dealTurnCard() { myW->signalDealTurnCards0(); } void GuiWrapper::dealRiverCard() { myW->signalDealRiverCards0(); } -void GuiWrapper::highlightRoundLabel(string round) const { myW->signalHighlightRoundLabel(QString::fromUtf8(round.c_str())); } - - void GuiWrapper::nextPlayerAnimation() { myW->signalNextPlayerAnimation(); } void GuiWrapper::preflopAnimation1() { myW->signalPreflopAnimation1(); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index 9a1c1a91..03f6ba6b 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -58,7 +58,7 @@ public: void dealTurnCard(); void dealRiverCard(); - void highlightRoundLabel(std::string round) const; + void refreshGameLabels(int round) const; void nextPlayerAnimation(); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index e72b747b..4407c9fb 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -591,7 +591,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) connect(this, SIGNAL(signalDealTurnCards0()), this, SLOT(dealTurnCards0())); connect(this, SIGNAL(signalDealRiverCards0()), this, SLOT(dealRiverCards0())); - connect(this, SIGNAL(signalHighlightRoundLabel(QString)), this, SLOT(highlightRoundLabel(QString))); + connect(this, SIGNAL(signalRefreshGameLabels(int)), this, SLOT(refreshGameLabels(int))); connect(this, SIGNAL(signalNextPlayerAnimation()), this, SLOT(nextPlayerAnimation())); connect(this, SIGNAL(signalPreflopAnimation1()), this, SLOT(preflopAnimation1())); @@ -1204,19 +1204,31 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) { } } -void mainWindowImpl::highlightRoundLabel(QString round) { +void mainWindowImpl::refreshGameLabels(int round) { - // für PostRiverRun (alte Runden stehen lassen) - if(round != "") { - -// QPalette tempPalette = frame_handLabel->palette(); -// tempPalette.setColor(QPalette::Window, highlight); -// frame_handLabel->setPalette(tempPalette); - - textLabel_handLabel->setText(round); - textLabel_handNumber->setText(QString::number(mySession->getCurrentGame()->getCurrentHand()->getMyID(),10)); - textLabel_gameNumber->setText(QString::number(mySession->getCurrentGame()->getMyGameID(),10)); + switch(round) { + case 0: { + textLabel_handLabel->setText("Preflop"); + } break; + case 1: { + textLabel_handLabel->setText("Flop"); + } break; + case 2: { + textLabel_handLabel->setText("Turn"); + } break; + case 3: { + textLabel_handLabel->setText("River"); + } break; + case 4: { + textLabel_handLabel->setText(""); + } break; + default: { + textLabel_handLabel->setText("!!! ERROR !!!"); + } } + + textLabel_handNumber->setText(QString::number(mySession->getCurrentGame()->getCurrentHand()->getMyID(),10)); + textLabel_gameNumber->setText(QString::number(mySession->getCurrentGame()->getMyGameID(),10)); } void mainWindowImpl::refreshAll() { diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 65febae6..201aa0b0 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -94,7 +94,7 @@ signals: void signalDealTurnCards0(); void signalDealRiverCards0(); - void signalHighlightRoundLabel(QString); + void signalRefreshGameLabels(int); void signalNextPlayerAnimation(); void signalPreflopAnimation1(); @@ -133,7 +133,7 @@ public slots: void refreshGroupbox(int =-1, int =-1); void refreshAll(); void refreshPlayerName(); - + void refreshGameLabels(int); void refreshButton(); void refreshPlayerAvatar(); @@ -144,8 +144,6 @@ public slots: void meInAction(); void disableMyButtons(); - void highlightRoundLabel(QString); - void setGameSpeed(const int theValue) { guiGameSpeed = theValue; setSpeeds(); } // Achtung Faktor 10!!! void callNewGameDialog() ;