diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 76852d56..6e426431 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -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); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index d4840ae6..74e57ca3 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -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); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index e22babcd..74aba4b8 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -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(); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index b0445516..6cf91226 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -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 *); diff --git a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp index 88657144..21507041 100644 --- a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp +++ b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp @@ -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; diff --git a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h index 984d5899..d425d6a4 100644 --- a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h +++ b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h @@ -39,13 +39,15 @@ public slots: void setMySession ( boost::shared_ptr theValue ) { mySession = theValue; } void setMsgID ( int theValue ) { msgID = theValue; } - + void setTimeoutDuration ( int theValue ) { timeoutDuration = theValue; } + private: QTimer *timeOutTimer; QPushButton *okButton; boost::shared_ptr mySession; int msgID; + int timeoutDuration; boost::timers::portable::microsec_timer realTimer; };