enhancements in dialog-handling for lobby infomsgboxes

This commit is contained in:
doitux
2011-11-06 00:30:34 +00:00
parent 718a27e4a5
commit 943c030a13
2 changed files with 22 additions and 7 deletions
@@ -61,6 +61,8 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
#endif #endif
waitRejoinStartGameMsgBox->setStandardButtons(QMessageBox::NoButton); waitRejoinStartGameMsgBox->setStandardButtons(QMessageBox::NoButton);
inviteOnlyInfoMsgBox = new myMessageDialogImpl(myConfig, this);
waitStartGameMsgBoxTimer = new QTimer(this); waitStartGameMsgBoxTimer = new QTimer(this);
waitStartGameMsgBoxTimer->setSingleShot(TRUE); waitStartGameMsgBoxTimer->setSingleShot(TRUE);
@@ -201,8 +203,7 @@ void gameLobbyDialogImpl::exec()
QDialog::exec(); QDialog::exec();
waitStartGameMsgBoxTimer->stop(); waitStartGameMsgBoxTimer->stop();
waitStartGameMsgBox->hide(); closeAllChildDialogs();
waitRejoinStartGameMsgBox->hide();
} }
@@ -211,6 +212,8 @@ gameLobbyDialogImpl::~gameLobbyDialogImpl()
delete myChat; delete myChat;
myChat = NULL; myChat = NULL;
delete inviteOnlyInfoMsgBox;
inviteOnlyInfoMsgBox = NULL;
} }
void gameLobbyDialogImpl::setSession(boost::shared_ptr<Session> session) void gameLobbyDialogImpl::setSession(boost::shared_ptr<Session> session)
@@ -394,8 +397,7 @@ void gameLobbyDialogImpl::refresh(int actionID)
//stop waitStartGameMsgBoxes //stop waitStartGameMsgBoxes
waitStartGameMsgBoxTimer->stop(); waitStartGameMsgBoxTimer->stop();
waitStartGameMsgBox->hide(); closeAllChildDialogs();
waitRejoinStartGameMsgBox->hide();
this->accept(); this->accept();
myW->show(); myW->show();
@@ -405,6 +407,11 @@ void gameLobbyDialogImpl::refresh(int actionID)
} else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) { } else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) {
if(this->isVisible()) { if(this->isVisible()) {
//break the autoStartTimer animation
autoStartTimer->stop();
autoStartTimerOverlay->hide();
//show msg dialog
waitRejoinStartGameMsgBox->show(); waitRejoinStartGameMsgBox->show();
waitRejoinStartGameMsgBox->raise(); waitRejoinStartGameMsgBox->raise();
waitRejoinStartGameMsgBox->activateWindow(); waitRejoinStartGameMsgBox->activateWindow();
@@ -1557,9 +1564,8 @@ void gameLobbyDialogImpl::showInfoMsgBox()
{ {
switch(infoMsgToShowId) { switch(infoMsgToShowId) {
case 2: { case 2: {
myMessageDialogImpl dialog(myConfig, this); inviteOnlyInfoMsgBox->setModal(false);
dialog.setWindowModality(Qt::NonModal); inviteOnlyInfoMsgBox->show(2, tr("You have entered a game with type \"invite-only\".\nFeel free to invite other players by right-clicking on their nick in the available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok, true);
dialog.show(2, tr("You have entered a game with type \"invite-only\".\nFeel free to invite other players by right-clicking on their nick in the available players list."), tr("PokerTH - Info Message"), QPixmap(":/gfx/ktip.png"), QDialogButtonBox::Ok, true);
} }
break; break;
default: default:
@@ -1968,3 +1974,10 @@ void gameLobbyDialogImpl::stopWaitStartGameMsgBoxTimer()
{ {
waitStartGameMsgBoxTimer->stop(); waitStartGameMsgBoxTimer->stop();
} }
void gameLobbyDialogImpl::closeAllChildDialogs()
{
inviteOnlyInfoMsgBox->hide();
waitStartGameMsgBox->hide();
waitRejoinStartGameMsgBox->hide();
}
@@ -139,6 +139,7 @@ public slots:
void updateAutoStartTimer(); void updateAutoStartTimer();
void openPlayerStats(); void openPlayerStats();
QString getFullCountryString(QString); QString getFullCountryString(QString);
void closeAllChildDialogs();
private: private:
@@ -158,6 +159,7 @@ private:
QString myAppDataPath; QString myAppDataPath;
QMessageBox *waitStartGameMsgBox; QMessageBox *waitStartGameMsgBox;
QMessageBox *waitRejoinStartGameMsgBox; QMessageBox *waitRejoinStartGameMsgBox;
myMessageDialogImpl *inviteOnlyInfoMsgBox;
QTimer *waitStartGameMsgBoxTimer; QTimer *waitStartGameMsgBoxTimer;
QTimer *blinkingButtonAnimationTimer; QTimer *blinkingButtonAnimationTimer;
QTimer *showInfoMsgBoxTimer; QTimer *showInfoMsgBoxTimer;