mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Wait крутилки на все действия с редакторами
This commit is contained in:
@@ -13,14 +13,22 @@ CommonView::CommonView(ConnectorToServer* connectorToServer, TypeView type, QWid
|
|||||||
adminMode(false),
|
adminMode(false),
|
||||||
authComplited(false),
|
authComplited(false),
|
||||||
lastCurrentID(0),
|
lastCurrentID(0),
|
||||||
typeObject(TypeObject::objInstructor)
|
typeObject(TypeObject::objInstructor),
|
||||||
|
waitAnimationWidget(nullptr)
|
||||||
{
|
{
|
||||||
treeWidget = new QTreeWidget();
|
treeWidget = new QTreeWidget();
|
||||||
|
|
||||||
//treeWidget->setIconSize(QSize(20, 20));
|
|
||||||
treeWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
treeWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||||
|
|
||||||
//updateMyStyleSheet();
|
waitAnimationWidget = new WaitAnimationWidget;
|
||||||
|
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||||
|
//waitAnimationWidget->setParent(this);
|
||||||
|
waitAnimationWidget->initialize(movie,this);
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonView::~CommonView()
|
||||||
|
{
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
|
delete waitAnimationWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommonView::setItemColorArchive(QTreeWidgetItem *item)
|
void CommonView::setItemColorArchive(QTreeWidgetItem *item)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
||||||
|
~CommonView();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setAdminMode(bool adminMode)
|
void setAdminMode(bool adminMode)
|
||||||
@@ -67,6 +68,8 @@ protected:
|
|||||||
bool authComplited;
|
bool authComplited;
|
||||||
int lastCurrentID;
|
int lastCurrentID;
|
||||||
TypeObject typeObject;
|
TypeObject typeObject;
|
||||||
|
|
||||||
|
WaitAnimationWidget *waitAnimationWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COMMONVIEW_H
|
#endif // COMMONVIEW_H
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ EditorInstructors::EditorInstructors(ConnectorToServer* connectorToServer, bool
|
|||||||
|
|
||||||
if(adminMode)
|
if(adminMode)
|
||||||
ui->btnArchive->click();
|
ui->btnArchive->click();
|
||||||
|
|
||||||
|
waitAnimationWidget->setParent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorInstructors::~EditorInstructors()
|
EditorInstructors::~EditorInstructors()
|
||||||
@@ -34,7 +36,10 @@ void EditorInstructors::on_btnNewInstructor_clicked()
|
|||||||
Instructor instructor_edit;
|
Instructor instructor_edit;
|
||||||
|
|
||||||
if(editInstructor(instructor, &instructor_edit))
|
if(editInstructor(instructor, &instructor_edit))
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR, 0, &instructor_edit);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR, 0, &instructor_edit);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
@@ -111,6 +116,7 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
|
|||||||
|
|
||||||
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||||
{
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,6 +142,7 @@ void EditorInstructors::on_btnToOrFromArchive_clicked()
|
|||||||
if(connectorToServer->isArchivedInstructor(id))
|
if(connectorToServer->isArchivedInstructor(id))
|
||||||
{//Архивный
|
{//Архивный
|
||||||
instructor.setArchived(false);
|
instructor.setArchived(false);
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -147,6 +154,7 @@ void EditorInstructors::on_btnToOrFromArchive_clicked()
|
|||||||
}
|
}
|
||||||
|
|
||||||
instructor.setArchived(true);
|
instructor.setArchived(true);
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
||||||
if(!archiveVisible)
|
if(!archiveVisible)
|
||||||
ui->btnArchive->click();
|
ui->btnArchive->click();
|
||||||
@@ -189,7 +197,10 @@ void EditorInstructors::on_btnEdit_clicked()
|
|||||||
Instructor instructor_edit;
|
Instructor instructor_edit;
|
||||||
|
|
||||||
if(editInstructor(instructor, &instructor_edit))
|
if(editInstructor(instructor, &instructor_edit))
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor_edit);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor_edit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
#include <QResizeEvent>
|
||||||
#include "instructorsview.h"
|
#include "instructorsview.h"
|
||||||
|
|
||||||
InstructorsView::InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
InstructorsView::InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||||
@@ -36,6 +37,9 @@ void InstructorsView::resizeEvent(QResizeEvent *event)
|
|||||||
widthInstructor = 250;
|
widthInstructor = 250;
|
||||||
|
|
||||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Instructor, widthInstructor);
|
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Instructor, widthInstructor);
|
||||||
|
|
||||||
|
QSize size = event->size();
|
||||||
|
waitAnimationWidget->resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||||
@@ -170,6 +174,8 @@ void InstructorsView::loadInstructorsFromDB()
|
|||||||
treeWidget->sortItems(ColumnsTreeInsructors::clmn_Instructor, Qt::SortOrder::AscendingOrder);
|
treeWidget->sortItems(ColumnsTreeInsructors::clmn_Instructor, Qt::SortOrder::AscendingOrder);
|
||||||
|
|
||||||
mtxTreeWidget.unlock();
|
mtxTreeWidget.unlock();
|
||||||
|
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstructorsView::reSetHeadTreeWidget()
|
void InstructorsView::reSetHeadTreeWidget()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ EditorTrainees::EditorTrainees(ConnectorToServer* connectorToServer, bool adminM
|
|||||||
TraineesView(connectorToServer, CommonView::TypeView::control, parent),
|
TraineesView(connectorToServer, CommonView::TypeView::control, parent),
|
||||||
ui(new Ui::EditorTrainees)
|
ui(new Ui::EditorTrainees)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &EditorTrainees::on_treeWidget_currentItemChanged);
|
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &EditorTrainees::on_treeWidget_currentItemChanged);
|
||||||
|
|
||||||
@@ -22,6 +22,8 @@ EditorTrainees::EditorTrainees(ConnectorToServer* connectorToServer, bool adminM
|
|||||||
|
|
||||||
if(adminMode)
|
if(adminMode)
|
||||||
ui->btnArchive->click();
|
ui->btnArchive->click();
|
||||||
|
|
||||||
|
waitAnimationWidget->setParent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorTrainees::~EditorTrainees()
|
EditorTrainees::~EditorTrainees()
|
||||||
@@ -35,7 +37,10 @@ void EditorTrainees::on_btnNewGroup_clicked()
|
|||||||
Group group_edit;
|
Group group_edit;
|
||||||
|
|
||||||
if(editGroup(group, &group_edit))
|
if(editGroup(group, &group_edit))
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_GROUP, 0, &group_edit);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_GROUP, 0, &group_edit);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
@@ -106,6 +111,7 @@ void EditorTrainees::on_btnDeleteGroup_clicked()
|
|||||||
{//Пустая группа
|
{//Пустая группа
|
||||||
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||||
{
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_GROUP, id_group);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_GROUP, id_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,8 +134,10 @@ void EditorTrainees::on_btnNewTrainee_clicked()
|
|||||||
Trainee trainee_edit;
|
Trainee trainee_edit;
|
||||||
|
|
||||||
if(editTrainee(trainee, &trainee_edit))
|
if(editTrainee(trainee, &trainee_edit))
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_TRAINEE, id_group, &trainee_edit);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_TRAINEE, id_group, &trainee_edit);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -207,6 +215,7 @@ void EditorTrainees::on_btnDeleteTrainee_clicked()
|
|||||||
|
|
||||||
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||||
{
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TRAINEE, id_trainee);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TRAINEE, id_trainee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,7 +241,8 @@ void EditorTrainees::on_btnToOrFromArchiveTrainee_clicked()
|
|||||||
if(connectorToServer->isArchivedTrainee(id_trainee))
|
if(connectorToServer->isArchivedTrainee(id_trainee))
|
||||||
{//Архивный
|
{//Архивный
|
||||||
trainee.setArchived(false);
|
trainee.setArchived(false);
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE, id_trainee, &trainee);
|
waitAnimationWidget->showWithPlay();
|
||||||
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE, id_trainee, &trainee);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//Не Архивный
|
{//Не Архивный
|
||||||
@@ -243,7 +253,8 @@ void EditorTrainees::on_btnToOrFromArchiveTrainee_clicked()
|
|||||||
}
|
}
|
||||||
|
|
||||||
trainee.setArchived(true);
|
trainee.setArchived(true);
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE, id_trainee, &trainee);
|
waitAnimationWidget->showWithPlay();
|
||||||
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE, id_trainee, &trainee);
|
||||||
if(!archiveVisible)
|
if(!archiveVisible)
|
||||||
ui->btnArchive->click();
|
ui->btnArchive->click();
|
||||||
}
|
}
|
||||||
@@ -271,7 +282,10 @@ void EditorTrainees::on_btnEdit_clicked()
|
|||||||
Group group_edit;
|
Group group_edit;
|
||||||
|
|
||||||
if(editGroup(group, &group_edit))
|
if(editGroup(group, &group_edit))
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_GROUP, id_group, &group_edit);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_GROUP, id_group, &group_edit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//Выбран обучаемый
|
{//Выбран обучаемый
|
||||||
@@ -291,7 +305,10 @@ void EditorTrainees::on_btnEdit_clicked()
|
|||||||
Trainee trainee_edit;
|
Trainee trainee_edit;
|
||||||
|
|
||||||
if(editTrainee(trainee, &trainee_edit))
|
if(editTrainee(trainee, &trainee_edit))
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE, id_trainee, &trainee_edit);
|
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE, id_trainee, &trainee_edit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
#include <QResizeEvent>
|
||||||
#include "traineesview.h"
|
#include "traineesview.h"
|
||||||
|
|
||||||
TraineesView::TraineesView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
TraineesView::TraineesView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||||
@@ -37,6 +38,9 @@ void TraineesView::resizeEvent(QResizeEvent *event)
|
|||||||
widthTrainee = 250;
|
widthTrainee = 250;
|
||||||
|
|
||||||
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Trainee, widthTrainee);
|
treeWidget->setColumnWidth(ColumnsTreeTrainees::clmn_Trainee, widthTrainee);
|
||||||
|
|
||||||
|
QSize size = event->size();
|
||||||
|
waitAnimationWidget->resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraineesView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
void TraineesView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||||
@@ -200,6 +204,8 @@ void TraineesView::loadTraineesFromDB()
|
|||||||
treeWidget->sortItems(ColumnsTreeTrainees::clmn_Trainee, Qt::SortOrder::AscendingOrder);
|
treeWidget->sortItems(ColumnsTreeTrainees::clmn_Trainee, Qt::SortOrder::AscendingOrder);
|
||||||
|
|
||||||
mtxTreeWidget.unlock();
|
mtxTreeWidget.unlock();
|
||||||
|
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraineesView::reSetHeadTreeWidget()
|
void TraineesView::reSetHeadTreeWidget()
|
||||||
|
|||||||
Reference in New Issue
Block a user