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
|
||||
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
|
||||
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
||||
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
||||
@@ -2975,9 +2981,9 @@ void gameTableImpl::closeGameTable() {
|
||||
else {
|
||||
|
||||
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 (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->checkIfMesssageWillBeDisplayed(6) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -3052,16 +3058,13 @@ void gameTableImpl::leaveCurrentNetworkGame() {
|
||||
|
||||
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
||||
|
||||
myMessageDialogImpl dialog(myConfig, this);
|
||||
dialog.setParent(this);
|
||||
|
||||
if(!dialog.checkIfMesssageWillBeDisplayed(1)) {
|
||||
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(1)) {
|
||||
|
||||
assert(myStartWindow->getSession());
|
||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||
}
|
||||
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());
|
||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||
}
|
||||
@@ -3420,3 +3423,8 @@ void gameTableImpl::showWarningAutoFoldInRankingGame(unsigned remainingAutoFolds
|
||||
QMessageBox::Ok);
|
||||
tabWidget_Right->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void gameTableImpl::closeMessageBoxes() {
|
||||
|
||||
myUniversalMessageDialog->close();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class MyTimeoutLabel;
|
||||
|
||||
class settingsDialogImpl;
|
||||
class startWindowImpl;
|
||||
class myMessageDialogImpl;
|
||||
|
||||
class GameTableStyleReader;
|
||||
class CardDeckStyleReader;
|
||||
@@ -308,6 +309,7 @@ public slots:
|
||||
void sendShowMyCardsSignal();
|
||||
|
||||
void showWarningAutoFoldInRankingGame(unsigned);
|
||||
void closeMessageBoxes();
|
||||
|
||||
private:
|
||||
|
||||
@@ -374,6 +376,7 @@ private:
|
||||
|
||||
// Dialogs
|
||||
startWindowImpl *myStartWindow;
|
||||
myMessageDialogImpl *myUniversalMessageDialog;
|
||||
|
||||
//Sound
|
||||
SDLPlayer *mySDLPlayer;
|
||||
|
||||
@@ -505,6 +505,7 @@ void startWindowImpl::showClientDialog()
|
||||
else if (mySession->getGameType() == Session::GAME_TYPE_INTERNET)
|
||||
{
|
||||
if (myGuiInterface->getMyW()->isVisible())
|
||||
myGuiInterface->getMyW()->closeMessageBoxes();
|
||||
myGuiInterface->getMyW()->hide();
|
||||
if (!this->isVisible())
|
||||
this->show();
|
||||
|
||||
Reference in New Issue
Block a user