bugFixing 4

This commit is contained in:
2025-09-16 15:17:02 +03:00
parent b6fb178827
commit cba4008a06
4 changed files with 46 additions and 20 deletions

View File

@@ -5,6 +5,7 @@
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
dlgEditor(nullptr),
ui(new Ui::ViewerInstructors)
{
ui->setupUi(this);
@@ -23,6 +24,8 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
ViewerInstructors::~ViewerInstructors()
{
if(dlgEditor)
dlgEditor->close();
delete ui;
}
@@ -34,6 +37,9 @@ void ViewerInstructors::setAuthComplited(bool authComplited)
void ViewerInstructors::deactivate()
{
if(dlgEditor)
dlgEditor->close();
CommonView::deactivate();
updateButtons();
}
@@ -55,18 +61,22 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
{
Q_EMIT signal_BlockAutorization(true);
EditorInstructors editorInstructors(connectorToServer, adminMode);
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, &editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
EditorInstructors* editorInstructors = new EditorInstructors(connectorToServer, adminMode);
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
QDialog* dialog = new QDialog(this);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorInstructors);
dialog->setWindowTitle(tr("Editor of instructors"));
dialog->setMinimumSize(1600, 800);
dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog->exec();
dlgEditor = new QDialog(this);
QHBoxLayout *layout = new QHBoxLayout(dlgEditor);
layout->addWidget(editorInstructors);
dlgEditor->setWindowTitle(tr("Editor of instructors"));
dlgEditor->setMinimumSize(1600, 800);
dlgEditor->setWindowFlags(dlgEditor->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dlgEditor->exec();
loadInstructorsFromDB();
delete dlgEditor;
dlgEditor = nullptr;
if(authComplited)
loadInstructorsFromDB();
Q_EMIT signal_BlockAutorization(false);
}