This commit is contained in:
doitux
2008-03-03 10:25:32 +00:00
parent 39efcf3ddf
commit f5c82bb1f7
6 changed files with 37 additions and 31 deletions
+4 -4
View File
@@ -54,7 +54,7 @@ INCLUDEPATH += . \
src/gui/qt/mymessagedialog \ src/gui/qt/mymessagedialog \
src/gui/qt/gamelobbydialog \ src/gui/qt/gamelobbydialog \
src/gui/qt/gamelobbydialog/lobbychat \ src/gui/qt/gamelobbydialog/lobbychat \
src/gui/qt/gamelobbydialog/opengametimeoutmsgbox src/gui/qt/timeoutmsgbox
DEPENDPATH += . \ DEPENDPATH += . \
src \ src \
@@ -92,7 +92,7 @@ DEPENDPATH += . \
src/gui/qt/mymessagedialog \ src/gui/qt/mymessagedialog \
src/gui/qt/gamelobbydialog \ src/gui/qt/gamelobbydialog \
src/gui/qt/gamelobbydialog/lobbychat \ src/gui/qt/gamelobbydialog/lobbychat \
src/gui/qt/gamelobbydialog/opengametimeoutmsgbox src/gui/qt/timeoutmsgbox
# Input # Input
HEADERS += \ HEADERS += \
@@ -173,7 +173,7 @@ HEADERS += \
src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h \ src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h \
src/gui/qt/gamelobbydialog/mygamelisttreewidget.h \ src/gui/qt/gamelobbydialog/mygamelisttreewidget.h \
src/gui/qt/gamelobbydialog/lobbychat/lobbychat.h \ src/gui/qt/gamelobbydialog/lobbychat/lobbychat.h \
src/gui/qt/gamelobbydialog/opengametimeoutmsgbox\opengametimeoutmsgboximpl.h \ src/gui/qt/timeoutmsgbox\timeoutmsgboximpl.h \
src/gui/qt/mymessagedialog/mymessagedialogimpl.h \ src/gui/qt/mymessagedialog/mymessagedialogimpl.h \
src/gui/qttoolsinterface.h \ src/gui/qttoolsinterface.h \
src/gui/qt/qttools/qttoolswrapper.h \ src/gui/qt/qttools/qttoolswrapper.h \
@@ -232,7 +232,7 @@ SOURCES += \
src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp \ src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp \
src/gui/qt/gamelobbydialog/mygamelisttreewidget.cpp \ src/gui/qt/gamelobbydialog/mygamelisttreewidget.cpp \
src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp \ src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp \
src/gui/qt/gamelobbydialog/opengametimeoutmsgbox\opengametimeoutmsgboximpl.cpp \ src/gui/qt/timeoutmsgbox\timeoutmsgboximpl.cpp \
src/net/common/net_helper_client.cpp \ src/net/common/net_helper_client.cpp \
src/core/common/loghelper_client.cpp src/core/common/loghelper_client.cpp
@@ -12,7 +12,7 @@
#include "gamelobbydialogimpl.h" #include "gamelobbydialogimpl.h"
#include "lobbychat.h" #include "lobbychat.h"
#include "changecompleteblindsdialogimpl.h" #include "changecompleteblindsdialogimpl.h"
#include "opengametimeoutmsgboximpl.h" #include "timeoutmsgboximpl.h"
#include "session.h" #include "session.h"
#include "configfile.h" #include "configfile.h"
#include "gamedata.h" #include "gamedata.h"
@@ -32,8 +32,6 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
myOpenGameTimeoutMsgBoxImpl = new openGameTimeoutMsgBoxImpl(this, this);
//wait start game message //wait start game message
waitStartGameMsgBox = new QMessageBox(this); waitStartGameMsgBox = new QMessageBox(this);
waitStartGameMsgBox->setText(tr("Starting game. Please wait ...")); waitStartGameMsgBox->setText(tr("Starting game. Please wait ..."));
@@ -225,6 +223,7 @@ void gameLobbyDialogImpl::removedFromGame(int /*reason*/)
void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem* item, QTreeWidgetItem*) void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem* item, QTreeWidgetItem*)
{ {
if (!inGame && item) if (!inGame && item)
{ {
pushButton_JoinGame->setEnabled(true); pushButton_JoinGame->setEnabled(true);
@@ -845,6 +844,8 @@ void gameLobbyDialogImpl::joinAnyGameButtonRefresh() {
void gameLobbyDialogImpl::startOpenGameTimeout() { void gameLobbyDialogImpl::startOpenGameTimeout() {
myOpenGameTimeoutMsgBoxImpl.reset(new timeoutMsgBoxImpl(this, mySession, 1));
myOpenGameTimeoutMsgBoxImpl->show(); myOpenGameTimeoutMsgBoxImpl->show();
myOpenGameTimeoutMsgBoxImpl->raise(); myOpenGameTimeoutMsgBoxImpl->raise();
myOpenGameTimeoutMsgBoxImpl->activateWindow(); myOpenGameTimeoutMsgBoxImpl->activateWindow();
@@ -855,5 +856,3 @@ void gameLobbyDialogImpl::closeOpenGameTimeoutMsgBox() {
myOpenGameTimeoutMsgBoxImpl->hide(); myOpenGameTimeoutMsgBoxImpl->hide();
} }
void gameLobbyDialogImpl::openGameTimeoutStoped() { /*mySession->openGameTimeoutStoped();*/ }
@@ -27,7 +27,7 @@
class Session; class Session;
class ConfigFile; class ConfigFile;
class LobbyChat; class LobbyChat;
class openGameTimeoutMsgBoxImpl; class timeoutMsgBoxImpl;
/** /**
@author FThauer FHammer <webmaster@pokerth.net> @author FThauer FHammer <webmaster@pokerth.net>
@@ -102,7 +102,6 @@ public slots:
void showWaitStartGameMsgBox(); void showWaitStartGameMsgBox();
void startOpenGameTimeout(); void startOpenGameTimeout();
void openGameTimeoutStoped();
void closeOpenGameTimeoutMsgBox(); void closeOpenGameTimeoutMsgBox();
void joinAnyGameButtonRefresh(); void joinAnyGameButtonRefresh();
@@ -123,7 +122,7 @@ private:
int keyUpCounter; int keyUpCounter;
QMessageBox *waitStartGameMsgBox; QMessageBox *waitStartGameMsgBox;
QTimer *waitStartGameMsgBoxTimer; QTimer *waitStartGameMsgBoxTimer;
openGameTimeoutMsgBoxImpl *myOpenGameTimeoutMsgBoxImpl; boost::shared_ptr<timeoutMsgBoxImpl> myOpenGameTimeoutMsgBoxImpl;
protected: protected:
bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(QObject *obj, QEvent *event);
+1 -1
View File
@@ -1087,7 +1087,7 @@ void mainWindowImpl::initGui(int speed)
label_Pot->setText("Pot"); label_Pot->setText("Pot");
label_Total->setText("Total:"); label_Total->setText("Total:");
label_Sets->setText("Sets:"); label_Sets->setText("Bets:");
label_handNumber->setText("Hand:"); label_handNumber->setText("Hand:");
label_gameNumber->setText("Game:"); label_gameNumber->setText("Game:");
@@ -9,43 +9,49 @@
// Copyright: See COPYING file that comes with this distribution // Copyright: See COPYING file that comes with this distribution
// //
// //
#include "opengametimeoutmsgboximpl.h" #include "timeoutmsgboximpl.h"
#include "gamelobbydialogimpl.h" #include "session.h"
openGameTimeoutMsgBoxImpl::openGameTimeoutMsgBoxImpl(QDialog *parent, gameLobbyDialogImpl *l) timeoutMsgBoxImpl::timeoutMsgBoxImpl(QDialog *parent, Session *s, int id)
: QMessageBox(parent), myLobby(l) : QMessageBox(parent), mySession(s), msgId(id)
{ {
okButton = this->addButton(QMessageBox::Ok); okButton = this->addButton(QMessageBox::Ok);
this->setWindowTitle(tr("Open Game Timeout Warning")); this->setWindowTitle(tr("Timeout Warning"));
this->setIcon(QMessageBox::Warning); this->setIcon(QMessageBox::Warning);
this->setText(tr("Your open game reaches timeout in %1 seconds.").arg(60,0,10));
this->setInformativeText(tr("Please click \"OK\" to stop timeout!")); this->setInformativeText(tr("Please click \"OK\" to stop timeout!"));
timeOutTimer = new QTimer; timeOutTimer = new QTimer;
connect(timeOutTimer, SIGNAL(timeout()), this, SLOT(timerRefresh())); connect(timeOutTimer, SIGNAL(timeout()), this, SLOT(timerRefresh()));
connect(okButton, SIGNAL(clicked()), myLobby, SLOT(openGameTimeoutStoped())); // connect(okButton, SIGNAL(clicked()), mySession, SLOT(spechialSessionSlot(msgId)));
} }
openGameTimeoutMsgBoxImpl::~openGameTimeoutMsgBoxImpl() timeoutMsgBoxImpl::~timeoutMsgBoxImpl()
{ {
} }
void openGameTimeoutMsgBoxImpl::startTimeout() { void timeoutMsgBoxImpl::startTimeout() {
//start the real timer //start the real timer
realTimer.reset(); realTimer.reset();
realTimer.start(); realTimer.start();
timerRefresh();
timeOutTimer->start(1000); timeOutTimer->start(1000);
} }
void openGameTimeoutMsgBoxImpl::timerRefresh() { void timeoutMsgBoxImpl::timerRefresh() {
int sec = 60; int sec = 60;
unsigned int realTimerValue = realTimer.elapsed().total_milliseconds(); unsigned int realTimerValue = realTimer.elapsed().total_milliseconds();
sec -= realTimerValue/1000; sec -= realTimerValue/1000;
if (sec < 0) sec = 0; if (sec < 0) sec = 0;
this->setText(tr("Your open game reaches timeout in %1 seconds.").arg(sec,0,10)); switch (msgId) {
case 0: { this->setText(tr("Your connection is about to time out due to inactivity in %1 seconds.").arg(sec,0,10)); }
break;
case 1: { this->setText(tr("Your open game reaches timeout in %1 seconds.").arg(sec,0,10)); }
break;
}
} }
@@ -9,8 +9,8 @@
// Copyright: See COPYING file that comes with this distribution // Copyright: See COPYING file that comes with this distribution
// //
// //
#ifndef OPENGAMETIMEOUTMSGBOXIMPL_H #ifndef TIMEOUTMSGBOXIMPL_H
#define OPENGAMETIMEOUTMSGBOXIMPL_H #define TIMEOUTMSGBOXIMPL_H
#include <QMessageBox> #include <QMessageBox>
#include <QtGui> #include <QtGui>
@@ -20,15 +20,15 @@
/** /**
@author Felix Hammer <f.hammer@web.de> @author Felix Hammer <f.hammer@web.de>
*/ */
class gameLobbyDialogImpl; class Session;
class openGameTimeoutMsgBoxImpl : public QMessageBox class timeoutMsgBoxImpl : public QMessageBox
{ {
Q_OBJECT Q_OBJECT
public: public:
openGameTimeoutMsgBoxImpl(QDialog*, gameLobbyDialogImpl*); timeoutMsgBoxImpl(QDialog*, Session*, int);
~openGameTimeoutMsgBoxImpl(); ~timeoutMsgBoxImpl();
public slots: public slots:
@@ -36,9 +36,11 @@ public slots:
void timerRefresh(); void timerRefresh();
private: private:
QTimer *timeOutTimer; QTimer *timeOutTimer;
QPushButton *okButton; QPushButton *okButton;
gameLobbyDialogImpl *myLobby; Session *mySession;
int msgId;
boost::timers::portable::microsec_timer realTimer; boost::timers::portable::microsec_timer realTimer;
}; };