almost finished ping message system
This commit is contained in:
parent
788908b0d2
commit
d8621f5839
3 changed files with 19 additions and 0 deletions
|
@ -54,6 +54,9 @@ CClient::CClient() : bRun ( false ), Socket ( &Channel ),
|
|||
|
||||
QObject::connect ( &Channel, SIGNAL ( ChatTextReceived ( QString ) ),
|
||||
this, SIGNAL ( ChatTextReceived ( QString ) ) );
|
||||
|
||||
QObject::connect ( &Channel, SIGNAL ( PingReceived ( QTime ) ),
|
||||
this, SLOT ( OnReceivePingMessage ( QTime ) ) );
|
||||
}
|
||||
|
||||
void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage )
|
||||
|
|
|
@ -111,6 +111,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
|
|||
QObject::connect ( cbOpenChatOnNewMessage, SIGNAL ( stateChanged ( int ) ),
|
||||
this, SLOT ( OnOpenChatOnNewMessageStateChanged ( int ) ) );
|
||||
|
||||
// misc
|
||||
QObject::connect ( pClient, SIGNAL ( PingTimeReceived ( int ) ),
|
||||
this, SLOT ( OnPingTimeResult ( int ) ) );
|
||||
|
||||
|
||||
// Timers ------------------------------------------------------------------
|
||||
// start timer for status bar
|
||||
|
@ -160,6 +164,16 @@ void CClientSettingsDlg::OnOpenChatOnNewMessageStateChanged ( int value )
|
|||
{
|
||||
pClient->SetOpenChatOnNewMessage ( value == Qt::Checked );
|
||||
UpdateDisplay();
|
||||
}
|
||||
|
||||
void CClientSettingsDlg::OnPingTimeResult ( int iPingTime )
|
||||
{
|
||||
|
||||
// TEST
|
||||
//TextLabelStdDevTimer->setText ( QString().setNum ( iPingTime ) + " ms" );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CClientSettingsDlg::UpdateDisplay()
|
||||
|
@ -170,6 +184,7 @@ void CClientSettingsDlg::UpdateDisplay()
|
|||
//pClient->SendPingMess();
|
||||
|
||||
|
||||
|
||||
// response time
|
||||
TextLabelStdDevTimer->setText ( QString().
|
||||
setNum ( pClient->GetTimingStdDev(), 'f', 2 ) + " ms" );
|
||||
|
|
|
@ -72,4 +72,5 @@ public slots:
|
|||
void OnSliderNetBufSiFactIn ( int value );
|
||||
void OnSliderNetBufSiFactOut ( int value );
|
||||
void OnOpenChatOnNewMessageStateChanged ( int value );
|
||||
void OnPingTimeResult ( int iPingTime );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue