mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
В основном работает
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
InstructorsView::InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||
CommonView(connectorToServer, type, parent)
|
||||
{
|
||||
|
||||
typeObject = TypeObject::objInstructor;
|
||||
}
|
||||
|
||||
void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||
@@ -39,7 +39,7 @@ void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
void InstructorsView::preparationTreeWidget(/*QTreeWidget* tree*/)
|
||||
void InstructorsView::preparationTreeWidget()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
|
||||
@@ -101,9 +101,6 @@ void InstructorsView::loadInstructorsFromDB()
|
||||
|
||||
//Инструкторы
|
||||
QList<Instructor> listInstructors;
|
||||
//TODO
|
||||
//listInstructors = dbLMS->getListInstructors();
|
||||
//sendSystem->getListInstructors();
|
||||
|
||||
listInstructors = connectorToServer->getListInstructors();
|
||||
|
||||
@@ -123,7 +120,7 @@ void InstructorsView::loadInstructorsFromDB()
|
||||
if(instructor.getArchived())
|
||||
{//Архивный
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Archived, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/icons/instructorArchive.png")));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/icons/archive.png")));
|
||||
setItemColorArchive(ItemInstructor);
|
||||
}
|
||||
else
|
||||
@@ -167,12 +164,15 @@ void InstructorsView::loadInstructorsFromDB()
|
||||
|
||||
treeWidget->expandAll();
|
||||
|
||||
/*
|
||||
//if(typeView == TypeView::control)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}
|
||||
}*/
|
||||
|
||||
setCurrentInstructor(lastCurrentID);
|
||||
|
||||
mtxTreeWidget.unlock();
|
||||
}
|
||||
@@ -183,3 +183,21 @@ void InstructorsView::reSetHeadTreeWidget()
|
||||
treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
|
||||
void InstructorsView::setCurrentInstructor(int id)
|
||||
{
|
||||
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
|
||||
if(item != nullptr)
|
||||
if(item->text(ColumnsTreeInsructors::clmn_ID).toInt() == id)
|
||||
{
|
||||
treeWidget->setCurrentItem(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user