mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Вывел все окна в свои диалоги
This commit is contained in:
@@ -43,6 +43,8 @@ add_library(InstructorsAndTrainees SHARED
|
|||||||
trainees/personalcardtrainee.ui
|
trainees/personalcardtrainee.ui
|
||||||
trainees/dialogcardtrainee.cpp
|
trainees/dialogcardtrainee.cpp
|
||||||
trainees/dialogcardtrainee.h
|
trainees/dialogcardtrainee.h
|
||||||
|
trainees/dialogredactortrainees.cpp
|
||||||
|
trainees/dialogredactortrainees.h
|
||||||
|
|
||||||
instructors/viewerinstructors.cpp
|
instructors/viewerinstructors.cpp
|
||||||
instructors/viewerinstructors.h
|
instructors/viewerinstructors.h
|
||||||
@@ -58,6 +60,8 @@ add_library(InstructorsAndTrainees SHARED
|
|||||||
instructors/dialogauthorizationinstructor.ui
|
instructors/dialogauthorizationinstructor.ui
|
||||||
instructors/instructorsview.cpp
|
instructors/instructorsview.cpp
|
||||||
instructors/instructorsview.h
|
instructors/instructorsview.h
|
||||||
|
instructors/dialogredactorinstructors.cpp
|
||||||
|
instructors/dialogredactorinstructors.h
|
||||||
|
|
||||||
connectorToServer/connectortoserver.cpp
|
connectorToServer/connectortoserver.cpp
|
||||||
connectorToServer/connectortoserver.h
|
connectorToServer/connectortoserver.h
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#include <QHBoxLayout>
|
||||||
|
#include "dialogredactorinstructors.h"
|
||||||
|
|
||||||
|
DialogRedactorInstructors::DialogRedactorInstructors(ConnectorToServer* connectorToServer,
|
||||||
|
bool adminMode, QWidget *parent) :
|
||||||
|
QDialog(parent,
|
||||||
|
Qt::WindowSystemMenuHint
|
||||||
|
| Qt::WindowMaximizeButtonHint
|
||||||
|
| Qt::WindowMinimizeButtonHint
|
||||||
|
| Qt::WindowCloseButtonHint),
|
||||||
|
editorInstructors(nullptr)
|
||||||
|
{
|
||||||
|
editorInstructors = new EditorInstructors(connectorToServer, adminMode, this);
|
||||||
|
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
|
||||||
|
editorInstructors->activate();
|
||||||
|
|
||||||
|
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||||
|
layout->addWidget(editorInstructors);
|
||||||
|
this->setWindowTitle(tr("Editor of instructors"));
|
||||||
|
this->setMinimumSize(1400, 700);
|
||||||
|
this->setWindowState(Qt::WindowMaximized);
|
||||||
|
this->setModal(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogRedactorInstructors::~DialogRedactorInstructors()
|
||||||
|
{
|
||||||
|
delete editorInstructors;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DialogRedactorInstructors::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
editorInstructors->close();
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef DIALOGREDACTORINSTRUCTORS_H
|
||||||
|
#define DIALOGREDACTORINSTRUCTORS_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QObject>
|
||||||
|
#include "connectortoserver.h"
|
||||||
|
#include "editorinstructors.h"
|
||||||
|
|
||||||
|
class DialogRedactorInstructors : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
DialogRedactorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||||
|
~DialogRedactorInstructors();
|
||||||
|
|
||||||
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
EditorInstructors* editorInstructors;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGREDACTORINSTRUCTORS_H
|
||||||
@@ -37,6 +37,11 @@ EditorInstructors::~EditorInstructors()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorInstructors::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void EditorInstructors::on_btnNewInstructor_clicked()
|
void EditorInstructors::on_btnNewInstructor_clicked()
|
||||||
{
|
{
|
||||||
Instructor instructor;
|
Instructor instructor;
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public:
|
|||||||
explicit EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
explicit EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||||
~EditorInstructors();
|
~EditorInstructors();
|
||||||
|
|
||||||
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void on_btnNewInstructor_clicked();
|
void on_btnNewInstructor_clicked();
|
||||||
void on_btnDeleteInstructor_clicked();
|
void on_btnDeleteInstructor_clicked();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
|
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
|
||||||
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
|
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
|
||||||
dlgEditor(nullptr),
|
dlgRedactor(nullptr),
|
||||||
ui(new Ui::ViewerInstructors)
|
ui(new Ui::ViewerInstructors)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@@ -24,8 +24,8 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
|
|||||||
|
|
||||||
ViewerInstructors::~ViewerInstructors()
|
ViewerInstructors::~ViewerInstructors()
|
||||||
{
|
{
|
||||||
if(dlgEditor)
|
if(dlgRedactor)
|
||||||
dlgEditor->close();
|
dlgRedactor->close();
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@ void ViewerInstructors::setAuthComplited(bool authComplited)
|
|||||||
|
|
||||||
void ViewerInstructors::deactivate()
|
void ViewerInstructors::deactivate()
|
||||||
{
|
{
|
||||||
if(dlgEditor)
|
if(dlgRedactor)
|
||||||
dlgEditor->close();
|
dlgRedactor->close();
|
||||||
|
|
||||||
CommonView::deactivate();
|
CommonView::deactivate();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
@@ -60,25 +60,14 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
|
|||||||
{
|
{
|
||||||
Q_EMIT signal_BlockAutorization(true);
|
Q_EMIT signal_BlockAutorization(true);
|
||||||
|
|
||||||
EditorInstructors* editorInstructors = new EditorInstructors(connectorToServer, adminMode);
|
dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this);
|
||||||
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
|
dlgRedactor->exec();
|
||||||
editorInstructors->activate();
|
|
||||||
|
|
||||||
dlgEditor = new QDialog(this,
|
if(dlgRedactor)
|
||||||
Qt::WindowSystemMenuHint
|
{
|
||||||
| Qt::WindowMaximizeButtonHint
|
delete dlgRedactor;
|
||||||
| Qt::WindowMinimizeButtonHint
|
dlgRedactor = nullptr;
|
||||||
| 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(authComplited)
|
if(authComplited)
|
||||||
loadInstructorsFromDB();
|
loadInstructorsFromDB();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define INSTRUCTORSWIDGET_H
|
#define INSTRUCTORSWIDGET_H
|
||||||
|
|
||||||
#include "instructorsview.h"
|
#include "instructorsview.h"
|
||||||
|
#include "dialogredactorinstructors.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ViewerInstructors;
|
class ViewerInstructors;
|
||||||
@@ -43,7 +44,7 @@ private:
|
|||||||
void updateButtons() override;
|
void updateButtons() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDialog* dlgEditor;
|
DialogRedactorInstructors* dlgRedactor;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ViewerInstructors *ui;
|
Ui::ViewerInstructors *ui;
|
||||||
|
|||||||
@@ -136,6 +136,12 @@ void AMMtasksWidget::resizeEvent(QResizeEvent *event)
|
|||||||
treeWidget->setColumnWidth(ColumnsTreeAMM::clmnAMM_PMorDM, widthPMorDM);
|
treeWidget->setColumnWidth(ColumnsTreeAMM::clmnAMM_PMorDM, widthPMorDM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AMMtasksWidget::closeDlgCheckTask()
|
||||||
|
{
|
||||||
|
if(dlgCheckerTask)
|
||||||
|
dlgCheckerTask->close();
|
||||||
|
}
|
||||||
|
|
||||||
void AMMtasksWidget::changeEvent(QEvent *event)
|
void AMMtasksWidget::changeEvent(QEvent *event)
|
||||||
{
|
{
|
||||||
// В случае получения события изменения языка приложения
|
// В случае получения события изменения языка приложения
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
void closeDlgCheckTask();
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent * event) override;
|
void changeEvent(QEvent * event) override;
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ DialogChekerTask::DialogChekerTask(ConnectorToServer* connectorToServer, QString
|
|||||||
layout->addWidget(checkerTask);
|
layout->addWidget(checkerTask);
|
||||||
this->setWindowTitle(tr("Check Task"));
|
this->setWindowTitle(tr("Check Task"));
|
||||||
this->setMinimumSize(1400, 700);
|
this->setMinimumSize(1400, 700);
|
||||||
|
if(type == "fim")
|
||||||
this->setWindowState(Qt::WindowMaximized);
|
this->setWindowState(Qt::WindowMaximized);
|
||||||
this->setModal(true);
|
this->setModal(true);
|
||||||
}
|
}
|
||||||
|
|||||||
33
InstructorsAndTrainees/trainees/dialogredactortrainees.cpp
Normal file
33
InstructorsAndTrainees/trainees/dialogredactortrainees.cpp
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#include <QHBoxLayout>
|
||||||
|
#include "dialogredactortrainees.h"
|
||||||
|
|
||||||
|
DialogRedactorTrainees::DialogRedactorTrainees(ConnectorToServer* connectorToServer,
|
||||||
|
bool adminMode, QWidget *parent) :
|
||||||
|
QDialog(parent,
|
||||||
|
Qt::WindowSystemMenuHint
|
||||||
|
| Qt::WindowMaximizeButtonHint
|
||||||
|
| Qt::WindowMinimizeButtonHint
|
||||||
|
| Qt::WindowCloseButtonHint),
|
||||||
|
editorTraineesGroups(nullptr)
|
||||||
|
{
|
||||||
|
editorTraineesGroups = new EditorTrainees(connectorToServer, adminMode, this);
|
||||||
|
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorTraineesGroups, &EditorTrainees::slot_NeedUpdateUI);
|
||||||
|
editorTraineesGroups->activate();
|
||||||
|
|
||||||
|
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||||
|
layout->addWidget(editorTraineesGroups);
|
||||||
|
this->setWindowTitle(tr("Editor of trainees"));
|
||||||
|
this->setMinimumSize(1400, 700);
|
||||||
|
this->setWindowState(Qt::WindowMaximized);
|
||||||
|
this->setModal(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogRedactorTrainees::~DialogRedactorTrainees()
|
||||||
|
{
|
||||||
|
delete editorTraineesGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DialogRedactorTrainees::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
editorTraineesGroups->close();
|
||||||
|
}
|
||||||
22
InstructorsAndTrainees/trainees/dialogredactortrainees.h
Normal file
22
InstructorsAndTrainees/trainees/dialogredactortrainees.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef DIALOGREDACTORTRAINEES_H
|
||||||
|
#define DIALOGREDACTORTRAINEES_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QObject>
|
||||||
|
#include "connectortoserver.h"
|
||||||
|
#include "editortrainees.h"
|
||||||
|
|
||||||
|
class DialogRedactorTrainees : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
DialogRedactorTrainees(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||||
|
~DialogRedactorTrainees();
|
||||||
|
|
||||||
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
EditorTrainees* editorTraineesGroups;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGREDACTORTRAINEES_H
|
||||||
@@ -41,6 +41,11 @@ EditorTrainees::~EditorTrainees()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorTrainees::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void EditorTrainees::on_btnNewGroup_clicked()
|
void EditorTrainees::on_btnNewGroup_clicked()
|
||||||
{
|
{
|
||||||
Group group;
|
Group group;
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public:
|
|||||||
explicit EditorTrainees(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
explicit EditorTrainees(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||||
~EditorTrainees();
|
~EditorTrainees();
|
||||||
|
|
||||||
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void on_btnNewGroup_clicked();
|
void on_btnNewGroup_clicked();
|
||||||
void on_btnDeleteGroup_clicked();
|
void on_btnDeleteGroup_clicked();
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ PersonalCardTrainee::~PersonalCardTrainee()
|
|||||||
void PersonalCardTrainee::closeEvent(QCloseEvent *event)
|
void PersonalCardTrainee::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
fimTasksWidget_personal->closeDlgCheckTask();
|
fimTasksWidget_personal->closeDlgCheckTask();
|
||||||
|
ammTasksWidget_personal->closeDlgCheckTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PersonalCardTrainee::loadInfo()
|
void PersonalCardTrainee::loadInfo()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, MessangerCo
|
|||||||
ammTasksWidgetCommon(nullptr),
|
ammTasksWidgetCommon(nullptr),
|
||||||
fimTasksWidgetCommon(nullptr),
|
fimTasksWidgetCommon(nullptr),
|
||||||
messangerController(messangerController),
|
messangerController(messangerController),
|
||||||
dlgEditor(nullptr),
|
dlgRedactor(nullptr),
|
||||||
dlgCardTrainee(nullptr),
|
dlgCardTrainee(nullptr),
|
||||||
ui(new Ui::ViewerTrainees)
|
ui(new Ui::ViewerTrainees)
|
||||||
{
|
{
|
||||||
@@ -48,8 +48,8 @@ ViewerTrainees::~ViewerTrainees()
|
|||||||
fimTasksWidgetCommon = nullptr;
|
fimTasksWidgetCommon = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dlgEditor)
|
if(dlgRedactor)
|
||||||
dlgEditor->close();
|
dlgRedactor->close();
|
||||||
|
|
||||||
if(dlgCardTrainee)
|
if(dlgCardTrainee)
|
||||||
dlgCardTrainee->close();
|
dlgCardTrainee->close();
|
||||||
@@ -65,13 +65,11 @@ void ViewerTrainees::setAuthComplited(bool authComplited)
|
|||||||
|
|
||||||
void ViewerTrainees::deactivate()
|
void ViewerTrainees::deactivate()
|
||||||
{
|
{
|
||||||
if(dlgEditor)
|
if(dlgRedactor)
|
||||||
dlgEditor->close();
|
dlgRedactor->close();
|
||||||
|
|
||||||
if(dlgCardTrainee)
|
if(dlgCardTrainee)
|
||||||
{
|
|
||||||
dlgCardTrainee->close();
|
dlgCardTrainee->close();
|
||||||
}
|
|
||||||
|
|
||||||
CommonView::deactivate();
|
CommonView::deactivate();
|
||||||
|
|
||||||
@@ -96,25 +94,14 @@ void ViewerTrainees::on_btnEditorTrainees_clicked()
|
|||||||
{
|
{
|
||||||
Q_EMIT signal_BlockAutorization(true);
|
Q_EMIT signal_BlockAutorization(true);
|
||||||
|
|
||||||
EditorTrainees* editorTraineesGroups = new EditorTrainees(connectorToServer, adminMode);
|
dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this);
|
||||||
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorTraineesGroups, &EditorTrainees::slot_NeedUpdateUI);
|
dlgRedactor->exec();
|
||||||
editorTraineesGroups->activate();
|
|
||||||
|
|
||||||
dlgEditor = new QDialog(this,
|
if(dlgRedactor)
|
||||||
Qt::WindowSystemMenuHint
|
{
|
||||||
| Qt::WindowMaximizeButtonHint
|
delete dlgRedactor;
|
||||||
| Qt::WindowMinimizeButtonHint
|
dlgRedactor = nullptr;
|
||||||
| Qt::WindowCloseButtonHint);
|
}
|
||||||
QHBoxLayout *layout = new QHBoxLayout(dlgEditor);
|
|
||||||
layout->addWidget(editorTraineesGroups);
|
|
||||||
dlgEditor->setWindowTitle(tr("Editor of trainees"));
|
|
||||||
dlgEditor->setMinimumSize(1400, 700);
|
|
||||||
dlgEditor->setWindowState(Qt::WindowMaximized);
|
|
||||||
dlgEditor->setModal(true);
|
|
||||||
dlgEditor->exec();
|
|
||||||
|
|
||||||
delete dlgEditor;
|
|
||||||
dlgEditor = nullptr;
|
|
||||||
|
|
||||||
if(authComplited)
|
if(authComplited)
|
||||||
loadTraineesFromDB();
|
loadTraineesFromDB();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "fimtaskswidget.h"
|
#include "fimtaskswidget.h"
|
||||||
#include "messangercontroller.h"
|
#include "messangercontroller.h"
|
||||||
#include "dialogcardtrainee.h"
|
#include "dialogcardtrainee.h"
|
||||||
|
#include "dialogredactortrainees.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ViewerTrainees;
|
class ViewerTrainees;
|
||||||
@@ -53,7 +54,7 @@ private:
|
|||||||
|
|
||||||
MessangerController* messangerController;
|
MessangerController* messangerController;
|
||||||
|
|
||||||
QDialog* dlgEditor;
|
DialogRedactorTrainees* dlgRedactor;
|
||||||
DialogCardTrainee* dlgCardTrainee;
|
DialogCardTrainee* dlgCardTrainee;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user