timeoutDialog gets duration from server
This commit is contained in:
@@ -120,7 +120,7 @@ void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->signalNetClientGam
|
|||||||
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->signalNetClientError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->signalNetClientError(errorID, osErrorID); }
|
||||||
void GuiWrapper::SignalNetClientNotification(int notificationId) { myW->signalNetClientNotification(notificationId); }
|
void GuiWrapper::SignalNetClientNotification(int notificationId) { myW->signalNetClientNotification(notificationId); }
|
||||||
void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myW->signalNetClientStatsUpdate(stats); }
|
void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myW->signalNetClientStatsUpdate(stats); }
|
||||||
void GuiWrapper::SignalNetClientShowTimeoutDialog(int msgID) { myW->signalNetClientShowTimeoutDialog(msgID); }
|
void GuiWrapper::SignalNetClientShowTimeoutDialog(int msgID, int duration) { myW->signalNetClientShowTimeoutDialog(msgID, duration); }
|
||||||
void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myW->signalNetClientRemovedFromGame(notificationId); }
|
void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myW->signalNetClientRemovedFromGame(notificationId); }
|
||||||
void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
||||||
void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
void SignalNetClientError(int errorID, int osErrorID);
|
void SignalNetClientError(int errorID, int osErrorID);
|
||||||
void SignalNetClientNotification(int notificationId);
|
void SignalNetClientNotification(int notificationId);
|
||||||
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
||||||
void SignalNetClientShowTimeoutDialog(int);
|
void SignalNetClientShowTimeoutDialog(int, int);
|
||||||
void SignalNetClientRemovedFromGame(int notificationId);
|
void SignalNetClientRemovedFromGame(int notificationId);
|
||||||
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
||||||
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
connect(this, SIGNAL(signalNetClientGameListPlayerLeft(unsigned, unsigned)), myGameLobbyDialog, SLOT(gameRemovePlayer(unsigned, unsigned)));
|
connect(this, SIGNAL(signalNetClientGameListPlayerLeft(unsigned, unsigned)), myGameLobbyDialog, SLOT(gameRemovePlayer(unsigned, unsigned)));
|
||||||
connect(this, SIGNAL(signalNetClientRemovedFromGame(int)), myGameLobbyDialog, SLOT(removedFromGame(int)));
|
connect(this, SIGNAL(signalNetClientRemovedFromGame(int)), myGameLobbyDialog, SLOT(removedFromGame(int)));
|
||||||
connect(this, SIGNAL(signalNetClientStatsUpdate(ServerStats)), myGameLobbyDialog, SLOT(updateStats(ServerStats)));
|
connect(this, SIGNAL(signalNetClientStatsUpdate(ServerStats)), myGameLobbyDialog, SLOT(updateStats(ServerStats)));
|
||||||
connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int)), this, SLOT(showTimeoutDialog(int)));
|
connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, int)), this, SLOT(showTimeoutDialog(int, int)));
|
||||||
|
|
||||||
// Errors are handled globally, not within one dialog.
|
// Errors are handled globally, not within one dialog.
|
||||||
connect(this, SIGNAL(signalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
connect(this, SIGNAL(signalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
||||||
@@ -3775,10 +3775,11 @@ void mainWindowImpl::leaveCurrentNetworkGame() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mainWindowImpl::showTimeoutDialog(int msgID) {
|
void mainWindowImpl::showTimeoutDialog(int msgID, int duration) {
|
||||||
|
|
||||||
myTimeoutDialog->setMySession(mySession);
|
myTimeoutDialog->setMySession(mySession);
|
||||||
myTimeoutDialog->setMsgID(msgID);
|
myTimeoutDialog->setMsgID(msgID);
|
||||||
|
myTimeoutDialog->setTimeoutDuration(duration);
|
||||||
myTimeoutDialog->show();
|
myTimeoutDialog->show();
|
||||||
myTimeoutDialog->raise();
|
myTimeoutDialog->raise();
|
||||||
myTimeoutDialog->activateWindow();
|
myTimeoutDialog->activateWindow();
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ signals:
|
|||||||
void signalNetClientError(int errorID, int osErrorID);
|
void signalNetClientError(int errorID, int osErrorID);
|
||||||
void signalNetClientNotification(int notificationId);
|
void signalNetClientNotification(int notificationId);
|
||||||
void signalNetClientStatsUpdate(ServerStats stats);
|
void signalNetClientStatsUpdate(ServerStats stats);
|
||||||
void signalNetClientShowTimeoutDialog(int);
|
void signalNetClientShowTimeoutDialog(int, int);
|
||||||
void signalNetClientRemovedFromGame(int notificationId);
|
void signalNetClientRemovedFromGame(int notificationId);
|
||||||
void signalNetServerError(int errorID, int osErrorID);
|
void signalNetServerError(int errorID, int osErrorID);
|
||||||
void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights);
|
void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights);
|
||||||
@@ -333,7 +333,7 @@ public slots:
|
|||||||
void showMaximized ();
|
void showMaximized ();
|
||||||
void quitPokerTH();
|
void quitPokerTH();
|
||||||
|
|
||||||
void showTimeoutDialog(int msgID);
|
void showTimeoutDialog(int msgID, int duration);
|
||||||
void hideTimeoutDialog();
|
void hideTimeoutDialog();
|
||||||
|
|
||||||
// void paintEvent(QPaintEvent *);
|
// void paintEvent(QPaintEvent *);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void timeoutMsgBoxImpl::startTimeout() {
|
|||||||
|
|
||||||
void timeoutMsgBoxImpl::timerRefresh() {
|
void timeoutMsgBoxImpl::timerRefresh() {
|
||||||
|
|
||||||
int sec = 60;
|
int sec = timeoutDuration;
|
||||||
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;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public slots:
|
|||||||
|
|
||||||
void setMySession ( boost::shared_ptr<Session> theValue ) { mySession = theValue; }
|
void setMySession ( boost::shared_ptr<Session> theValue ) { mySession = theValue; }
|
||||||
void setMsgID ( int theValue ) { msgID = theValue; }
|
void setMsgID ( int theValue ) { msgID = theValue; }
|
||||||
|
void setTimeoutDuration ( int theValue ) { timeoutDuration = theValue; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ private:
|
|||||||
QPushButton *okButton;
|
QPushButton *okButton;
|
||||||
boost::shared_ptr<Session> mySession;
|
boost::shared_ptr<Session> mySession;
|
||||||
int msgID;
|
int msgID;
|
||||||
|
int timeoutDuration;
|
||||||
boost::timers::portable::microsec_timer realTimer;
|
boost::timers::portable::microsec_timer realTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user