mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Отработка BUSSY
This commit is contained in:
@@ -85,6 +85,11 @@ void ConnectorToServer::slot_Auth(ServerAuthorization *serverAuth)
|
||||
emit sigLoginResult(serverAuth);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_ServerBlocked()
|
||||
{
|
||||
emit sigServerBlocked();
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_SendDeleteVersion(StreamingVersionData *streaming)
|
||||
{
|
||||
emit signal_SendDeleteVersion(streaming);
|
||||
@@ -126,6 +131,9 @@ void ConnectorToServer::bindConnection()
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&ConnectorToServer::slot_ServerBlocked);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_ReceiveMessage,this,&ConnectorToServer::signal_receiveMessage,Qt::AutoConnection);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigShowServerDataList,this,&ConnectorToServer::slot_showServerList);
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ public slots:
|
||||
void slot_showServerList(QList<StreamingVersionData*> *serverList);
|
||||
void slot_HashReady();
|
||||
void slot_Auth(ServerAuthorization * serverAuth);
|
||||
void slot_ServerBlocked();
|
||||
|
||||
void slot_SendDeleteVersion(StreamingVersionData *streaming);
|
||||
void slot_SendSwitchVersion(StreamingVersionData *selectVersion);
|
||||
@@ -123,6 +124,7 @@ signals:
|
||||
|
||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
void sigServerBlocked();
|
||||
|
||||
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -51,6 +51,9 @@ public Q_SLOTS:
|
||||
void slot_checkLoginResult(ServerAuthorization * serverAuth);
|
||||
//Слот обработки результата деавторизации
|
||||
void slot_checkDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void slot_ServerBlocked();
|
||||
|
||||
//Слот обработки результата подключения к серверу
|
||||
void slot_ConnectedToServer(bool state);
|
||||
|
||||
@@ -114,6 +117,8 @@ private:
|
||||
bool flTryConnectToServer;
|
||||
int cntTryConnectToServer;
|
||||
|
||||
bool flTryLogin;
|
||||
|
||||
Ui::InstructorsAndTraineesWidget *ui;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user