bugfix for #0000022: Notification window kept open when game finishes
This commit is contained in:
@@ -393,6 +393,12 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
//set WindowTitle dynamically
|
//set WindowTitle dynamically
|
||||||
this->setWindowTitle(QString(tr("PokerTH %1 - The Open-Source Texas Holdem Engine").arg(POKERTH_BETA_RELEASE_STRING)));
|
this->setWindowTitle(QString(tr("PokerTH %1 - The Open-Source Texas Holdem Engine").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||||
|
|
||||||
|
// create universal messageDialgo
|
||||||
|
myUniversalMessageDialog = new myMessageDialogImpl(myConfig, this);
|
||||||
|
myUniversalMessageDialog->setParent(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Connects
|
//Connects
|
||||||
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
||||||
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
||||||
@@ -2975,9 +2981,9 @@ void gameTableImpl::closeGameTable() {
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
bool close = true;
|
bool close = true;
|
||||||
myMessageDialogImpl dialog(myConfig, this);
|
|
||||||
if(dialog.checkIfMesssageWillBeDisplayed(6) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) {
|
if(myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(6) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) {
|
||||||
if (dialog.exec(6, tr("Really want to exit?"), tr("PokerTH - Close Table?"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Rejected) {
|
if (myUniversalMessageDialog->exec(6, tr("Really want to exit?"), tr("PokerTH - Close Table?"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Rejected) {
|
||||||
close = false;
|
close = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3052,16 +3058,13 @@ void gameTableImpl::leaveCurrentNetworkGame() {
|
|||||||
|
|
||||||
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
||||||
|
|
||||||
myMessageDialogImpl dialog(myConfig, this);
|
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(1)) {
|
||||||
dialog.setParent(this);
|
|
||||||
|
|
||||||
if(!dialog.checkIfMesssageWillBeDisplayed(1)) {
|
|
||||||
|
|
||||||
assert(myStartWindow->getSession());
|
assert(myStartWindow->getSession());
|
||||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (dialog.exec(1, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), tr("PokerTH - Internet Game Message"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) {
|
if (myUniversalMessageDialog->exec(1, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), tr("PokerTH - Internet Game Message"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) {
|
||||||
assert(myStartWindow->getSession());
|
assert(myStartWindow->getSession());
|
||||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||||
}
|
}
|
||||||
@@ -3420,3 +3423,8 @@ void gameTableImpl::showWarningAutoFoldInRankingGame(unsigned remainingAutoFolds
|
|||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
tabWidget_Right->setCurrentIndex(1);
|
tabWidget_Right->setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::closeMessageBoxes() {
|
||||||
|
|
||||||
|
myUniversalMessageDialog->close();
|
||||||
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class MyTimeoutLabel;
|
|||||||
|
|
||||||
class settingsDialogImpl;
|
class settingsDialogImpl;
|
||||||
class startWindowImpl;
|
class startWindowImpl;
|
||||||
|
class myMessageDialogImpl;
|
||||||
|
|
||||||
class GameTableStyleReader;
|
class GameTableStyleReader;
|
||||||
class CardDeckStyleReader;
|
class CardDeckStyleReader;
|
||||||
@@ -308,6 +309,7 @@ public slots:
|
|||||||
void sendShowMyCardsSignal();
|
void sendShowMyCardsSignal();
|
||||||
|
|
||||||
void showWarningAutoFoldInRankingGame(unsigned);
|
void showWarningAutoFoldInRankingGame(unsigned);
|
||||||
|
void closeMessageBoxes();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -374,6 +376,7 @@ private:
|
|||||||
|
|
||||||
// Dialogs
|
// Dialogs
|
||||||
startWindowImpl *myStartWindow;
|
startWindowImpl *myStartWindow;
|
||||||
|
myMessageDialogImpl *myUniversalMessageDialog;
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
SDLPlayer *mySDLPlayer;
|
SDLPlayer *mySDLPlayer;
|
||||||
|
|||||||
@@ -505,6 +505,7 @@ void startWindowImpl::showClientDialog()
|
|||||||
else if (mySession->getGameType() == Session::GAME_TYPE_INTERNET)
|
else if (mySession->getGameType() == Session::GAME_TYPE_INTERNET)
|
||||||
{
|
{
|
||||||
if (myGuiInterface->getMyW()->isVisible())
|
if (myGuiInterface->getMyW()->isVisible())
|
||||||
|
myGuiInterface->getMyW()->closeMessageBoxes();
|
||||||
myGuiInterface->getMyW()->hide();
|
myGuiInterface->getMyW()->hide();
|
||||||
if (!this->isVisible())
|
if (!this->isVisible())
|
||||||
this->show();
|
this->show();
|
||||||
|
|||||||
Reference in New Issue
Block a user