New packet types implemented for timeout system - unused yet.
This commit is contained in:
@@ -13,13 +13,13 @@
|
||||
#include "session.h"
|
||||
|
||||
timeoutMsgBoxImpl::timeoutMsgBoxImpl(QMainWindow *parent)
|
||||
: QMessageBox(parent)
|
||||
: QMessageBox(parent), msgID(NETWORK_TIMEOUT_GENERIC)
|
||||
{
|
||||
okButton = this->addButton(QMessageBox::Ok);
|
||||
|
||||
this->setWindowTitle(tr("Timeout Warning"));
|
||||
this->setIcon(QMessageBox::Warning);
|
||||
this->setInformativeText(tr("Please click \"OK\" to stop timeout!"));
|
||||
this->setInformativeText(tr("Please click \"OK\" to stop the countdown!"));
|
||||
|
||||
timeOutTimer = new QTimer;
|
||||
|
||||
@@ -47,10 +47,12 @@ void timeoutMsgBoxImpl::timerRefresh() {
|
||||
sec -= realTimerValue/1000;
|
||||
if (sec < 0) sec = 0;
|
||||
switch (msgID) {
|
||||
case GENERIC: { this->setText(tr("Your connection is about to time out due to inactivity in %1 seconds.").arg(sec,0,10)); }
|
||||
break;
|
||||
case OPENGAMEADMINIDLE: { this->setText(tr("Your open game reaches timeout in %1 seconds.").arg(sec,0,10)); }
|
||||
break;
|
||||
case NETWORK_TIMEOUT_GAME_ADMIN_IDLE:
|
||||
this->setText(tr("Your open game reaches timeout in %1 seconds.").arg(sec,0,10));
|
||||
break;
|
||||
default:
|
||||
this->setText(tr("Your connection is about to time out due to inactivity in %1 seconds.").arg(sec,0,10));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public slots:
|
||||
void stopTimeout();
|
||||
|
||||
void setMySession ( boost::shared_ptr<Session> theValue ) { mySession = theValue; }
|
||||
void setMsgID ( int theValue ) { msgID = theValue; }
|
||||
void setMsgID ( NetTimeoutReason theValue ) { msgID = theValue; }
|
||||
void setTimeoutDuration ( int theValue ) { timeoutDuration = theValue; }
|
||||
|
||||
private:
|
||||
@@ -46,7 +46,7 @@ private:
|
||||
QTimer *timeOutTimer;
|
||||
QPushButton *okButton;
|
||||
boost::shared_ptr<Session> mySession;
|
||||
int msgID;
|
||||
NetTimeoutReason msgID;
|
||||
int timeoutDuration;
|
||||
boost::timers::portable::microsec_timer realTimer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user