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,17 +61,21 @@ 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();
delete dlgEditor;
dlgEditor = nullptr;
if(authComplited)
loadInstructorsFromDB();
Q_EMIT signal_BlockAutorization(false);

View File

@@ -42,6 +42,9 @@ Q_SIGNALS:
private:
void updateButtons() override;
private:
QDialog* dlgEditor;
private:
Ui::ViewerInstructors *ui;
};

View File

@@ -8,6 +8,7 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, MessangerCo
ammTasksWidgetCommon(nullptr),
fimTasksWidgetCommon(nullptr),
messangerController(messangerController),
dlgEditor(nullptr),
ui(new Ui::ViewerTrainees)
{
ui->setupUi(this);
@@ -36,6 +37,9 @@ ViewerTrainees::~ViewerTrainees()
delete ammTasksWidgetCommon;
delete fimTasksWidgetCommon;
if(dlgEditor)
dlgEditor->close();
delete ui;
}
@@ -47,6 +51,9 @@ void ViewerTrainees::setAuthComplited(bool authComplited)
void ViewerTrainees::deactivate()
{
if(dlgEditor)
dlgEditor->close();
CommonView::deactivate();
ammTasksWidgetCommon->deactivate();
@@ -71,17 +78,21 @@ void ViewerTrainees::on_btnEditorTrainees_clicked()
{
Q_EMIT signal_BlockAutorization(true);
EditorTrainees editorTraineesGroups(connectorToServer, adminMode);
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, &editorTraineesGroups, &EditorTrainees::slot_NeedUpdateUI);
EditorTrainees* editorTraineesGroups = new EditorTrainees(connectorToServer, adminMode);
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorTraineesGroups, &EditorTrainees::slot_NeedUpdateUI);
QDialog* dialog = new QDialog(this);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorTraineesGroups);
dialog->setWindowTitle(tr("Editor of trainees"));
dialog->setMinimumSize(1600, 800);
dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog->exec();
dlgEditor = new QDialog(this);
QHBoxLayout *layout = new QHBoxLayout(dlgEditor);
layout->addWidget(editorTraineesGroups);
dlgEditor->setWindowTitle(tr("Editor of trainees"));
dlgEditor->setMinimumSize(1600, 800);
dlgEditor->setWindowFlags(dlgEditor->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dlgEditor->exec();
delete dlgEditor;
dlgEditor = nullptr;
if(authComplited)
loadTraineesFromDB();
Q_EMIT signal_BlockAutorization(false);

View File

@@ -52,6 +52,8 @@ private:
MessangerController* messangerController;
QDialog* dlgEditor;
private:
Ui::ViewerTrainees *ui;
};