mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Исправил VersionSelectWidget
This commit is contained in:
@@ -11,17 +11,13 @@ ConnectorToServer::ConnectorToServer(QWidget* parentWidget, QObject *parent) :
|
|||||||
recognizeSystem(nullptr),
|
recognizeSystem(nullptr),
|
||||||
versionSelectWidget(nullptr),
|
versionSelectWidget(nullptr),
|
||||||
versionContainer(nullptr),
|
versionContainer(nullptr),
|
||||||
notifyController(nullptr),
|
notifyController(nullptr)
|
||||||
waitAnimationWidget(nullptr)
|
|
||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConnectorToServer::~ConnectorToServer()
|
ConnectorToServer::~ConnectorToServer()
|
||||||
{
|
{
|
||||||
waitAnimationWidget->hideWithStop();
|
|
||||||
|
|
||||||
delete waitAnimationWidget;
|
|
||||||
delete client;
|
delete client;
|
||||||
delete versionSelectWidget;
|
delete versionSelectWidget;
|
||||||
delete notifyController;
|
delete notifyController;
|
||||||
@@ -399,18 +395,6 @@ void ConnectorToServer::initialize()
|
|||||||
SetConnectToServer();
|
SetConnectToServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectorToServer::activateLoadAnimation(bool flag)
|
|
||||||
{
|
|
||||||
if (flag)
|
|
||||||
{
|
|
||||||
waitAnimationWidget->showWithPlay();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
waitAnimationWidget->hideWithStop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConnectorToServer::bindConnection()
|
void ConnectorToServer::bindConnection()
|
||||||
{
|
{
|
||||||
connect(this,&ConnectorToServer::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
|
connect(this,&ConnectorToServer::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
|
||||||
@@ -438,7 +422,6 @@ void ConnectorToServer::bindConnection()
|
|||||||
|
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_FIM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_FIM);
|
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_FIM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_FIM);
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_AMM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_AMM);
|
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_AMM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_AMM);
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigAnimationActivated,this,&ConnectorToServer::activateLoadAnimation,Qt::AutoConnection);
|
|
||||||
|
|
||||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer,Qt::AutoConnection);
|
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer,Qt::AutoConnection);
|
||||||
|
|
||||||
@@ -452,9 +435,7 @@ void ConnectorToServer::createObjects()
|
|||||||
client = new TCPClient;
|
client = new TCPClient;
|
||||||
client->moveToThread(connectionThread);
|
client->moveToThread(connectionThread);
|
||||||
|
|
||||||
dataParser = new DataParser;
|
dataParser = new DataParser;
|
||||||
|
|
||||||
waitAnimationWidget = new WaitAnimationWidget;
|
|
||||||
|
|
||||||
sendSystem = new SendSystem;
|
sendSystem = new SendSystem;
|
||||||
sendSystem->moveToThread(connectionThread);
|
sendSystem->moveToThread(connectionThread);
|
||||||
@@ -465,13 +446,7 @@ void ConnectorToServer::createObjects()
|
|||||||
notifyController = new NotifyController;
|
notifyController = new NotifyController;
|
||||||
versionContainer = new VersionContainer;
|
versionContainer = new VersionContainer;
|
||||||
versionSelectWidget = new VersionSelectWidget(parentWidget);
|
versionSelectWidget = new VersionSelectWidget(parentWidget);
|
||||||
versionSelectWidget->initialize(sendSystem,versionContainer,notifyController);
|
versionSelectWidget->initialize(sendSystem,versionContainer,notifyController, recognizeSystem);
|
||||||
|
|
||||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
|
||||||
|
|
||||||
waitAnimationWidget->setParent(versionSelectWidget);
|
|
||||||
waitAnimationWidget->initialize(movie,versionSelectWidget);
|
|
||||||
waitAnimationWidget->moveToThread(connectionThread);
|
|
||||||
|
|
||||||
connectionThread->start();
|
connectionThread->start();
|
||||||
connectionThread->setPriority(QThread::HighestPriority);
|
connectionThread->setPriority(QThread::HighestPriority);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <widgets/versionselectwidget.h>
|
#include <widgets/versionselectwidget.h>
|
||||||
#include <widgets/waitanimationwidget.h>
|
|
||||||
#include "Core\tcpclient.h"
|
#include "Core\tcpclient.h"
|
||||||
#include "Core\dataparser.h"
|
#include "Core\dataparser.h"
|
||||||
#include "Core\sendsystem.h"
|
#include "Core\sendsystem.h"
|
||||||
@@ -63,7 +62,6 @@ public:
|
|||||||
int getIdTraineeByLogin(QString login);
|
int getIdTraineeByLogin(QString login);
|
||||||
void showVersionSelect();
|
void showVersionSelect();
|
||||||
|
|
||||||
void activateLoadAnimation(bool flag);
|
|
||||||
void setLoginName(QString name);
|
void setLoginName(QString name);
|
||||||
|
|
||||||
ServerSettings getServerSettings();
|
ServerSettings getServerSettings();
|
||||||
@@ -129,7 +127,6 @@ private:
|
|||||||
VersionSelectWidget *versionSelectWidget;
|
VersionSelectWidget *versionSelectWidget;
|
||||||
VersionContainer *versionContainer;
|
VersionContainer *versionContainer;
|
||||||
NotifyController *notifyController;
|
NotifyController *notifyController;
|
||||||
WaitAnimationWidget *waitAnimationWidget;
|
|
||||||
|
|
||||||
//Списочная модель БД СУО
|
//Списочная модель БД СУО
|
||||||
QList<Instructor> listInstructors;
|
QList<Instructor> listInstructors;
|
||||||
|
|||||||
@@ -3,23 +3,36 @@
|
|||||||
#include "ui_versionselectwidget.h"
|
#include "ui_versionselectwidget.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QResizeEvent>
|
||||||
|
|
||||||
VersionSelectWidget::VersionSelectWidget(QWidget *parent) :
|
VersionSelectWidget::VersionSelectWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::VersionSelectWidget),
|
ui(new Ui::VersionSelectWidget),
|
||||||
selectedVersion(nullptr)
|
selectedVersion(nullptr),
|
||||||
|
waitAnimationWidget(nullptr),
|
||||||
|
recognizeSystem(nullptr)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||||
setAttribute(Qt::WA_ShowModal,true);
|
setAttribute(Qt::WA_ShowModal,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VersionSelectWidget::initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController)
|
void VersionSelectWidget::initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController, RecognizeSystem *recognizeSystem)
|
||||||
{
|
{
|
||||||
|
this->recognizeSystem = recognizeSystem;
|
||||||
|
|
||||||
|
waitAnimationWidget = new WaitAnimationWidget;
|
||||||
|
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||||
|
waitAnimationWidget->setParent(this);
|
||||||
|
waitAnimationWidget->initialize(movie,this);
|
||||||
|
|
||||||
connect(this,&VersionSelectWidget::sigSendSwitchVersion,sendSystem,&SendSystem::sendChangeVersion,Qt::AutoConnection);
|
connect(this,&VersionSelectWidget::sigSendSwitchVersion,sendSystem,&SendSystem::sendChangeVersion,Qt::AutoConnection);
|
||||||
connect(this,&VersionSelectWidget::sigSendCopyVersion,sendSystem,&SendSystem::sendCopyVersion,Qt::AutoConnection);
|
connect(this,&VersionSelectWidget::sigSendCopyVersion,sendSystem,&SendSystem::sendCopyVersion,Qt::AutoConnection);
|
||||||
connect(this,&VersionSelectWidget::sigSendDeleteVersion,sendSystem,&SendSystem::sendDeleteVersion,Qt::AutoConnection);
|
connect(this,&VersionSelectWidget::sigSendDeleteVersion,sendSystem,&SendSystem::sendDeleteVersion,Qt::AutoConnection);
|
||||||
connect(this,&VersionSelectWidget::sigSendNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
connect(this,&VersionSelectWidget::sigSendNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
||||||
|
|
||||||
|
connect(recognizeSystem,&RecognizeSystem::sigAnimationActivated,this,&VersionSelectWidget::activateLoadAnimation,Qt::AutoConnection);
|
||||||
|
|
||||||
this->versionContainer = versionContainer;
|
this->versionContainer = versionContainer;
|
||||||
hide();
|
hide();
|
||||||
setWindowTitle(tr("Version control"));
|
setWindowTitle(tr("Version control"));
|
||||||
@@ -66,7 +79,7 @@ void VersionSelectWidget::on_createDuplicateButton_clicked()
|
|||||||
|
|
||||||
if (selectedVersion == nullptr)
|
if (selectedVersion == nullptr)
|
||||||
{
|
{
|
||||||
sigSendNotify(tr("Version not selected"));
|
emit sigSendNotify(tr("Version not selected"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +106,7 @@ void VersionSelectWidget::sendCopyEmit(QString newName)
|
|||||||
|
|
||||||
if (selectedVersion == nullptr)
|
if (selectedVersion == nullptr)
|
||||||
{
|
{
|
||||||
sigSendNotify(tr("Version not selected"));
|
emit sigSendNotify(tr("Version not selected"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +118,7 @@ void VersionSelectWidget::on_DeleteVersionButton_clicked()
|
|||||||
{
|
{
|
||||||
if (selectedVersion == nullptr)
|
if (selectedVersion == nullptr)
|
||||||
{
|
{
|
||||||
sigSendNotify(tr("Version not selected"));
|
emit sigSendNotify(tr("Version not selected"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +129,7 @@ void VersionSelectWidget::on_switchServerVersionButton_clicked()
|
|||||||
{
|
{
|
||||||
if (selectedVersion == nullptr)
|
if (selectedVersion == nullptr)
|
||||||
{
|
{
|
||||||
sigSendNotify(tr("Version not selected"));
|
emit sigSendNotify(tr("Version not selected"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,13 +138,35 @@ void VersionSelectWidget::on_switchServerVersionButton_clicked()
|
|||||||
emit sigSendSwitchVersion(selectedVersion);
|
emit sigSendSwitchVersion(selectedVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VersionSelectWidget::activateLoadAnimation(bool flag)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void VersionSelectWidget::setAuthor(QString name)
|
void VersionSelectWidget::setAuthor(QString name)
|
||||||
{
|
{
|
||||||
authorName = name;
|
authorName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VersionSelectWidget::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
QSize size = event->size();
|
||||||
|
waitAnimationWidget->resize(size);
|
||||||
|
}
|
||||||
|
|
||||||
VersionSelectWidget::~VersionSelectWidget()
|
VersionSelectWidget::~VersionSelectWidget()
|
||||||
{
|
{
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
|
|
||||||
|
delete waitAnimationWidget;
|
||||||
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
#include <Core/notifycontroller.h>
|
#include <Core/notifycontroller.h>
|
||||||
#include <streamingversiondata.h>
|
#include <streamingversiondata.h>
|
||||||
#include <Widgets/newversionwidget.h>
|
#include <Widgets/newversionwidget.h>
|
||||||
|
#include <widgets/waitanimationwidget.h>
|
||||||
|
|
||||||
|
#include "recognizesystem.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class VersionSelectWidget;
|
class VersionSelectWidget;
|
||||||
@@ -20,19 +23,24 @@ class VersionSelectWidget : public QWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit VersionSelectWidget(QWidget *parent = nullptr);
|
explicit VersionSelectWidget(QWidget *parent = nullptr);
|
||||||
|
~VersionSelectWidget();
|
||||||
|
|
||||||
void initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController);
|
void initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController, RecognizeSystem *recognizeSystem);
|
||||||
void fillView(QList<StreamingVersionData*> *serverData);
|
void fillView(QList<StreamingVersionData*> *serverData);
|
||||||
void sendCopyEmit(QString newName);
|
void sendCopyEmit(QString newName);
|
||||||
void setAuthor(QString name);
|
void setAuthor(QString name);
|
||||||
|
|
||||||
~VersionSelectWidget();
|
public:
|
||||||
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_verListView_itemDoubleClicked(QListWidgetItem *item);
|
void on_verListView_itemDoubleClicked(QListWidgetItem *item);
|
||||||
void on_createDuplicateButton_clicked();
|
void on_createDuplicateButton_clicked();
|
||||||
void on_DeleteVersionButton_clicked();
|
void on_DeleteVersionButton_clicked();
|
||||||
void on_switchServerVersionButton_clicked();
|
void on_switchServerVersionButton_clicked();
|
||||||
|
|
||||||
|
void activateLoadAnimation(bool flag);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sigSendDeleteVersion(StreamingVersionData *streaming);
|
void sigSendDeleteVersion(StreamingVersionData *streaming);
|
||||||
void sigSendSwitchVersion(StreamingVersionData *selectVersion);
|
void sigSendSwitchVersion(StreamingVersionData *selectVersion);
|
||||||
@@ -46,6 +54,8 @@ private:
|
|||||||
VersionContainer *versionContainer;
|
VersionContainer *versionContainer;
|
||||||
NotifyController *notifyController;
|
NotifyController *notifyController;
|
||||||
StreamingVersionData *selectedVersion;
|
StreamingVersionData *selectedVersion;
|
||||||
|
WaitAnimationWidget *waitAnimationWidget;
|
||||||
|
RecognizeSystem *recognizeSystem;
|
||||||
|
|
||||||
QString authorName;
|
QString authorName;
|
||||||
QString changableText(bool flag);
|
QString changableText(bool flag);
|
||||||
|
|||||||
Reference in New Issue
Block a user