show new beta release info bugfix

This commit is contained in:
doitux
2010-08-15 20:11:31 +00:00
parent 8685af480a
commit 27a73d521f
2 changed files with 34 additions and 12 deletions
+30 -12
View File
@@ -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.<br>Please go to <a href=\"http://www.pokerth.net/\" target=\"_blank\">http://www.pokerth.net</a> 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.<br>Please go to <a href=\"http://www.pokerth.net/\" target=\"_blank\">http://www.pokerth.net</a> 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.<br>Please go to <a href=\"http://www.pokerth.net/\" target=\"_blank\">http://www.pokerth.net</a> 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.<br>Please go to <a href=\"http://www.pokerth.net/\" target=\"_blank\">http://www.pokerth.net</a> and download the latest version."));
msgBoxOutdatedVersion.setTextFormat(Qt::RichText);
msgBoxOutdatedVersion.setStandardButtons(QMessageBox::Ok);
msgBoxOutdatedVersion.setDefaultButton(QMessageBox::Ok);
msgBoxOutdatedVersionActive = true;
}
break;
}
+4
View File
@@ -24,6 +24,7 @@
#include <assert.h>
#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;
};