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