mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Отработка BUSSY
This commit is contained in:
@@ -31,6 +31,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
flSettingsServerIsChanged(false),
|
||||
flTryConnectToServer(false),
|
||||
cntTryConnectToServer(0),
|
||||
flTryLogin(false),
|
||||
ui(new Ui::InstructorsAndTraineesWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -51,6 +52,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
connectorToServer = new ConnectorToServer(this);
|
||||
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::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
||||
|
||||
messangerController = new MessangerController(connectorToServer, this);
|
||||
@@ -219,12 +221,18 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
|
||||
|
||||
viewerTrainees->activate();
|
||||
viewerInstructors->activate();
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization.") + "\n" + tr("Invalid login or password!")).exec();
|
||||
}
|
||||
|
||||
flTryLogin = false;
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization *serverDeAuth)
|
||||
@@ -253,6 +261,18 @@ void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ServerBlocked()
|
||||
{
|
||||
if(flTryLogin)
|
||||
{
|
||||
flTryLogin = false;
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Attention!") + "\n" + tr("Server blocked!")).exec();
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
{
|
||||
if(state)
|
||||
@@ -332,7 +352,9 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
|
||||
|
||||
updateLabelServer();
|
||||
}
|
||||
|
||||
flTryLogin = false;
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_traineeSelected(int id_trainee)
|
||||
@@ -402,6 +424,10 @@ bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent
|
||||
// Вычисление MD5 хэша
|
||||
password = HashTools::hashingMD5string(password);
|
||||
|
||||
waitAnimationWidget->showWithPlay();
|
||||
|
||||
flTryLogin = true;
|
||||
|
||||
connectorToServer->sendAuthorizationInstructorLocal(login, password);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user