mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
bugFixing 0
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -46,8 +46,11 @@ void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||
{
|
||||
updateButtons();
|
||||
|
||||
if(treeInstructor)
|
||||
loadInstructorsFromDB();
|
||||
if(authComplited)
|
||||
{
|
||||
if(treeInstructor)
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsView::preparationTreeWidget()
|
||||
|
||||
Reference in New Issue
Block a user