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:
@@ -22,6 +22,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
messangerWidget(nullptr),
|
||||
messangerController(nullptr),
|
||||
dlgTasksCommon(nullptr),
|
||||
dlgSettings(nullptr),
|
||||
adminMode(false),
|
||||
loginInstructorLoggedInLocal(QStringLiteral("")),
|
||||
nameInstructorLoggedInLocal(QStringLiteral("")),
|
||||
@@ -107,6 +108,9 @@ InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
|
||||
if(dlgTasksCommon)
|
||||
dlgTasksCommon->close();
|
||||
|
||||
if(dlgSettings)
|
||||
dlgSettings->close();
|
||||
|
||||
delete messangerController;
|
||||
delete viewerInstructors;
|
||||
delete viewerTrainees;
|
||||
@@ -285,6 +289,9 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
viewerTrainees->deactivate();
|
||||
viewerInstructors->deactivate();
|
||||
|
||||
if(dlgSettings)
|
||||
dlgSettings->deactivate();
|
||||
|
||||
messangerController->deleteAllWidgets();
|
||||
|
||||
loginInstructorLoggedInLocal = "";
|
||||
@@ -466,6 +473,9 @@ void InstructorsAndTraineesWidget::on_btnAuthorizationInstructor_clicked()
|
||||
viewerTrainees->deactivate();
|
||||
viewerInstructors->deactivate();
|
||||
|
||||
if(dlgSettings)
|
||||
dlgSettings->deactivate();
|
||||
|
||||
messangerController->deleteAllWidgets();
|
||||
}
|
||||
else
|
||||
@@ -536,20 +546,19 @@ void InstructorsAndTraineesWidget::setLanguageInterfase()
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnSettings_clicked()
|
||||
{
|
||||
DialogSettings dlg(connectorToServer, (loginInstructorLoggedInLocal != ""), this);
|
||||
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
dlgSettings = new DialogSettings(connectorToServer, (loginInstructorLoggedInLocal != ""), this);
|
||||
dlgSettings->setWindowFlags(dlgSettings->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
connect(&dlg, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
|
||||
connect(&dlg, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
|
||||
connect(dlgSettings, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
|
||||
connect(dlgSettings, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
|
||||
|
||||
|
||||
switch( dlg.exec() )
|
||||
switch( dlgSettings->exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
language = dlg.getSettings().Language;
|
||||
language = dlgSettings->getSettings().Language;
|
||||
|
||||
if(dlg.settingsServerIsChanged())
|
||||
if(dlgSettings->settingsServerIsChanged())
|
||||
{
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Server settings have been changed. Please reconnect to the server.")).exec();
|
||||
|
||||
@@ -568,6 +577,12 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(dlgSettings)
|
||||
{
|
||||
delete dlgSettings;
|
||||
dlgSettings = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnEditorTrainees_clicked()
|
||||
|
||||
Reference in New Issue
Block a user