From 19222cd8555c63cd64d116535a9af27e63b77ab8 Mon Sep 17 00:00:00 2001 From: krivoshein Date: Fri, 23 Jan 2026 12:17:41 +0300 Subject: [PATCH] =?UTF-8?q?waitAnimationWidget=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B6=D0=B8=D0=B4=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D1=82=D0=B2-=D1=8F=20=D0=B1=D0=BB=D0=BE=D0=BA-=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../instructors/viewerinstructors.cpp | 6 +++++- .../instructors/viewerinstructors.h | 2 ++ .../instructorsandtraineeswidget.cpp | 14 +++++++++++++- .../instructorsandtraineeswidget.h | 2 ++ .../settings/dialogsettings.cpp | 10 ++++++++++ .../settings/dialogsettings.h | 2 ++ .../trainees/viewertrainees.cpp | 4 ++++ .../trainees/viewertrainees.h | 2 ++ 8 files changed, 40 insertions(+), 2 deletions(-) diff --git a/LibInstructorsAndTrainees/instructors/viewerinstructors.cpp b/LibInstructorsAndTrainees/instructors/viewerinstructors.cpp index 03bb508..91adf82 100644 --- a/LibInstructorsAndTrainees/instructors/viewerinstructors.cpp +++ b/LibInstructorsAndTrainees/instructors/viewerinstructors.cpp @@ -102,6 +102,8 @@ void ViewerInstructors::slot_checkTryBlockResult(bool result, QString type) void ViewerInstructors::on_btnEditorInstructors_clicked() { + emit signal_needShowWait(true); + flTryEditorInstructors = true; connectorToServer->sendQueryBlockAuth(true, "EditorInstructors"); @@ -159,6 +161,8 @@ void ViewerInstructors::updateButtons() void ViewerInstructors::dialog_EditorInstructors() { + emit signal_needShowWait(false); + dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this); dlgRedactor->exec(); @@ -171,5 +175,5 @@ void ViewerInstructors::dialog_EditorInstructors() if(authComplited) loadInstructorsFromDB(); - connectorToServer->sendQueryBlockAuth(false, "EditorInstructors"); + connectorToServer->sendQueryBlockAuth(false, "EditorInstructors"); } diff --git a/LibInstructorsAndTrainees/instructors/viewerinstructors.h b/LibInstructorsAndTrainees/instructors/viewerinstructors.h index fc8239b..616d6fa 100644 --- a/LibInstructorsAndTrainees/instructors/viewerinstructors.h +++ b/LibInstructorsAndTrainees/instructors/viewerinstructors.h @@ -40,6 +40,8 @@ Q_SIGNALS: //сигнал о выборе инструктора void signal_instructorSelected(int id_instructor); + void signal_needShowWait(bool flNeed); + private: void updateButtons() override; diff --git a/LibInstructorsAndTrainees/instructorsandtraineeswidget.cpp b/LibInstructorsAndTrainees/instructorsandtraineeswidget.cpp index 3a64d7e..c809e27 100644 --- a/LibInstructorsAndTrainees/instructorsandtraineeswidget.cpp +++ b/LibInstructorsAndTrainees/instructorsandtraineeswidget.cpp @@ -68,7 +68,9 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) : connect(connectorToServer, &ConnectorToServer::signal_ConnectedToServer, this, &InstructorsAndTraineesWidget::slot_ConnectedToServer); 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_needShowWait, this, &InstructorsAndTraineesWidget::slot_needShowWait); connect(messangerController, &MessangerController::signal_receiveMessage_fromInstructor, viewerInstructors, &ViewerInstructors::slot_receiveMessage); connect(messangerController, &MessangerController::signal_receiveMessage_fromTrainee, viewerTrainees, &ViewerTrainees::slot_receiveMessage); @@ -425,7 +427,8 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state) if(!flTryConnectToServer) { 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 @@ -487,6 +490,14 @@ void InstructorsAndTraineesWidget::slot_ServerBlockState(bool state) updateLabelServer(); } +void InstructorsAndTraineesWidget::slot_needShowWait(bool flNeed) +{ + if(flNeed) + waitAnimationWidget->showWithPlay(); + else + waitAnimationWidget->hideWithStop(); +} + bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* 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_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet); + //connect(dlgSettings, &DialogSettings::signal_needShowWait, this, &InstructorsAndTraineesWidget::slot_needShowWait); switch( dlgSettings->exec() ) { diff --git a/LibInstructorsAndTrainees/instructorsandtraineeswidget.h b/LibInstructorsAndTrainees/instructorsandtraineeswidget.h index 23d1bb4..c4520fa 100644 --- a/LibInstructorsAndTrainees/instructorsandtraineeswidget.h +++ b/LibInstructorsAndTrainees/instructorsandtraineeswidget.h @@ -70,6 +70,8 @@ public Q_SLOTS: void slot_ServerBlockState(bool state); + void slot_needShowWait(bool flNeed); + Q_SIGNALS: //сигнал смены языка void signal_LanguageChanged(QString language); diff --git a/LibInstructorsAndTrainees/settings/dialogsettings.cpp b/LibInstructorsAndTrainees/settings/dialogsettings.cpp index 1ca7567..320cb56 100644 --- a/LibInstructorsAndTrainees/settings/dialogsettings.cpp +++ b/LibInstructorsAndTrainees/settings/dialogsettings.cpp @@ -13,6 +13,7 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru settings(nullptr), connectorToServer(nullptr), dlgVersionControl(nullptr), + waitAnimationWidget(nullptr), flSettingsServerChanged(false), flTryVersionControl(false) { @@ -72,6 +73,11 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru flSettingsServerChanged = false; 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() @@ -218,6 +224,8 @@ void DialogSettings::on_btnSetVersion_clicked() if(connectorToServer) if(connectorToServer->getIsConnected()) { + waitAnimationWidget->showWithPlay(); + flTryVersionControl = true; connectorToServer->sendQueryBlockAuth(true, "VersionControl"); @@ -255,6 +263,8 @@ void DialogSettings::on_DialogSettings_accepted() void DialogSettings::dialog_VersionControl() { + waitAnimationWidget->hideWithStop(); + dlgVersionControl = new DialogVersionControl(connectorToServer, this); dlgVersionControl->initialize(connectorToServer->getLoginName()); dlgVersionControl->exec(); diff --git a/LibInstructorsAndTrainees/settings/dialogsettings.h b/LibInstructorsAndTrainees/settings/dialogsettings.h index 2956dc6..e7aea0c 100644 --- a/LibInstructorsAndTrainees/settings/dialogsettings.h +++ b/LibInstructorsAndTrainees/settings/dialogsettings.h @@ -62,6 +62,8 @@ private: DialogVersionControl *dlgVersionControl; + WaitAnimationWidget *waitAnimationWidget; + bool flSettingsServerChanged; bool flTryVersionControl; diff --git a/LibInstructorsAndTrainees/trainees/viewertrainees.cpp b/LibInstructorsAndTrainees/trainees/viewertrainees.cpp index 5d4d386..64623d4 100644 --- a/LibInstructorsAndTrainees/trainees/viewertrainees.cpp +++ b/LibInstructorsAndTrainees/trainees/viewertrainees.cpp @@ -136,6 +136,8 @@ void ViewerTrainees::slot_checkTryBlockResult(bool result, QString type) void ViewerTrainees::on_btnEditorTrainees_clicked() { + emit signal_needShowWait(true); + flTryEditorTrainees = true; connectorToServer->sendQueryBlockAuth(true, "EditorTrainees"); @@ -252,6 +254,8 @@ void ViewerTrainees::updateButtons() void ViewerTrainees::dialog_EditorTrainees() { + emit signal_needShowWait(false); + dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this); dlgRedactor->exec(); diff --git a/LibInstructorsAndTrainees/trainees/viewertrainees.h b/LibInstructorsAndTrainees/trainees/viewertrainees.h index 63a5bd9..8be1f99 100644 --- a/LibInstructorsAndTrainees/trainees/viewertrainees.h +++ b/LibInstructorsAndTrainees/trainees/viewertrainees.h @@ -49,6 +49,8 @@ Q_SIGNALS: //сигнал о выборе обучаемого void signal_traineeSelected(int id_trainee); + void signal_needShowWait(bool flNeed); + private: void updateButtons() override;