Переработан порядок передачи списков 0

This commit is contained in:
2026-02-02 14:57:09 +03:00
parent 466b2cd7fc
commit a6451d0261
8 changed files with 252 additions and 71 deletions

View File

@@ -29,6 +29,8 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
flTryConnectToServer(false),
cntTryConnectToServer(0),
flTryLogin(false),
flTryReceiveFIM(false),
flTryReceiveAMM(false),
language(languageENG),
versionStr("..."),
ui(new Ui::InstructorsAndTraineesWidget)
@@ -58,6 +60,10 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
connect(connectorToServer, &ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
connect(connectorToServer, &ConnectorToServer::signal_ServerBlockState, this, &InstructorsAndTraineesWidget::slot_ServerBlockState);
connect(connectorToServer, &ConnectorToServer::signal_UpdateTasksFIM, this, &InstructorsAndTraineesWidget::slot_UpdateTasksFIM);
connect(connectorToServer, &ConnectorToServer::signal_UpdateTasksAMM, this, &InstructorsAndTraineesWidget::slot_UpdateTasksAMM);
messangerController = new MessangerController(connectorToServer, this);
viewerTrainees = new ViewerTrainees(connectorToServer, messangerController, this);
@@ -244,13 +250,15 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
messangerController->setUserLocalGUI_ID(serverAuth->Id.toInt());
/*
connectorToServer->sendQueryTasksXML("fim");
connectorToServer->sendQueryTasksXML("amm");
*/
viewerTrainees->activate();
viewerInstructors->activate();
waitAnimationWidget->hideWithStop();
//waitAnimationWidget->hideWithStop();
flTryLogin = false;
}
@@ -258,6 +266,8 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
{
//waitAnimationWidget->hideWithStop();
//ui->btnAuthorizationInstructor->setChecked(false);
flTryReceiveFIM = false;
flTryReceiveAMM = false;
}
}
@@ -300,6 +310,8 @@ void InstructorsAndTraineesWidget::slot_ServerBlocked()
if(flTryLogin)
{
flTryLogin = false;
flTryReceiveFIM = false;
flTryReceiveAMM = false;
waitAnimationWidget->hideWithStop();
ui->btnAuthorizationInstructor->setChecked(false);
@@ -312,6 +324,8 @@ void InstructorsAndTraineesWidget::slot_ErrorAuth(QString error)
if(flTryLogin)
{
flTryLogin = false;
flTryReceiveFIM = false;
flTryReceiveAMM = false;
waitAnimationWidget->hideWithStop();
ui->btnAuthorizationInstructor->setChecked(false);
@@ -441,6 +455,8 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
updateLabelServer();
flTryLogin = false;
flTryReceiveFIM = false;
flTryReceiveAMM = false;
}
}
@@ -501,6 +517,26 @@ void InstructorsAndTraineesWidget::slot_needShowWait(bool flNeed)
waitAnimationWidget->hideWithStop();
}
void InstructorsAndTraineesWidget::slot_UpdateTasksAMM()
{
if(flTryReceiveAMM)
{
flTryReceiveAMM = false;
if(!flTryReceiveAMM && !flTryReceiveFIM)
waitAnimationWidget->hideWithStop();
}
}
void InstructorsAndTraineesWidget::slot_UpdateTasksFIM()
{
if(flTryReceiveFIM)
{
flTryReceiveFIM = false;
if(!flTryReceiveAMM && !flTryReceiveFIM)
waitAnimationWidget->hideWithStop();
}
}
bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent)
{
dlgAuthorization = new DialogAuthorization(parent);
@@ -528,6 +564,8 @@ bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent
waitAnimationWidget->showWithPlay();
flTryLogin = true;
flTryReceiveFIM = true;
flTryReceiveAMM = true;
connectorToServer->sendAuthorizationInstructorLocal(login, password);

View File

@@ -72,6 +72,9 @@ public Q_SLOTS:
void slot_needShowWait(bool flNeed);
void slot_UpdateTasksAMM();
void slot_UpdateTasksFIM();
Q_SIGNALS:
//сигнал смены языка
void signal_LanguageChanged(QString language);
@@ -118,6 +121,8 @@ private:
int cntTryConnectToServer;
bool flTryLogin;
bool flTryReceiveFIM;
bool flTryReceiveAMM;
QTranslator qtLanguageTranslator;
QString language;