waitAnimationWidget при ожидании подтв-я блок-ки

This commit is contained in:
2026-01-23 12:17:41 +03:00
parent fe15f059e4
commit 19222cd855
8 changed files with 40 additions and 2 deletions

View File

@@ -102,6 +102,8 @@ void ViewerInstructors::slot_checkTryBlockResult(bool result, QString type)
void ViewerInstructors::on_btnEditorInstructors_clicked() void ViewerInstructors::on_btnEditorInstructors_clicked()
{ {
emit signal_needShowWait(true);
flTryEditorInstructors = true; flTryEditorInstructors = true;
connectorToServer->sendQueryBlockAuth(true, "EditorInstructors"); connectorToServer->sendQueryBlockAuth(true, "EditorInstructors");
@@ -159,6 +161,8 @@ void ViewerInstructors::updateButtons()
void ViewerInstructors::dialog_EditorInstructors() void ViewerInstructors::dialog_EditorInstructors()
{ {
emit signal_needShowWait(false);
dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this); dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this);
dlgRedactor->exec(); dlgRedactor->exec();
@@ -171,5 +175,5 @@ void ViewerInstructors::dialog_EditorInstructors()
if(authComplited) if(authComplited)
loadInstructorsFromDB(); loadInstructorsFromDB();
connectorToServer->sendQueryBlockAuth(false, "EditorInstructors"); connectorToServer->sendQueryBlockAuth(false, "EditorInstructors");
} }

View File

@@ -40,6 +40,8 @@ Q_SIGNALS:
//сигнал о выборе инструктора //сигнал о выборе инструктора
void signal_instructorSelected(int id_instructor); void signal_instructorSelected(int id_instructor);
void signal_needShowWait(bool flNeed);
private: private:
void updateButtons() override; void updateButtons() override;

View File

