diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 7c68a70e..dbd17b1f 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -53,7 +53,7 @@ using namespace std; startWindowImpl::startWindowImpl(ConfigFile *c) - : myConfig(c) + : myConfig(c), msgBoxOutdatedVersionActive(false) { myGuiInterface.reset(new GuiWrapper(myConfig, this)); @@ -341,7 +341,17 @@ void startWindowImpl::joinGameLobby() { void startWindowImpl::callInternetGameLoginDialog() { //login + + //HACK if Outdated Version info is available show it here! + if(msgBoxOutdatedVersionActive) { + msgBoxOutdatedVersionActive = false; + msgBoxOutdatedVersion.exec(); + msgBoxOutdatedVersion.raise(); + msgBoxOutdatedVersion.activateWindow(); + } + myInternetGameLoginDialog->exec(); + if(myInternetGameLoginDialog->result() == QDialog::Accepted) { //send login infos mySession->setLogin( @@ -881,19 +891,27 @@ void startWindowImpl::networkNotification(int notificationId) QMessageBox::Close); } break; case NTF_NET_NEW_RELEASE_AVAILABLE: - { QMessageBox msgBox(QMessageBox::Information, tr("Network Notification"), - tr("A new release of PokerTH is available.
Please go to http://www.pokerth.net and download the latest version."), - QMessageBox::Close, this); - msgBox.setTextFormat(Qt::RichText); - msgBox.show(); + { + msgBoxOutdatedVersion.setIcon(QMessageBox::Information); + msgBoxOutdatedVersion.setWindowTitle(tr("Network Notification")); + msgBoxOutdatedVersion.setText(tr("A new release of PokerTH is available.
Please go to http://www.pokerth.net and download the latest version.")); + msgBoxOutdatedVersion.setTextFormat(Qt::RichText); + msgBoxOutdatedVersion.setStandardButtons(QMessageBox::Ok); + msgBoxOutdatedVersion.setDefaultButton(QMessageBox::Ok); + + msgBoxOutdatedVersionActive = true; } break; - case NTF_NET_OUTDATED_BETA: - { QMessageBox msgBox(QMessageBox::Information, tr("Network Notification"), - tr("This beta release of PokerTH is outdated.
Please go to http://www.pokerth.net and download the latest version."), - QMessageBox::Close, this); - msgBox.setTextFormat(Qt::RichText); - msgBox.show(); + case NTF_NET_OUTDATED_BETA: + { + msgBoxOutdatedVersion.setIcon(QMessageBox::Information); + msgBoxOutdatedVersion.setWindowTitle(tr("Network Notification")); + msgBoxOutdatedVersion.setText(tr("This beta release of PokerTH is outdated.
Please go to http://www.pokerth.net and download the latest version.")); + msgBoxOutdatedVersion.setTextFormat(Qt::RichText); + msgBoxOutdatedVersion.setStandardButtons(QMessageBox::Ok); + msgBoxOutdatedVersion.setDefaultButton(QMessageBox::Ok); + + msgBoxOutdatedVersionActive = true; } break; } diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index d6c9f2cc..8ed058e0 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -24,6 +24,7 @@ #include #include "ui_startwindow.h" #include "game_defs.h" +#include "QMessageBox" class GuiInterface; class GuiWrapper; @@ -149,6 +150,9 @@ private: serverListDialogImpl *myServerListDialog; internetGameLoginDialogImpl *myInternetGameLoginDialog; + QMessageBox msgBoxOutdatedVersion; + bool msgBoxOutdatedVersionActive; + friend class GuiWrapper; };