bugFixing 0

This commit is contained in:
2025-09-16 11:03:10 +03:00
parent 0e81d14566
commit 31cf125c2f
4 changed files with 72 additions and 7 deletions

View File

@@ -215,7 +215,16 @@ void EditorInstructors::on_btnArchive_clicked()
setArchiveVisible(state);
if(!state)
{
lastCurrentID = 0;
Instructor instructor = connectorToServer->getInstructor(lastCurrentID);
if(instructor.getID())
{
if(instructor.getArchived())
lastCurrentID = 0;
}
else
{
lastCurrentID = 0;
}
}
loadInstructorsFromDB();
}
@@ -225,7 +234,12 @@ void EditorInstructors::on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current
//Определяем доступность и функционал кнопок для выбранного элемента
if(current == nullptr)
{
ui->btnDeleteInstructor->setEnabled(false);
ui->btnToOrFromArchive->setEnabled(false);
ui->btnEdit->setEnabled(false);
return;
}
QTreeWidgetItem *treeItemParent = current->parent();
if(treeItemParent == nullptr)
@@ -269,6 +283,12 @@ void EditorInstructors::on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current
//ui->btnEdit->setEnabled(true);
ui->btnArchive->setEnabled(true);
}
else
{
ui->btnDeleteInstructor->setEnabled(false);
ui->btnToOrFromArchive->setEnabled(false);
ui->btnEdit->setEnabled(false);
}
}
bool EditorInstructors::verifyInstructor(Instructor instructor)

View File

@@ -46,8 +46,11 @@ void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
{
updateButtons();
if(treeInstructor)
loadInstructorsFromDB();
if(authComplited)
{
if(treeInstructor)
loadInstructorsFromDB();
}
}
void InstructorsView::preparationTreeWidget()