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:
@@ -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