mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
GUI.Тип ошибки авторизации
This commit is contained in:
@@ -54,6 +54,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
||||
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
||||
connect(connectorToServer, &ConnectorToServer::sigServerBlocked, this, &InstructorsAndTraineesWidget::slot_ServerBlocked);
|
||||
connect(connectorToServer, &ConnectorToServer::sigErrorAuth, this, &InstructorsAndTraineesWidget::slot_ErrorAuth);
|
||||
connect(connectorToServer,&ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
||||
|
||||
messangerController = new MessangerController(connectorToServer, this);
|
||||
@@ -239,16 +240,14 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
|
||||
viewerInstructors->activate();
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
flTryLogin = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization.") + "\n" + tr("Invalid login or password!")).exec();
|
||||
//waitAnimationWidget->hideWithStop();
|
||||
//ui->btnAuthorizationInstructor->setChecked(false);
|
||||
}
|
||||
|
||||
flTryLogin = false;
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization *serverDeAuth)
|
||||
@@ -285,7 +284,39 @@ void InstructorsAndTraineesWidget::slot_ServerBlocked()
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Server blocked!")).exec();
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Instructor authorization.") + "\n" + tr("Server blocked!")).exec();
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ErrorAuth(QString error)
|
||||
{
|
||||
if(flTryLogin)
|
||||
{
|
||||
flTryLogin = false;
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
|
||||
QString errorTextMsg = "";
|
||||
|
||||
if(error == NOTIFY_ERROR_AUTH_DB)
|
||||
{
|
||||
errorTextMsg = tr("Database error!");
|
||||
}
|
||||
else if(error == NOTIFY_ERROR_AUTH_ARCHIVED)
|
||||
{
|
||||
errorTextMsg = tr("The user is archived!");
|
||||
}
|
||||
else if(error == NOTIFY_ERROR_AUTH_ALREADYLOGIN)
|
||||
{
|
||||
errorTextMsg = tr("The user is already logged in!");
|
||||
}
|
||||
else if(error == NOTIFY_ERROR_AUTH_LOGINORPASSWORD)
|
||||
{
|
||||
errorTextMsg = tr("Login or password error!");
|
||||
}
|
||||
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Instructor authorization.") + "\n" + errorTextMsg).exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user