timeoutDialog gets duration from server

This commit is contained in:
doitux
2008-03-03 23:43:51 +00:00
parent c2313a20d6
commit 99b3f6b147
6 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->signalNetClientGam
void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->signalNetClientError(errorID, osErrorID); }
void GuiWrapper::SignalNetClientNotification(int notificationId) { myW->signalNetClientNotification(notificationId); }
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::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); }
+1 -1
View File
@@ -108,7 +108,7 @@ public:
void SignalNetClientError(int errorID, int osErrorID);
void SignalNetClientNotification(int notificationId);
void SignalNetClientStatsUpdate(const ServerStats &stats);
void SignalNetClientShowTimeoutDialog(int);
void SignalNetClientShowTimeoutDialog(int, int);
void SignalNetClientRemovedFromGame(int notificationId);
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
+3 -2
View File
@@ -638,7 +638,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalNetClientGameListPlayerLeft(unsigned, unsigned)), myGameLobbyDialog, SLOT(gameRemovePlayer(unsigned, unsigned)));
connect(this, SIGNAL(signalNetClientRemovedFromGame(int)), myGameLobbyDialog, SLOT(removedFromGame(int)));
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.
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->setMsgID(msgID);
myTimeoutDialog->setTimeoutDuration(duration);
myTimeoutDialog->show();
myTimeoutDialog->raise();
myTimeoutDialog->activateWindow();
+2 -2
View File
@@ -131,7 +131,7 @@ signals:
void signalNetClientError(int errorID, int osErrorID);
void signalNetClientNotification(int notificationId);
void signalNetClientStatsUpdate(ServerStats stats);
void signalNetClientShowTimeoutDialog(int);
void signalNetClientShowTimeoutDialog(int, int);
void signalNetClientRemovedFromGame(int notificationId);
void signalNetServerError(int errorID, int osErrorID);
void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights);
@@ -333,7 +333,7 @@ public slots:
void showMaximized ();
void quitPokerTH();
void showTimeoutDialog(int msgID);
void showTimeoutDialog(int msgID, int duration);
void hideTimeoutDialog();
// void paintEvent(QPaintEvent *);
@@ -42,7 +42,7 @@ void timeoutMsgBoxImpl::startTimeout() {
void timeoutMsgBoxImpl::timerRefresh() {
int sec = 60;
int sec = timeoutDuration;
unsigned int realTimerValue = realTimer.elapsed().total_milliseconds();
sec -= realTimerValue/1000;
if (sec < 0) sec = 0;
+3 -1
View File
@@ -39,13 +39,15 @@ public slots:
void setMySession ( boost::shared_ptr<Session> theValue ) { mySession = theValue; }
void setMsgID ( int theValue ) { msgID = theValue; }
void setTimeoutDuration ( int theValue ) { timeoutDuration = theValue; }
private:
QTimer *timeOutTimer;
QPushButton *okButton;
boost::shared_ptr<Session> mySession;
int msgID;
int timeoutDuration;
boost::timers::portable::microsec_timer realTimer;
};