some more chat dialog work
This commit is contained in:
parent
466354c39d
commit
24d57c412f
2 changed files with 36 additions and 2 deletions
|
@ -69,6 +69,14 @@ CChannelSet::CChannelSet()
|
|||
QObject::connect(&vecChannels[3],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh3()));
|
||||
QObject::connect(&vecChannels[4],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh4()));
|
||||
QObject::connect(&vecChannels[5],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh5()));
|
||||
|
||||
// chate text received
|
||||
QObject::connect(&vecChannels[0],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh0()));
|
||||
QObject::connect(&vecChannels[1],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh1()));
|
||||
QObject::connect(&vecChannels[2],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh2()));
|
||||
QObject::connect(&vecChannels[3],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh3()));
|
||||
QObject::connect(&vecChannels[4],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh4()));
|
||||
QObject::connect(&vecChannels[5],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh5()));
|
||||
}
|
||||
|
||||
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
||||
|
@ -107,6 +115,19 @@ void CChannelSet::CreateAndSendChanListForAllConChannels()
|
|||
}
|
||||
}
|
||||
|
||||
void CChannelSet::CreateAndSendChatTextForAllConChannels ( const QString& strName )
|
||||
{
|
||||
// send chat text to all connected clients
|
||||
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
|
||||
{
|
||||
if ( vecChannels[i].IsConnected() )
|
||||
{
|
||||
// send message
|
||||
vecChannels[i].CreateChatTextMes ( strName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CChannelSet::CreateAndSendChanListForAllExceptThisChan ( const int iCurChanID )
|
||||
{
|
||||
// create channel list
|
||||
|
@ -435,6 +456,9 @@ CChannel::CChannel() : sName ( "" ),
|
|||
|
||||
QObject::connect( &Protocol, SIGNAL ( ChangeChanName ( QString ) ),
|
||||
this, SLOT ( OnChangeChanName ( QString ) ) );
|
||||
|
||||
QObject::connect( &Protocol, SIGNAL ( ChatTextReceived ( QString ) ),
|
||||
this, SIGNAL ( ChatTextReceived ( QString ) ) );
|
||||
}
|
||||
|
||||
void CChannel::SetEnable ( const bool bNEnStat )
|
||||
|
|
|
@ -117,6 +117,7 @@ public:
|
|||
}
|
||||
void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); }
|
||||
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
|
||||
void CreateChatTextMes ( const QString& strName ) { Protocol.CreateChatTextMes ( strName ); }
|
||||
|
||||
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
||||
{
|
||||
|
@ -192,6 +193,7 @@ signals:
|
|||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||
void ProtocolStatus ( bool bOk );
|
||||
void NameHasChanged();
|
||||
void ChatTextReceived ( QString strName );
|
||||
};
|
||||
|
||||
|
||||
|
@ -237,6 +239,7 @@ protected:
|
|||
void CreateAndSendChanListForAllConChannels();
|
||||
void CreateAndSendChanListForAllExceptThisChan ( const int iCurChanID );
|
||||
void CreateAndSendChanListForThisChan ( const int iCurChanID );
|
||||
void CreateAndSendChatTextForAllConChannels ( const QString& strName );
|
||||
|
||||
/* do not use the vector class since CChannel does not have appropriate
|
||||
copy constructor/operator */
|
||||
|
@ -275,6 +278,13 @@ public slots:
|
|||
void OnNameHasChangedCh4() { CreateAndSendChanListForAllConChannels(); }
|
||||
void OnNameHasChangedCh5() { CreateAndSendChanListForAllConChannels(); }
|
||||
|
||||
void OnChatTextReceivedCh0(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
||||
void OnChatTextReceivedCh1(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
||||
void OnChatTextReceivedCh2(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
||||
void OnChatTextReceivedCh3(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
||||
void OnChatTextReceivedCh4(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
||||
void OnChatTextReceivedCh5(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
||||
|
||||
signals:
|
||||
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue