introduce colors for chat dialog identifiers
This commit is contained in:
parent
8909762f06
commit
6fb18b16df
2 changed files with 19 additions and 6 deletions
|
@ -37,6 +37,15 @@ CChannelSet::CChannelSet() : bWriteStatusHTMLFile ( false )
|
||||||
vecChannels[i].SetIsServer ( true );
|
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
|
// CODE TAG: MAX_NUM_CHANNELS_TAG
|
||||||
// make sure we have MAX_NUM_CHANNELS connections!!!
|
// make sure we have MAX_NUM_CHANNELS connections!!!
|
||||||
// send message
|
// send message
|
||||||
|
@ -176,8 +185,10 @@ void CChannelSet::CreateAndSendChatTextForAllConChannels ( const int iCurChanID,
|
||||||
}
|
}
|
||||||
|
|
||||||
// add name of the client at the beginning of the message text
|
// add name of the client at the beginning of the message text
|
||||||
|
QString sCurColor = vstrChatColors[iCurChanID % vstrChatColors.Size()];
|
||||||
const QString strActualMessageText =
|
const QString strActualMessageText =
|
||||||
"<" + ChanName + "> " + strChatText;
|
"<font color=""" + sCurColor + """><b><" + ChanName +
|
||||||
|
"></b></font> " + strChatText;
|
||||||
|
|
||||||
|
|
||||||
// send chat text to all connected clients ---------------------------------
|
// send chat text to all connected clients ---------------------------------
|
||||||
|
|
|
@ -259,13 +259,15 @@ protected:
|
||||||
|
|
||||||
/* do not use the vector class since CChannel does not have appropriate
|
/* do not use the vector class since CChannel does not have appropriate
|
||||||
copy constructor/operator */
|
copy constructor/operator */
|
||||||
CChannel vecChannels[MAX_NUM_CHANNELS];
|
CChannel vecChannels[MAX_NUM_CHANNELS];
|
||||||
QMutex Mutex;
|
QMutex Mutex;
|
||||||
|
|
||||||
|
CVector<QString> vstrChatColors;
|
||||||
|
|
||||||
// HTML file server status
|
// HTML file server status
|
||||||
bool bWriteStatusHTMLFile;
|
bool bWriteStatusHTMLFile;
|
||||||
QString strServerHTMLFileListName;
|
QString strServerHTMLFileListName;
|
||||||
QString strServerNameWithPort;
|
QString strServerNameWithPort;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// CODE TAG: MAX_NUM_CHANNELS_TAG
|
// CODE TAG: MAX_NUM_CHANNELS_TAG
|
||||||
|
|
Loading…
Add table
Reference in a new issue