@@ -68,7 +68,9 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
connect(connectorToServer, &ConnectorToServer::signal_ConnectedToServer, this, &InstructorsAndTraineesWidget::slot_ConnectedToServer); connect(connectorToServer, &ConnectorToServer::signal_ConnectedToServer, this, &InstructorsAndTraineesWidget::slot_ConnectedToServer);
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, this, &InstructorsAndTraineesWidget::slot_traineeSelected); connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, this, &InstructorsAndTraineesWidget::slot_traineeSelected);
connect(viewerTrainees, &ViewerTrainees::signal_needShowWait, this, &InstructorsAndTraineesWidget::slot_needShowWait);
connect(viewerInstructors, &ViewerInstructors::signal_instructorSelected, this, &InstructorsAndTraineesWidget::slot_instructorSelected); connect(viewerInstructors, &ViewerInstructors::signal_instructorSelected, this, &InstructorsAndTraineesWidget::slot_instructorSelected);
connect(viewerInstructors, &ViewerInstructors::signal_needShowWait, this, &InstructorsAndTraineesWidget::slot_needShowWait);
connect(messangerController, &MessangerController::signal_receiveMessage_fromInstructor, viewerInstructors, &ViewerInstructors::slot_receiveMessage); connect(messangerController, &MessangerController::signal_receiveMessage_fromInstructor, viewerInstructors, &ViewerInstructors::slot_receiveMessage);
connect(messangerController, &MessangerController::signal_receiveMessage_fromTrainee, viewerTrainees, &ViewerTrainees::slot_receiveMessage); connect(messangerController, &MessangerController::signal_receiveMessage_fromTrainee, viewerTrainees, &ViewerTrainees::slot_receiveMessage);
@@ -425,7 +427,8 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
if(!flTryConnectToServer) if(!flTryConnectToServer)
{ {
WidgetTools::closeAllChildWidgets(this, "SpecMsgBox"); WidgetTools::closeAllChildWidgets(this, "SpecMsgBox");
SpecMsgBox::WarningClose(this, tr("The server is not available!")); waitAnimationWidget->hideWithStop();
SpecMsgBox::WarningClose(this, tr("The server is not available!"));
} }
} }
else else
@@ -487,6 +490,14 @@ void InstructorsAndTraineesWidget::slot_ServerBlockState(bool state)
updateLabelServer(); updateLabelServer();
} }
void InstructorsAndTraineesWidget::slot_needShowWait(bool flNeed)
{
if(flNeed)
waitAnimationWidget->showWithPlay();
else
waitAnimationWidget->hideWithStop();
}
bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent) bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent)
{ {
dlgAuthorization = new DialogAuthorization(parent); dlgAuthorization = new DialogAuthorization(parent);
@@ -695,6 +706,7 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked()
connect(dlgSettings, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged); connect(dlgSettings, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
connect(dlgSettings, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet); connect(dlgSettings, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
//connect(dlgSettings, &DialogSettings::signal_needShowWait, this, &InstructorsAndTraineesWidget::slot_needShowWait);
switch( dlgSettings->exec() ) switch( dlgSettings->exec() )
{ {

View File

@@ -70,6 +70,8 @@ public Q_SLOTS:
void slot_ServerBlockState(bool state); void slot_ServerBlockState(bool state);
void slot_needShowWait(bool flNeed);
Q_SIGNALS: Q_SIGNALS:
//сигнал смены языка //сигнал смены языка
void signal_LanguageChanged(QString language); void signal_LanguageChanged(QString language);

View File

@@ -13,6 +13,7 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru
settings(nullptr), settings(nullptr),
connectorToServer(nullptr), connectorToServer(nullptr),
dlgVersionControl(nullptr), dlgVersionControl(nullptr),
waitAnimationWidget(nullptr),
flSettingsServerChanged(false), flSettingsServerChanged(false),
flTryVersionControl(false) flTryVersionControl(false)
{ {
@@ -72,6 +73,11 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru
flSettingsServerChanged = false; flSettingsServerChanged = false;
connect(connectorToServer, &ConnectorToServer::sigTryBlockResult, this, &DialogSettings::slot_checkTryBlockResult); connect(connectorToServer, &ConnectorToServer::sigTryBlockResult, this, &DialogSettings::slot_checkTryBlockResult);
waitAnimationWidget = new WaitAnimationWidget;
QMovie *movie = new QMovie(":/resources/icons/762.gif");
waitAnimationWidget->setParent(this);
waitAnimationWidget->initialize(movie,this);
} }
DialogSettings::~DialogSettings() DialogSettings::~DialogSettings()
@@ -218,6 +224,8 @@ void DialogSettings::on_btnSetVersion_clicked()
if(connectorToServer) if(connectorToServer)
if(connectorToServer->getIsConnected()) if(connectorToServer->getIsConnected())
{ {
waitAnimationWidget->showWithPlay();
flTryVersionControl = true; flTryVersionControl = true;
connectorToServer->sendQueryBlockAuth(true, "VersionControl"); connectorToServer->sendQueryBlockAuth(true, "VersionControl");
@@ -255,6 +263,8 @@ void DialogSettings::on_DialogSettings_accepted()
void DialogSettings::dialog_VersionControl() void DialogSettings::dialog_VersionControl()
{ {
waitAnimationWidget->hideWithStop();
dlgVersionControl = new DialogVersionControl(connectorToServer, this); dlgVersionControl = new DialogVersionControl(connectorToServer, this);
dlgVersionControl->initialize(connectorToServer->getLoginName()); dlgVersionControl->initialize(connectorToServer->getLoginName());
dlgVersionControl->exec(); dlgVersionControl->exec();

View File

@@ -62,6 +62,8 @@ private:
DialogVersionControl *dlgVersionControl; DialogVersionControl *dlgVersionControl;
WaitAnimationWidget *waitAnimationWidget;
bool flSettingsServerChanged; bool flSettingsServerChanged;
bool flTryVersionControl; bool flTryVersionControl;

View File

@@ -136,6 +136,8 @@ void ViewerTrainees::slot_checkTryBlockResult(bool result, QString type)
void ViewerTrainees::on_btnEditorTrainees_clicked() void ViewerTrainees::on_btnEditorTrainees_clicked()
{ {
emit signal_needShowWait(true);
flTryEditorTrainees = true; flTryEditorTrainees = true;
connectorToServer->sendQueryBlockAuth(true, "EditorTrainees"); connectorToServer->sendQueryBlockAuth(true, "EditorTrainees");
@@ -252,6 +254,8 @@ void ViewerTrainees::updateButtons()
void ViewerTrainees::dialog_EditorTrainees() void ViewerTrainees::dialog_EditorTrainees()
{ {
emit signal_needShowWait(false);
dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this); dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this);
dlgRedactor->exec(); dlgRedactor->exec();

View File

@@ -49,6 +49,8 @@ Q_SIGNALS:
//сигнал о выборе обучаемого //сигнал о выборе обучаемого
void signal_traineeSelected(int id_trainee); void signal_traineeSelected(int id_trainee);
void signal_needShowWait(bool flNeed);
private: private:
void updateButtons() override; void updateButtons() override;