SpecialMessageBox

This commit is contained in:
2025-09-15 18:20:39 +03:00
parent bffbd0fe81
commit 0e81d14566
19 changed files with 366 additions and 215 deletions

View File

@@ -4,6 +4,7 @@
#include "ui_instructorsandtraineeswidget.h"
#include "dialogauthorizationinstructor.h"
#include "dialogsettings.h"
#include "specialmessagebox.h"
const QString InstructorsAndTraineesWidget::languageENG = "en_EN";
@@ -124,7 +125,7 @@ QString InstructorsAndTraineesWidget::loadStyleSheet()
QFile styleSheetFile(fileName);
if (!styleSheetFile.open(QFile::ReadOnly | QFile::Text))
{
QMessageBox::critical(this, tr("Attention!"), tr("The file could not be opened ") + fileName);
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The file could not be opened ") + fileName).exec();
return QStringLiteral("");
}
else
@@ -181,12 +182,11 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
connectorToServer->sendQueryTasksXML("fim");
connectorToServer->sendQueryTasksXML("amm");
//QMessageBox::information(this, tr("Instructor authorization"), tr("Successfully!"));
}
else
{
ui->btnAuthorizationInstructor->setChecked(false);
QMessageBox::warning(this, tr("Instructor authorization"), tr("Invalid login or password!"));
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization") + "\n" + tr("Invalid login or password!")).exec();
}
}
@@ -207,12 +207,11 @@ void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization
ui->btnEditorInstructors->setEnabled(false);
updateLabelLoggedInInstructor("","");
//QMessageBox::information(this, tr("Instructor deauthorization"), tr("Successfully!"));
}
else
{
ui->btnAuthorizationInstructor->setChecked(true);
QMessageBox::warning(this, tr("Instructor deauthorization"), tr("Error!"));
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor deauthorization") + "\n" + tr("Error!")).exec();
}
}
@@ -252,7 +251,7 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
updateLabelLoggedInInstructor(loginInstructorLoggedInLocal, nameInstructorLoggedInLocal);
updateLabelServer();
QMessageBox::warning(this, tr("Warning!"), tr("The server is not available"));
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The server is not available!")).exec();
}
}
@@ -440,7 +439,7 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked()
if(dlg.settingsServerIsChanged())
{
QMessageBox::warning(this, tr("Attention!"), tr("Server settings have been changed. Please reconnect to the server."));
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningWithoutButtons, tr("Server settings have been changed. Please reconnect to the server.")).exec();
if(authorizationIsCompleted())
deAuthorizationInstructor(loginInstructorLoggedInLocal);