mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Messages
This commit is contained in:
@@ -77,7 +77,7 @@ void InstructorsView::loadInstructorsFromDB()
|
||||
else
|
||||
{//Не Залогинен
|
||||
//ItemInstructor->setText(ColumnsTreeUsers::clmn_Logged, tr("no"));
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Logged, QIcon(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
//ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Logged, QIcon(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
|
||||
//Скрываем архивных (при необходимости)
|
||||
@@ -96,13 +96,19 @@ void InstructorsView::loadInstructorsFromDB()
|
||||
if(mapNewMsg.value(instructor.getID()))
|
||||
{
|
||||
if(lastCurrentID == instructor.getID())
|
||||
mapNewMsg.take(lastCurrentID);
|
||||
{
|
||||
//mapNewMsg.take(lastCurrentID);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
for (int i = 0; i < ColumnsTreeUsers::clmn_count; i++)
|
||||
{
|
||||
ItemInstructor->setBackground(i, QBrush(QColor(250, 210, 1)));
|
||||
}
|
||||
*/
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Messages, QIcon(QStringLiteral(":/resources/icons/sendMsg.png")));
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Messages, QString::number(mapNewMsg.value(instructor.getID())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void ViewerInstructors::slot_receiveMessage(ClientMessage clientMessage)
|
||||
int id_instructor = clientMessage.fromId.toInt();
|
||||
|
||||
mtxmapNewMsg.lock();
|
||||
mapNewMsg.insert(id_instructor, true);
|
||||
mapNewMsg.insert(id_instructor, mapNewMsg.value(id_instructor) + 1);
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
slot_NeedUpdateUI(true, false);
|
||||
@@ -121,6 +121,8 @@ void ViewerInstructors::on_treeWidgetItemClicked(QTreeWidgetItem *item, int colu
|
||||
item->setBackground(i, QBrush(Qt::GlobalColor::white));
|
||||
}
|
||||
mapNewMsg.take(newCurrentID);
|
||||
item->setIcon(ColumnsTreeUsers::clmn_Messages, QIcon());
|
||||
item->setText(ColumnsTreeUsers::clmn_Messages, "");
|
||||
}
|
||||
}
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
Reference in New Issue
Block a user