closeChildDlg

This commit is contained in:
2025-11-28 12:32:53 +03:00
parent 612fcc8aa7
commit 8ad6d06f18
7 changed files with 100 additions and 22 deletions

View File

@@ -22,6 +22,7 @@ AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, TypeListTre
waitAnimationWidget(nullptr),
dlgCheckerTask(nullptr),
dlgListSubProc(nullptr),
specialMessageBox(nullptr),
flOnlyActive(false),
lastCurrentID(0)
{
@@ -145,16 +146,19 @@ void AMMtasksWidget::resizeEvent(QResizeEvent *event)
waitAnimationWidget->resize(size);
}
void AMMtasksWidget::closeDlgCheckTask()
void AMMtasksWidget::closeEvent(QCloseEvent *event)
{
closeChildDlg();
}
void AMMtasksWidget::closeChildDlg()
{
if(dlgCheckerTask)
dlgCheckerTask->close();
}
void AMMtasksWidget::closeDlgListSubProc()
{
if(dlgListSubProc)
dlgListSubProc->close();
if(specialMessageBox)
specialMessageBox->close();
}
void AMMtasksWidget::changeEvent(QEvent *event)
@@ -325,10 +329,16 @@ void AMMtasksWidget::slot_UpdateSubProcForDMCode(QString dmCode)
lastSelectedTask.listSubProc.clear();
dlgListSubProc->getListCheckedSubProc(&lastSelectedTask.listSubProc);
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("Assign this task?")).exec() == QDialog::Accepted)
specialMessageBox = new SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("Assign this task?"));
if(specialMessageBox->exec() == QDialog::Accepted)
{
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE, idTraineeSelected, &lastSelectedTask);
}
if(specialMessageBox)
{
delete specialMessageBox;
specialMessageBox = nullptr;
}
break;
}
case QDialog::Rejected:
@@ -347,10 +357,16 @@ void AMMtasksWidget::slot_UpdateSubProcForDMCode(QString dmCode)
{
lastSelectedTask.listSubProc.clear();
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("Assign this task?")).exec() == QDialog::Accepted)
specialMessageBox = new SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("Assign this task?"));
if(specialMessageBox->exec() == QDialog::Accepted)
{
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE, idTraineeSelected, &lastSelectedTask);
}
if(specialMessageBox)
{
delete specialMessageBox;
specialMessageBox = nullptr;
}
}
}
}
@@ -504,11 +520,18 @@ void AMMtasksWidget::on_btnDelete_clicked()
int id = treeItemCurrent->text(ColumnsTreeAMM::clmnAMM_ID).toInt();
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted)
specialMessageBox = new SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?"));
if(specialMessageBox->exec() == QDialog::Accepted)
{
waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_AMM_TO_TRAINEE, id);
}
if(specialMessageBox)
{
delete specialMessageBox;
specialMessageBox = nullptr;
}
}
}
}