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; using namespace std;
startWindowImpl::startWindowImpl(ConfigFile *c) startWindowImpl::startWindowImpl(ConfigFile *c)
: myConfig(c) : myConfig(c), msgBoxOutdatedVersionActive(false)
{ {
myGuiInterface.reset(new GuiWrapper(myConfig, this)); myGuiInterface.reset(new GuiWrapper(myConfig, this));
@@ -341,7 +341,17 @@ void startWindowImpl::joinGameLobby() {
void startWindowImpl::callInternetGameLoginDialog() { void startWindowImpl::callInternetGameLoginDialog() {
//login //login
//HACK if Outdated Version info is available show it here!
if(msgBoxOutdatedVersionActive) {
msgBoxOutdatedVersionActive = false;
msgBoxOutdatedVersion.exec();
msgBoxOutdatedVersion.raise();
msgBoxOutdatedVersion.activateWindow();
}
myInternetGameLoginDialog->exec(); myInternetGameLoginDialog->exec();
if(myInternetGameLoginDialog->result() == QDialog::Accepted) { if(myInternetGameLoginDialog->result() == QDialog::Accepted) {
//send login infos //send login infos
mySession->setLogin( mySession->setLogin(
@@ -881,19 +891,27 @@ void startWindowImpl::networkNotification(int notificationId)
QMessageBox::Close); } QMessageBox::Close); }
break; break;
case NTF_NET_NEW_RELEASE_AVAILABLE: 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."), msgBoxOutdatedVersion.setIcon(QMessageBox::Information);
QMessageBox::Close, this); msgBoxOutdatedVersion.setWindowTitle(tr("Network Notification"));
msgBox.setTextFormat(Qt::RichText); 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."));
msgBox.show(); msgBoxOutdatedVersion.setTextFormat(Qt::RichText);
msgBoxOutdatedVersion.setStandardButtons(QMessageBox::Ok);
msgBoxOutdatedVersion.setDefaultButton(QMessageBox::Ok);
msgBoxOutdatedVersionActive = true;
} }
break; break;
case NTF_NET_OUTDATED_BETA: 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."), msgBoxOutdatedVersion.setIcon(QMessageBox::Information);
QMessageBox::Close, this); msgBoxOutdatedVersion.setWindowTitle(tr("Network Notification"));
msgBox.setTextFormat(Qt::RichText); 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."));
msgBox.show(); msgBoxOutdatedVersion.setTextFormat(Qt::RichText);
msgBoxOutdatedVersion.setStandardButtons(QMessageBox::Ok);
msgBoxOutdatedVersion.setDefaultButton(QMessageBox::Ok);
msgBoxOutdatedVersionActive = true;
} }
break; break;
} }
+4
View File
@@ -24,6 +24,7 @@
#include <assert.h> #include <assert.h>
#include "ui_startwindow.h" #include "ui_startwindow.h"
#include "game_defs.h" #include "game_defs.h"
#include "QMessageBox"
class GuiInterface; class GuiInterface;
class GuiWrapper; class GuiWrapper;
@@ -149,6 +150,9 @@ private:
serverListDialogImpl *myServerListDialog; serverListDialogImpl *myServerListDialog;
internetGameLoginDialogImpl *myInternetGameLoginDialog; internetGameLoginDialogImpl *myInternetGameLoginDialog;
QMessageBox msgBoxOutdatedVersion;
bool msgBoxOutdatedVersionActive;
friend class GuiWrapper; friend class GuiWrapper;
}; };