mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Оповещения о непрочитанных сообщениях
This commit is contained in:
@@ -98,6 +98,17 @@ void ViewerTrainees::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::slot_receiveMessage(ClientMessage clientMessage)
|
||||
{
|
||||
int id_trainee = clientMessage.fromId.toInt();
|
||||
|
||||
mtxmapNewMsg.lock();
|
||||
mapNewMsg.insert(id_trainee, true);
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
slot_NeedUpdateUI(false, true);
|
||||
}
|
||||
|
||||
void ViewerTrainees::on_btnEditorTrainees_clicked()
|
||||
{
|
||||
connectorToServer->sendQueryBlockAuth(true);
|
||||
@@ -181,6 +192,20 @@ void ViewerTrainees::on_treeWidgetItemClicked(QTreeWidgetItem *item, int column)
|
||||
|
||||
lastCurrentID = newCurrentID;
|
||||
|
||||
mtxmapNewMsg.lock();
|
||||
if(mapNewMsg.contains(newCurrentID))
|
||||
{//Есть непрочитанные сообщения от него
|
||||
if(mapNewMsg.value(newCurrentID))
|
||||
{
|
||||
for (int i = 0; i < ColumnsTreeUsers::clmn_count; i++)
|
||||
{
|
||||
item->setBackground(i, QBrush(Qt::GlobalColor::white));
|
||||
}
|
||||
mapNewMsg.take(newCurrentID);
|
||||
}
|
||||
}
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
Q_EMIT signal_traineeSelected(newCurrentID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user