Вывел все окна в свои диалоги

This commit is contained in:
2025-09-18 13:26:22 +03:00
parent a2cd5280bd
commit 8bb54cb56c
17 changed files with 166 additions and 51 deletions

View File

@@ -5,7 +5,7 @@
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
dlgEditor(nullptr),
dlgRedactor(nullptr),
ui(new Ui::ViewerInstructors)
{
ui->setupUi(this);
@@ -24,8 +24,8 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
ViewerInstructors::~ViewerInstructors()
{
if(dlgEditor)
dlgEditor->close();
if(dlgRedactor)
dlgRedactor->close();
delete ui;
}
@@ -37,8 +37,8 @@ void ViewerInstructors::setAuthComplited(bool authComplited)
void ViewerInstructors::deactivate()
{
if(dlgEditor)
dlgEditor->close();
if(dlgRedactor)
dlgRedactor->close();
CommonView::deactivate();
updateButtons();
@@ -60,25 +60,14 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
{
Q_EMIT signal_BlockAutorization(true);
EditorInstructors* editorInstructors = new EditorInstructors(connectorToServer, adminMode);
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
editorInstructors->activate();
dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this);
dlgRedactor->exec();
dlgEditor = new QDialog(this,
Qt::WindowSystemMenuHint
| Qt::WindowMaximizeButtonHint
| Qt::WindowMinimizeButtonHint
| Qt::WindowCloseButtonHint);
QHBoxLayout *layout = new QHBoxLayout(dlgEditor);
layout->addWidget(editorInstructors);
dlgEditor->setWindowTitle(tr("Editor of instructors"));
dlgEditor->setMinimumSize(1400, 700);
dlgEditor->setWindowState(Qt::WindowMaximized);
dlgEditor->setModal(true);
dlgEditor->exec();
delete dlgEditor;
dlgEditor = nullptr;
if(dlgRedactor)
{
delete dlgRedactor;
dlgRedactor = nullptr;
}
if(authComplited)
loadInstructorsFromDB();