introduce colors for chat dialog identifiers

This commit is contained in:
Volker Fischer 2008-08-15 20:26:50 +00:00
parent 8909762f06
commit 6fb18b16df
2 changed files with 19 additions and 6 deletions

View file

@ -37,6 +37,15 @@ CChannelSet::CChannelSet() : bWriteStatusHTMLFile ( false )
vecChannels[i].SetIsServer ( true );
}
// define colors for chat window identifiers
vstrChatColors.Init ( 6 );
vstrChatColors[0] = "mediumblue";
vstrChatColors[1] = "red";
vstrChatColors[2] = "darkorchid";
vstrChatColors[3] = "green";
vstrChatColors[4] = "maroon";
vstrChatColors[5] = "coral";
// CODE TAG: MAX_NUM_CHANNELS_TAG
// make sure we have MAX_NUM_CHANNELS connections!!!
// send message
@ -176,8 +185,10 @@ void CChannelSet::CreateAndSendChatTextForAllConChannels ( const int iCurChanID,
}
// add name of the client at the beginning of the message text
QString sCurColor = vstrChatColors[iCurChanID % vstrChatColors.Size()];
const QString strActualMessageText =
"<" + ChanName + "> " + strChatText;
"<font color=""" + sCurColor + """><b>&#60;" + ChanName +
"&#62;</b></font> " + strChatText;
// send chat text to all connected clients ---------------------------------

View file

@ -259,13 +259,15 @@ protected:
/* do not use the vector class since CChannel does not have appropriate
copy constructor/operator */
CChannel vecChannels[MAX_NUM_CHANNELS];
QMutex Mutex;
CChannel vecChannels[MAX_NUM_CHANNELS];
QMutex Mutex;
CVector<QString> vstrChatColors;
// HTML file server status
bool bWriteStatusHTMLFile;
QString strServerHTMLFileListName;
QString strServerNameWithPort;
bool bWriteStatusHTMLFile;
QString strServerHTMLFileListName;
QString strServerNameWithPort;
public slots:
// CODE TAG: MAX_NUM_CHANNELS_TAG